summaryrefslogtreecommitdiff
path: root/bm
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2023-02-24 10:30:08 -0600
committerzachir <zachir@librem.one>2023-02-24 10:30:08 -0600
commit30285bf323a5dc5b34879ef9d01172b55daaa139 (patch)
treed200def9d3385fb13ac43ac72b421bacf5649e68 /bm
parente1b62d8c73819f77972a79d3c0d02f89748a5d24 (diff)
overhaul browser menu scripts
Diffstat (limited to 'bm')
-rwxr-xr-xbm41
1 files changed, 41 insertions, 0 deletions
diff --git a/bm b/bm
new file mode 100755
index 0000000..98d3f0f
--- /dev/null
+++ b/bm
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+#{{{ printhelp
+printhelp () {
+ printf "bm: browser menu script; interface for browsers.\n"
+ printf " -b) basilisk interface\n"
+ printf " -d) firedragon interface\n"
+ printf " -f) firefox interface\n"
+ printf " -l) librewolf interface\n"
+ printf " -q) qutebrowser interface\n"
+ printf " -x) use X11 menu (dmenu)\n"
+ printf " -w) use Wayland menu (tofi)\n"
+ printf " -d ARG) provide menu args\n"
+ printf " -u ARG) provide URL to open\n"
+ exit
+}
+#}}}
+
+#{{{ getopts
+unset ARG
+while getopts "hbrflqxwd:u:" o; do case "${o}" in
+ b) BSC="y" ;;
+ r) FDC="y" ;;
+ f) FFC="y" ;;
+ l) LWC="y" ;;
+ q) QBC="y" ;;
+ x) ARG="$ARG-x " ;;
+ w) ARG="$ARG-w " ;;
+ d) ARG="$ARG-d $OPTARG ";;
+ u) ARG="$ARG-u $OPTARG " ;;
+ *) printhelp ;;
+esac done
+#}}}
+
+#{{{ main
+[ -n "$BSC" ] && bsc $ARG
+[ -n "$FDC" ] && fdc $ARG
+[ -n "$FFC" ] && ffc $ARG
+[ -n "$LWC" ] && lwc $ARG
+[ -n "$QBC" ] && qbc $ARG
+#}}}