diff options
-rwxr-xr-x | bm | 24 | ||||
-rwxr-xr-x | bsc | 26 | ||||
-rwxr-xr-x | dmount | 36 | ||||
-rwxr-xr-x | fdc | 26 | ||||
-rwxr-xr-x | ffc | 26 | ||||
-rwxr-xr-x | lwc | 14 | ||||
-rwxr-xr-x | mbc | 26 | ||||
-rwxr-xr-x | mprisctl | 8 | ||||
-rwxr-xr-x | passmenu | 4 | ||||
-rwxr-xr-x | qbc | 26 | ||||
-rwxr-xr-x | scrshot | 8 |
11 files changed, 100 insertions, 124 deletions
@@ -10,8 +10,6 @@ printhelp () { printf " -l) librewolf interface\n" printf " -m) mullvad-browser 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 @@ -52,8 +50,6 @@ while getopts "hbBcrflmqxwd:u:" o; do case "${o}" in m) MBC="y" ;; q) QBC="y" ;; c) CLIPB="y" ;; - x) ARG="$ARG-x " ;; - w) ARG="$ARG-w " ;; d) ARG="$ARG-d $OPTARG ";; u) URL="$OPTARG " ;; *) printhelp ;; @@ -84,15 +80,15 @@ bra () { #}}} #{{{ Check display server if -w or -x not provided -if [ -z "$DMENU" ]; then - if [ -n "$WAYLAND_DISPLAY" ]; then - DMENU="bemenu" - elif [ -n "$DISPLAY" ]; then - DMENU="dmenu" - else - print "Can't tell if Wayland or X; what gives?\n" - exit 1 - fi +if [ -n "$WAYLAND_DISPLAY" ]; then + DMENU="tofi" + DEFARGS="-c $HOME/.config/tofi/themes/dmenu_vertical --prompt-text" +elif [ -n "$DISPLAY" ]; then + DMENU="dmenu" + DEFARGS=" -l 10 -p" +else + print "Can't tell if Wayland or X; what gives?\n" + exit 1 fi #}}} @@ -121,7 +117,7 @@ if [ -z "$CLIPB$BRA$BSC$FDC$FFC$LWC$MBC$QBC" ]; then echo "$BROWSERSINSTALLED" [ -z "$BROWSERSINSTALLED" ] && \ printf "No suitable browsers!\n" && exit 1 - BROWSERSEL="$(echo "$BROWSERSINSTALLED" | $DMENU -p "Browsers" -l 10 $ARG)" + BROWSERSEL="$(echo "$BROWSERSINSTALLED" | $DMENU $DEFARGS $ARG)" [ -z "$BROWSERSEL" ] && \ printf "No browser selected!\n" && exit 1 case "$BROWSERSEL" in @@ -5,38 +5,34 @@ 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 (bemenu)\n" - printf " -x ) use X11 menu command (dmenu)\n" exit } #}}} #{{{ getopts -while getopts "hwxd:u:" o; do case "${o}" in +while getopts "hd:u:" o; do case "${o}" in d) DMENU_ARGS="$OPTARG" ;; u) URL="$OPTARG" ;; - w) DMENU="bemenu" ;; - x) DMENU="dmenu" ;; *) printhelp ;; esac done #}}} #{{{ Check display server if -w or -x not provided -if [ -z "$DMENU" ]; then - if [ -n "$WAYLAND_DISPLAY" ]; then - DMENU="bemenu" - elif [ -n "$DISPLAY" ]; then - DMENU="dmenu" - else - print "Can't tell if Wayland or X; what gives?\n" - exit 1 - fi +if [ -n "$WAYLAND_DISPLAY" ]; then + DMENU="tofi" + DEFARGS="-c $HOME/.config/tofi/themes/dmenu_vertical --prompt-text" +elif [ -n "$DISPLAY" ]; then + DMENU="dmenu" + DEFARGS="-l 15 -p" +else + print "Can't tell if Wayland or X; what gives?\n" + exit 1 fi #}}} #{{{ Choose Profiles PROFILES=`grep 'Path=' ~/.moonchild\ productions/basilisk/profiles.ini | cut -d'.' -f2` -CHOSEN=`echo "$PROFILES" | $DMENU -p "basilisk" -l 15 $DMENU_ARGS` +CHOSEN=`echo "$PROFILES" | $DMENU $DEFARGS "basilisk" $DMENU_ARGS` [ -z "$CHOSEN" ] && exit 2 exec basilisk -P "$CHOSEN" $URL #}}} @@ -14,9 +14,7 @@ error_msg () { exit 1 } -while getopts "xwhpPugd:" o; do case "${o}" in - x) DMENU="dmenu" ;; - w) DMENU="bemenu" ;; +while getopts "hpPugd:" o; do case "${o}" in d) ARGS="$ARGS $OPTARG" ;; p) USE_USER_ID="y" ;; P) unset USE_USER_ID ;; @@ -31,19 +29,19 @@ while getopts "xwhpPugd:" o; do case "${o}" in exit 1;; esac done -if [ -z "$DMENU" ]; then - if [ -n "$WAYLAND_DISPLAY" ]; then - DMENU="bemenu" - elif [ -n "$DISPLAY" ]; then - DMENU="dmenu" - else - error_msg "Can't tell if Wayland or Xorg; is there a display server?" - fi +if [ -n "$WAYLAND_DISPLAY" ]; then + DMENU="tofi" + DEFARGS="-c $HOME/.config/tofi/themes/dmenu_vertical --prompt-text" +elif [ -n "$DISPLAY" ]; then + DMENU="dmenu" + DEFARGS="-l 10 -p" +else + error_msg "Can't tell if Wayland or Xorg; is there a display server?" fi case "$DMENU" in dmenu) PASSARG="-P" ;; - bemenu) PASSARG="-x" ;; + tofi) PASSARG="--hide-input=true" ;; esac check_crypto () { @@ -55,8 +53,8 @@ is_crypto () { } unlock_crypto () { - NAME="$(cat /dev/null | $DMENU -p "Name" $ARGS)" - PASSWORD="$(cat /dev/null | $DMENU -p "Password" $PASSARG $ARGS)" + NAME="$(cat /dev/null | $DMENU $DEFARGS "Name" $ARGS)" + PASSWORD="$(cat /dev/null | $DMENU $DEFARGS "Password" $PASSARG $ARGS)" echo "$PASSWORD" | sudo cryptsetup open "$1" "$NAME" || FAILED="y" unset PASSWORD [ -n "$FAILED" ] && \ @@ -79,11 +77,11 @@ get_available () { lsblk -oPATH,FSTYPE,MOUNTPOINT | tail -n+2 | while read i; do getmount() { \ [ -z "$chosen" ] && exit 1 # shellcheck disable=SC2086 - mp="$(find $1 2>/dev/null | $DMENU -l 10 $ARGS -p "Type in mount point.")" || error_msg "Canceled; no mount point chosen." + mp="$(find $1 2>/dev/null | $DMENU $ARGS $DEFARGS "Type in mount point.")" || error_msg "Canceled; no mount point chosen." test -z "$mp" && \ exit 1 if [ ! -d "$mp" ]; then - mkdiryn=$(printf "No\\nYes" | $DMENU -l 10 $ARGS -p "$mp does not exist. Create it?") || \ + mkdiryn=$(printf "No\\nYes" | $DMENU $ARGS $DEFARGS "$mp does not exist. Create it?") || \ exit 1 [ "$mkdiryn" = "Yes" ] && (mkdir -p "$mp" || doas mkdir -p "$mp") fi @@ -107,15 +105,15 @@ mount_device () { fi } -DEVICE="$(get_available | $DMENU -p "Devices" $ARGS -l 15)" +DEVICE="$(get_available | $DMENU $DEFARGS "Devices" $ARGS )" [ -z "$DEVICE" ] && exit 1 chosen="${DEVICE%% *}" if [ -n "$(is_crypto "$chosen")" ]; then unlock_crypto "$chosen" - unset DEVICE chosen DMENU ARGS PASSARG + unset DEVICE chosen DMENU DEFARGS ARGS PASSARG dmount fi mount_device "$chosen" -unset DEVICE chosen DMENU ARGS PASSARG +unset DEVICE chosen DMENU DEFARGS ARGS PASSARG @@ -5,38 +5,34 @@ 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 (bemenu)\n" - printf " -x ) use X11 menu command (dmenu)\n" exit } #}}} #{{{ getopts -while getopts "hwxd:u:" o; do case "${o}" in +while getopts "hd:u:" o; do case "${o}" in d) DMENU_ARGS="$OPTARG" ;; u) URL="$OPTARG" ;; - w) DMENU="bemenu" ;; - x) DMENU="dmenu" ;; *) printhelp ;; esac done #}}} #{{{ Check display server if -w or -x not provided -if [ -z "$DMENU" ]; then - if [ -n "$WAYLAND_DISPLAY" ]; then - DMENU="bemenu" - elif [ -n "$DISPLAY" ]; then - DMENU="dmenu" - else - print "Can't tell if Wayland or X; what gives?\n" - exit 1 - fi +if [ -n "$WAYLAND_DISPLAY" ]; then + DMENU="tofi" + DEFARGS="-c $HOME/.config/tofi/themes/dmenu_vertical --prompt-text" +elif [ -n "$DISPLAY" ]; then + DMENU="dmenu" + DEFARGS="" +else + print "Can't tell if Wayland or X; what gives?\n" + exit 1 fi #}}} #{{{ Choose Profiles PROFILES=`grep 'Path=' ~/.firedragon/profiles.ini | cut -d'.' -f2` -CHOSEN=`echo "$PROFILES" | $DMENU -p "firedragon" -l 15 $DMENU_ARGS` +CHOSEN=`echo "$PROFILES" | $DMENU $DEFARGS "firedragon" $DMENU_ARGS` [ -z "$CHOSEN" ] && exit 2 exec firedragon -P "$CHOSEN" $URL #}}} @@ -5,32 +5,28 @@ 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 (bemenu)\n" - printf " -x ) use X11 menu command (dmenu)\n" exit } #}}} #{{{ getopts -while getopts "hwxd:u:" o; do case "${o}" in +while getopts "hd:u:" o; do case "${o}" in d) DMENU_ARGS="$OPTARG" ;; u) URL="$OPTARG" ;; - w) DMENU="bemenu" ;; - x) DMENU="dmenu" ;; *) printhelp ;; esac done #}}} #{{{ Check display server if -w or -x not provided -if [ -z "$DMENU" ]; then - if [ -n "$WAYLAND_DISPLAY" ]; then - DMENU="bemenu" - elif [ -n "$DISPLAY" ]; then - DMENU="dmenu" - else - print "Can't tell if Wayland or X; what gives?\n" - exit 1 - fi +if [ -n "$WAYLAND_DISPLAY" ]; then + DMENU="tofi" + DEFARGS="-c $HOME/.config/tofi/themes/dmenu_vertical --prompt-text" +elif [ -n "$DISPLAY" ]; then + DMENU="dmenu" + DEFARGS="-l 15 -p" +else + print "Can't tell if Wayland or X; what gives?\n" + exit 1 fi #}}} @@ -58,7 +54,7 @@ PROFILES="$NATIVE_PROFILES$INT$FLATPAK_PROFILES" #}}} #{{{ Choose Profiles -CHOSEN=`printf "$PROFILES" | $DMENU -p "firefox" -l 15 $DMENU_ARGS` +CHOSEN=`printf "$PROFILES" | $DMENU $DEFARGS "firefox" $DMENU_ARGS` [ -z "$CHOSEN" ] && exit 2 if `echo "$CHOSEN" | grep -qE ' F$'`; then exec flatpak run org.mozilla.Firefox -P `echo "$CHOSEN" | sed 's/ F$//'` $URL @@ -5,18 +5,14 @@ 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 (bemenu)\n" - printf " -x ) use X11 menu command (dmenu)\n" exit } #}}} #{{{ getopts -while getopts "hwxd:u:" o; do case "${o}" in +while getopts "hd:u:" o; do case "${o}" in d) DMENU_ARGS="$OPTARG" ;; u) URL="$OPTARG" ;; - w) DMENU="bemenu" ;; - x) DMENU="dmenu" ;; *) printhelp ;; esac done #}}} @@ -24,9 +20,11 @@ esac done #{{{ Check display server if -w or -x not provided if [ -z "$DMENU" ]; then if [ -n "$WAYLAND_DISPLAY" ]; then - DMENU="bemenu" + DMENU="tofi" + DEFARGS=" -c $HOME/.config/tofi/themes/dmenu_vertical --prompt-text" elif [ -n "$DISPLAY" ]; then - DMENU="dmenu" + DMENU="dmenu -l 10 -p" + DEFARGS="" else print "Can't tell if Wayland or X; what gives?\n" exit 1 @@ -58,7 +56,7 @@ PROFILES="$NATIVE_PROFILES$INT$FLATPAK_PROFILES" #}}} #{{{ Choose Profiles -CHOSEN=`printf "$PROFILES" | $DMENU -p "librewolf" -l 10 $DMENU_ARGS` +CHOSEN=`printf "$PROFILES" | $DMENU $DMENU_ARGS librewolf` [ -z "$CHOSEN" ] && exit 2 if `echo "$CHOSEN" | grep -qE ' F$'`; then exec flatpak run io.gitlab.librewolf-community -P `echo "$CHOSEN" | sed 's/ F$//'` $URL @@ -5,32 +5,28 @@ printhelp () { printf "mbc: mullvad-browser 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 (bemenu)\n" - printf " -x ) use X11 menu command (dmenu)\n" exit } #}}} #{{{ getopts -while getopts "hwxd:u:" o; do case "${o}" in +while getopts "hd:u:" o; do case "${o}" in d) DMENU_ARGS="$OPTARG" ;; u) URL="$OPTARG" ;; - w) DMENU="bemenu" ;; - x) DMENU="dmenu" ;; *) printhelp ;; esac done #}}} #{{{ Check display server if -w or -x not provided -if [ -z "$DMENU" ]; then - if [ -n "$WAYLAND_DISPLAY" ]; then - DMENU="bemenu" - elif [ -n "$DISPLAY" ]; then - DMENU="dmenu" - else - print "Can't tell if Wayland or X; what gives?\n" - exit 1 - fi +if [ -n "$WAYLAND_DISPLAY" ]; then + DMENU="tofi" + DEFARGS="-c $HOME/.config/tofi/themes/dmenu_vertical --prompt-text" +elif [ -n "$DISPLAY" ]; then + DMENU="dmenu" + DEFARGS="-l 15 -p" +else + print "Can't tell if Wayland or X; what gives?\n" + exit 1 fi #}}} @@ -50,7 +46,7 @@ PROFILES="$NATIVE_PROFILES" #}}} #{{{ Choose Profiles -CHOSEN=`printf "$PROFILES" | $DMENU -p "mullvad-browser" -l 10 $DMENU_ARGS` +CHOSEN=`printf "$PROFILES" | $DMENU $DEFARGS "mullvad-browser" $DMENU_ARGS` [ -z "$CHOSEN" ] && exit 2 exec mullvad-browser -P "$CHOSEN" $URL #}}} @@ -6,7 +6,7 @@ printhelp () { while getopts "hwxd:" o; do case "${o}" in w) - DMENU="bemenu" + DMENU="tofi" ;; x) DMENU="dmenu" @@ -17,16 +17,18 @@ esac done if [ -z "$DMENU" ]; then if [ -n "$WAYLAND_DISPLAY" ]; then - DMENU="bemenu" + DMENU="tofi" + DEFARGS="--prompt-text" elif [ -n "$DISPLAY" ]; then DMENU="dmenu" + DEFARGS="-p" else printf "Can't tell if Wayland or X; what gives?\n" exit 1 fi fi -DMENU_PROMPT=$(playerctl -l | $DMENU $ARGS -p 'Players:') +DMENU_PROMPT=$(playerctl -l | $DMENU $ARGS $DEFARGS 'Players:') [ -z "$DMENU_PROMPT" ] && exit 1 PLAYERCONTROLS_PROMPT=$(echo "play-pause @@ -9,8 +9,8 @@ if [[ $1 == "--type" ]]; then fi if [[ -n $WAYLAND_DISPLAY ]]; then - barmenu=bemenu - args="-i -l 15" + barmenu=tofi + args="-c $HOME/.config/tofi/themes/dmenu_vertical" xdotool="ydotool type --file -" elif [[ -n $DISPLAY ]]; then barmenu=dmenu @@ -5,32 +5,28 @@ 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 (bemenu)\n" - printf " -x ) use X11 menu command (dmenu)\n" exit } #}}} #{{{ getopts -while getopts "hwxd:u:" o; do case "${o}" in +while getopts "hd:u:" o; do case "${o}" in d) DMENU_ARGS="$OPTARG" ;; u) URL="$OPTARG" ;; - w) DMENU="bemenu" ;; - x) DMENU="dmenu" ;; *) printhelp ;; esac done #}}} #{{{ Check display server if -w or -x not provided -if [ -z "$DMENU" ]; then - if [ -n "$WAYLAND_DISPLAY" ]; then - DMENU="bemenu" - elif [ -n "$DISPLAY" ]; then - DMENU="dmenu" - else - print "Can't tell if Wayland or X; what gives?\n" - exit 1 - fi +if [ -n "$WAYLAND_DISPLAY" ]; then + DMENU="tofi" + DEFARGS="-c $HOME/.config/tofi/themes/dmenu_vertical --prompt-text" +elif [ -n "$DISPLAY" ]; then + DMENU="dmenu" + DEFARGS="-l 15 -p" +else + print "Can't tell if Wayland or X; what gives?\n" + exit 1 fi #}}} @@ -40,7 +36,7 @@ SESSIONS=`qbpm list` #}}} #{{{ Select Session -CHOSEN=`printf "default\n$SESSIONS" | $DMENU -p "qutebrowser" -l 15 $DMENU_ARGS` +CHOSEN=`printf "default\n$SESSIONS" | $DMENU $DEFARGS "qutebrowser" $DMENU_ARGS` [ -z "$CHOSEN" ] && exit 2 if [ -n "$CHOSEN" ]; then if [ "$CHOSEN" = "default" ]; then @@ -7,7 +7,7 @@ output_text () { while getopts "hwxd:s:o:" o; do case "${o}" in w) - DMENU="bemenu" + DMENU="tofi" SCRSH="grim" ;; x) @@ -21,10 +21,12 @@ esac done if [ -z "$DMENU" ]; then if [ -n "$WAYLAND_DISPLAY" ]; then - DMENU="bemenu" + DMENU="tofi" + DEFARGS="--prompt-text" SCRSH="grim" elif [ -n "$DISPLAY" ]; then DMENU="dmenu" + DEFARGS="-p" SCRSH="maim" else output_text "Stuck" "Can't tell if Wayland or X, what gives?" @@ -41,7 +43,7 @@ sleep 0.1 "$SCRSH" $SARG "$TEMPFILE" if [ -z "$FILENAME" ]; then - FILENAME="$(echo "$TEMPFILE" | $DMENU $DARGS -p "What to name the file?")" + FILENAME="$(echo "$TEMPFILE" | $DMENU $DARGS $DEFARGS "What to name the file?")" if [ -z "$FILENAME" ]; then rm -rf "$TEMPFILE" output_text "Deleted" "No filename selected, file deleted!" |