summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbm41
-rwxr-xr-xbsc28
-rwxr-xr-xfdc28
-rwxr-xr-xffc56
-rwxr-xr-xlwc39
-rwxr-xr-xqbc35
6 files changed, 212 insertions, 15 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
+#}}}
diff --git a/bsc b/bsc
index 148ac48..81bc12c 100755
--- a/bsc
+++ b/bsc
@@ -1,5 +1,29 @@
#!/bin/sh
+
+#{{{ printhelp
+printhelp () {
+ printf "bsc: basilisk menu interface.\n"
+ printf " -u URL ) pass URL to browser\n"
+ printf " -d ARGS ) pass ARGS to menu command\n"
+ printf " -w ) use Wayland menu command (tofi)\n"
+ printf " -x ) use X11 menu command (dmenu)\n"
+ exit
+}
+#}}}
+
+#{{{ getopts
+while getopts "hwxd:u:" o; do case "${o}" in
+ d) DMENU_ARGS="$OPTARG" ;;
+ u) URL="$OPTARG" ;;
+ w) DMENU="tofi" ;;
+ x) DMENU="dmenu" ;;
+ *) printhelp ;;
+esac done
+#}}}
+
+#{{{ Choose Profiles
PROFILES=`grep 'Path=' ~/.moonchild\ productions/basilisk/profiles.ini | cut -d'.' -f2`
-CHOSEN=`echo "$PROFILES" | barmenu -l 15`
+CHOSEN=`echo "$PROFILES" | $DMENU $DMENU_ARGS`
[ -z "$CHOSEN" ] && exit 2
-basilisk -P "$CHOSEN"
+exec basilisk -P "$CHOSEN" $URL
+#}}}
diff --git a/fdc b/fdc
index 39773d6..84b44fa 100755
--- a/fdc
+++ b/fdc
@@ -1,5 +1,29 @@
#!/bin/sh
+
+#{{{ printhelp
+printhelp () {
+ printf "fdc: firedragon menu interface.\n"
+ printf " -u URL ) pass URL to browser\n"
+ printf " -d ARGS ) pass ARGS to menu command\n"
+ printf " -w ) use Wayland menu command (tofi)\n"
+ printf " -x ) use X11 menu command (dmenu)\n"
+ exit
+}
+#}}}
+
+#{{{ getopts
+while getopts "hwxd:u:" o; do case "${o}" in
+ d) DMENU_ARGS="$OPTARG" ;;
+ u) URL="$OPTARG" ;;
+ w) DMENU="tofi" ;;
+ x) DMENU="dmenu" ;;
+ *) printhelp ;;
+esac done
+#}}}
+
+#{{{ Choose Profiles
PROFILES=`grep 'Path=' ~/.firedragon/profiles.ini | cut -d'.' -f2`
-CHOSEN=`echo "$PROFILES" | barmenu -l 15`
+CHOSEN=`echo "$PROFILES" | $DMENU $DMENU_ARGS`
[ -z "$CHOSEN" ] && exit 2
-firedragon -P "$CHOSEN"
+exec firedragon -P "$CHOSEN" $URL
+#}}}
diff --git a/ffc b/ffc
index 7c7e03b..b88c35b 100755
--- a/ffc
+++ b/ffc
@@ -1,5 +1,55 @@
#!/bin/sh
-PROFILES=`grep 'Path=' ~/.mozilla/firefox/profiles.ini | cut -d'.' -f2`
-CHOSEN=`echo "$PROFILES" | barmenu -l 15`
+
+#{{{ printhelp
+printhelp () {
+ printf "ffc: firefox menu interface.\n"
+ printf " -u URL ) pass URL to browser\n"
+ printf " -d ARGS ) pass ARGS to menu command\n"
+ printf " -w ) use Wayland menu command (tofi)\n"
+ printf " -x ) use X11 menu command (dmenu)\n"
+ exit
+}
+#}}}
+
+#{{{ getopts
+while getopts "hwxd:u:" o; do case "${o}" in
+ d) DMENU_ARGS="$OPTARG" ;;
+ u) URL="$OPTARG" ;;
+ w) DMENU="tofi" ;;
+ x) DMENU="dmenu" ;;
+ *) printhelp ;;
+esac done
+#}}}
+
+#{{{ Native Profiles
+if [ -f ~/.mozilla/firefox/profiles.ini ]; then
+ NATIVE_PROFILES=`grep 'Path=' ~/.mozilla/firefox/profiles.ini | cut -d'.' -f2`
+else
+ unset NATIVE_PROFILES
+fi
+#}}}
+
+#{{{ Flatpak Profiles
+if [ -f ~/.var/app/org.mozilla.firefox/.mozilla/firefox/profiles.ini ]; then
+ FLATPAK_PROFILES=`grep 'Path=' ~/.var/app/org.mozilla.firefox/.mozilla/firefox/profiles.ini | cut -d'.' -f2 | sed 's/$/ F/g'`
+else
+ unset FLATPAK_PROFILES
+fi
+#}}}
+
+#{{{ Add Profiles
+if [ -n "$NATIVE_PROFILES" -a -n "$FLATPAK_PROFILES" ]; then
+ INT="\n"
+fi
+PROFILES="$NATIVE_PROFILES$INT$FLATPAK_PROFILES"
+#}}}
+
+#{{{ Choose Profiles
+CHOSEN=`printf "$PROFILES" | $DMENU $DMENU_ARGS`
[ -z "$CHOSEN" ] && exit 2
-firefox -P "$CHOSEN"
+if `echo "$CHOSEN" | grep -qE ' F$'`; then
+ exec flatpak run org.mozilla.Firefox -P `echo "$CHOSEN" | sed 's/ F$//'` $URL
+else
+ exec firefox -P "$CHOSEN" $URL
+fi
+#}}}
diff --git a/lwc b/lwc
index 05aa370..ea504b0 100755
--- a/lwc
+++ b/lwc
@@ -1,22 +1,55 @@
#!/bin/sh
+
+#{{{ printhelp
+printhelp () {
+ printf "lwc: librewolf menu interface.\n"
+ printf " -u URL ) pass URL to browser\n"
+ printf " -d ARGS ) pass ARGS to menu command\n"
+ printf " -w ) use Wayland menu command (tofi)\n"
+ printf " -x ) use X11 menu command (dmenu)\n"
+ exit
+}
+#}}}
+
+#{{{ getopts
+while getopts "hwxd:u:" o; do case "${o}" in
+ d) DMENU_ARGS="$OPTARG" ;;
+ u) URL="$OPTARG" ;;
+ w) DMENU="tofi" ;;
+ x) DMENU="dmenu" ;;
+ *) printhelp ;;
+esac done
+#}}}
+
+#{{{ Native Profiles
if [ -f ~/.librewolf/profiles.ini ]; then
NATIVE_PROFILES=`grep 'Path=' ~/.librewolf/profiles.ini | cut -d'.' -f2`
else
unset NATIVE_PROFILES
fi
+#}}}
+
+#{{{ Flatpak Profiles
if [ -f ~/.var/app/io.gitlab.librewolf-community/.librewolf/profiles.ini ]; then
FLATPAK_PROFILES=`grep 'Path=' ~/.var/app/io.gitlab.librewolf-community/.librewolf/profiles.ini | cut -d'.' -f2 | sed 's/$/ F/g'`
else
unset FLATPAK_PROFILES
fi
+#}}}
+
+#{{{ Add Profiles
if [ -n "$NATIVE_PROFILES" -a -n "$FLATPAK_PROFILES" ]; then
INT="\n"
fi
PROFILES="$NATIVE_PROFILES$INT$FLATPAK_PROFILES"
-CHOSEN=`printf "$PROFILES" | dmenu -l 15`
+#}}}
+
+#{{{ Choose Profiles
+CHOSEN=`printf "$PROFILES" | $DMENU $DMENU_ARGS`
[ -z "$CHOSEN" ] && exit 2
if `echo "$CHOSEN" | grep -qE ' F$'`; then
- exec flatpak run io.gitlab.librewolf-community -P `echo "$CHOSEN" | sed 's/ F$//'` "$@"
+ exec flatpak run io.gitlab.librewolf-community -P `echo "$CHOSEN" | sed 's/ F$//'` $URL
else
- exec librewolf -P "$CHOSEN" "$@"
+ exec librewolf -P "$CHOSEN" $URL
fi
+#}}}
diff --git a/qbc b/qbc
index 2bd3b6d..696a961 100755
--- a/qbc
+++ b/qbc
@@ -1,18 +1,43 @@
#!/bin/sh
+#{{{ printhelp
+printhelp () {
+ printf "qbc: qutebrowser menu interface.\n"
+ printf " -u URL ) pass URL to browser\n"
+ printf " -d ARGS ) pass ARGS to menu command\n"
+ printf " -w ) use Wayland menu command (tofi)\n"
+ printf " -x ) use X11 menu command (dmenu)\n"
+ exit
+}
+#}}}
+
+#{{{ getopts
+while getopts "hwxd:u:" o; do case "${o}" in
+ d) DMENU_ARGS="$OPTARG" ;;
+ u) URL="$OPTARG" ;;
+ w) DMENU="tofi" ;;
+ x) DMENU="dmenu" ;;
+ *) printhelp ;;
+esac done
+#}}}
+
+#{{{ Get Sessions
SESSIONS=`qbpm list`
-[ -z "$SESSIONS" ] && qutebrowser $@
-CHOSEN=`printf "default\n$SESSIONS" | barmenu -l 15`
+[ -z "$SESSIONS" ] && qutebrowser $@ && exit
+#}}}
+
+#{{{ Select Session
+CHOSEN=`printf "default\n$SESSIONS" | $DMENU $DMENU_ARGS`
[ -z "$CHOSEN" ] && exit 2
if [ -n "$CHOSEN" ]; then
if [ "$CHOSEN" = "default" ]; then
- qutebrowser $@
+ qutebrowser $URL
else
if [ -z `echo "$SESSIONS" | grep "$CHOSEN"` ]; then
qbpm new "$CHOSEN"
fi
- qbpm launch "$CHOSEN" $@
+ qbpm launch "$CHOSEN" $URL
#qutebrowser -B "$HOME/.local/share/$CHOSEN"
fi
fi
-
+#}}}