From 30285bf323a5dc5b34879ef9d01172b55daaa139 Mon Sep 17 00:00:00 2001 From: zachir Date: Fri, 24 Feb 2023 10:30:08 -0600 Subject: overhaul browser menu scripts --- bm | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 bm (limited to 'bm') 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 +#}}} -- cgit v1.2.3