diff options
author | Yaroslav <contact@yaroslavps.com> | 2020-08-06 22:12:25 +0300 |
---|---|---|
committer | Yaroslav <contact@yaroslavps.com> | 2020-08-06 22:12:25 +0300 |
commit | 18368532af68f71450ebbb6fd6b5c5e95754e84d (patch) | |
tree | d8e6c86258eafdfc0ea2dad48d2f2b9f79cf9730 | |
parent | 079ed4cfdc7eeca14dbacd16da6f533e455a2396 (diff) | |
download | swayrice-18368532af68f71450ebbb6fd6b5c5e95754e84d.tar.gz swayrice-18368532af68f71450ebbb6fd6b5c5e95754e84d.zip |
show bemenu menus in all monitors
-rwxr-xr-x | dotfiles/.config/bemenurc | 1 | ||||
-rwxr-xr-x | dotfiles/.local/bin/menublk | 10 | ||||
-rwxr-xr-x | dotfiles/.local/bin/menudisplay | 4 | ||||
-rwxr-xr-x | dotfiles/.local/bin/menuemoji | 2 | ||||
-rwxr-xr-x | dotfiles/.local/bin/menugrim | 2 | ||||
-rwxr-xr-x | dotfiles/.local/bin/menumako | 2 | ||||
-rwxr-xr-x | dotfiles/.local/bin/menuoutput | 2 | ||||
-rwxr-xr-x | dotfiles/.local/bin/menupass | 2 | ||||
-rwxr-xr-x | dotfiles/.local/bin/menuprompt | 2 | ||||
-rwxr-xr-x | dotfiles/.local/bin/menurun | 2 | ||||
-rwxr-xr-x | dotfiles/.local/bin/menusession | 2 | ||||
-rwxr-xr-x | dotfiles/.local/bin/menutz | 2 | ||||
-rwxr-xr-x | dotfiles/.local/bin/menuwebsurf | 2 |
13 files changed, 18 insertions, 17 deletions
diff --git a/dotfiles/.config/bemenurc b/dotfiles/.config/bemenurc index 22e7224..76feb5b 100755 --- a/dotfiles/.config/bemenurc +++ b/dotfiles/.config/bemenurc @@ -22,3 +22,4 @@ BEMENU_HF="#E5E9F0" ## command for the terminal application to be used: TERMINAL_CMD="terminal -e" +BEMENU_MONITOR="-1" diff --git a/dotfiles/.local/bin/menublk b/dotfiles/.local/bin/menublk index cfc1a7b..6c36252 100755 --- a/dotfiles/.local/bin/menublk +++ b/dotfiles/.local/bin/menublk @@ -54,7 +54,7 @@ mount_dev() { fstype="$(lsblk -r -o FSTYPE "/dev/$1" | tail -n 1)" part="/dev/$1" if [ "$fstype" = "crypto_LUKS" ]; then - password="$(echo "" | bemenu -p "Enter passphrase for encrypted drive:" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --ff="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB")" + password="$(echo "" | bemenu -p "Enter passphrase for encrypted drive:" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --ff="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR")" if [ -z "$password" ]; then exit 0 fi @@ -106,23 +106,23 @@ poweroff_dev() { fi } -action="$(printf "mount\nunmount\npoweroff\n" | bemenu -p "What to do?" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB")" +action="$(printf "mount\nunmount\npoweroff\n" | bemenu -p "What to do?" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR")" case "$action" in mount) - blkdev="$(get_mountable | bemenu -p "Choose device to mount:" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB")" + blkdev="$(get_mountable | bemenu -p "Choose device to mount:" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR")" if [ -z "$blkdev" ]; then exit 0 fi mount_dev "$blkdev";; unmount) - blkdev="$(get_unmountable | bemenu -p "Choose device to umount:" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB")" + blkdev="$(get_unmountable | bemenu -p "Choose device to umount:" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR")" if [ -z "$blkdev" ]; then exit 0 fi unmount_dev "$blkdev";; poweroff) - blkdev="$(get_usb_storage | bemenu -p "Choose device to power off:" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB")" + blkdev="$(get_usb_storage | bemenu -p "Choose device to power off:" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR")" if [ -z "$blkdev" ]; then exit 0 fi diff --git a/dotfiles/.local/bin/menudisplay b/dotfiles/.local/bin/menudisplay index 1dd3c2f..e42ec42 100755 --- a/dotfiles/.local/bin/menudisplay +++ b/dotfiles/.local/bin/menudisplay @@ -3,12 +3,12 @@ # Source settings from .bemenurc . ~/.config/bemenurc -display=$(swaymsg -t get_outputs | grep -E "name" | sed "s/^.*\"name\": \"//g;s/\",$//g;" | bemenu -p "Select output: " --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB") +display=$(swaymsg -t get_outputs | grep -E "name" | sed "s/^.*\"name\": \"//g;s/\",$//g;" | bemenu -p "Select output: " --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR") if [ -z $display ]; then exit 0 fi -action=$(printf "enable\ndisable\n" | bemenu -p "Choose action: " --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB") +action=$(printf "enable\ndisable\n" | bemenu -p "Choose action: " --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR") swaymsg output $display $action diff --git a/dotfiles/.local/bin/menuemoji b/dotfiles/.local/bin/menuemoji index bd13aa4..9303d81 100755 --- a/dotfiles/.local/bin/menuemoji +++ b/dotfiles/.local/bin/menuemoji @@ -5,7 +5,7 @@ # Source settings from .bemenurc . ~/.config/bemenurc -chosen=$(grep -v "#" ~/.local/share/script-data/emoji | bemenu -i -l 25 --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB") +chosen=$(grep -v "#" ~/.local/share/script-data/emoji | bemenu -i -l 25 --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR") if [ -z $chosen ]; then exit 0 diff --git a/dotfiles/.local/bin/menugrim b/dotfiles/.local/bin/menugrim index 523e162..28e1249 100755 --- a/dotfiles/.local/bin/menugrim +++ b/dotfiles/.local/bin/menugrim @@ -19,7 +19,7 @@ case "$1" in --quick|-q) grim $SCROT_DIR/fullscreen-"$(date '+%y%m%d-%H%M-%S').png"; notify_saved ;; *) - case "$(printf "a selected area\ncurrent window\nfull screen\na selected area (copy)\ncurrent window (copy)\nfull screen (copy)\n" | bemenu -l 6 -i -p "Screenshot which area?" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB")" in + case "$(printf "a selected area\ncurrent window\nfull screen\na selected area (copy)\ncurrent window (copy)\nfull screen (copy)\n" | bemenu -l 6 -i -p "Screenshot which area?" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR")" in "a selected area") grim -g "$(slurp)" $SCROT_DIR/selected-"$(date '+%y%m%d-%H%M-%S').png"; notify_saved ;; "current window") grim -g "$(swaygetcurrentwindow)" $SCROT_DIR/window-"$(date '+%y%m%d-%H%M-%S').png"; notify_saved ;; "full screen") grim $SCROT_DIR/fullscreen-"$(date '+%y%m%d-%H%M-%S').png"; notify_saved ;; diff --git a/dotfiles/.local/bin/menumako b/dotfiles/.local/bin/menumako index ce7e82e..38c29be 100755 --- a/dotfiles/.local/bin/menumako +++ b/dotfiles/.local/bin/menumako @@ -3,4 +3,4 @@ # Source settings from .bemenurc . ~/.config/bemenurc -makoctl menu bemenu '-p "What to do?" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB"' +makoctl menu bemenu '-p "What to do?" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR"' diff --git a/dotfiles/.local/bin/menuoutput b/dotfiles/.local/bin/menuoutput index 0efc948..b9a4faa 100755 --- a/dotfiles/.local/bin/menuoutput +++ b/dotfiles/.local/bin/menuoutput @@ -4,7 +4,7 @@ # Source settings from .bemenurc . ~/.config/bemenurc -output=$(listsinks | bemenu -p "Select audio output: " --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB") +output=$(listsinks | bemenu -p "Select audio output: " --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR") [ "$output" != "" ] || exit diff --git a/dotfiles/.local/bin/menupass b/dotfiles/.local/bin/menupass index 1a1ecd2..7ad3f59 100755 --- a/dotfiles/.local/bin/menupass +++ b/dotfiles/.local/bin/menupass @@ -33,7 +33,7 @@ notify_nocache() { } show_menu() { - password=$(printf '%s\n' "${password_files[@]}" | bemenu -p "$1:" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB") + password=$(printf '%s\n' "${password_files[@]}" | bemenu -p "$1:" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR") [ -n "$password" ] || exit } diff --git a/dotfiles/.local/bin/menuprompt b/dotfiles/.local/bin/menuprompt index c336679..32823ec 100755 --- a/dotfiles/.local/bin/menuprompt +++ b/dotfiles/.local/bin/menuprompt @@ -4,4 +4,4 @@ # For example: # `./prompt "Do you want to shutdown?" "shutdown -h now"` -[ "$(printf "No\\nYes" | bemenu -i -p "$1" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB")" = "Yes" ] && $2 +[ "$(printf "No\\nYes" | bemenu -i -p "$1" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR")" = "Yes" ] && $2 diff --git a/dotfiles/.local/bin/menurun b/dotfiles/.local/bin/menurun index b3da2a0..8432279 100755 --- a/dotfiles/.local/bin/menurun +++ b/dotfiles/.local/bin/menurun @@ -15,6 +15,6 @@ case $1 in title="Run in terminal:";; esac -action="$action $(compgen -c | sort -u | bemenu -p "$title" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB")" +action="$action $(compgen -c | sort -u | bemenu -p "$title" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR")" $action diff --git a/dotfiles/.local/bin/menusession b/dotfiles/.local/bin/menusession index 85824f7..de4d602 100755 --- a/dotfiles/.local/bin/menusession +++ b/dotfiles/.local/bin/menusession @@ -3,6 +3,6 @@ # Source settings from .bemenurc . ~/.config/bemenurc -action=$(printf "logout\nsuspend\nreboot\npoweroff\n" | bemenu -p "What to do?" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB") +action=$(printf "logout\nsuspend\nreboot\npoweroff\n" | bemenu -p "What to do?" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR") swaysession $action diff --git a/dotfiles/.local/bin/menutz b/dotfiles/.local/bin/menutz index eca7b47..2d783ae 100755 --- a/dotfiles/.local/bin/menutz +++ b/dotfiles/.local/bin/menutz @@ -3,7 +3,7 @@ # Source settings from .bemenurc . ~/.config/bemenurc -timezone=$(cd /usr/share/zoneinfo/posix && find * -type f -or -type l | sort | bemenu -p "Select output: " --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB") +timezone=$(cd /usr/share/zoneinfo/posix && find * -type f -or -type l | sort | bemenu -p "Select output: " --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR") if [ -n "$timezone" ]; then notify-send "🗺 Date and time in $timezone" "$(TZ=:$timezone date)" diff --git a/dotfiles/.local/bin/menuwebsurf b/dotfiles/.local/bin/menuwebsurf index 7c59e3e..00155c6 100755 --- a/dotfiles/.local/bin/menuwebsurf +++ b/dotfiles/.local/bin/menuwebsurf @@ -13,7 +13,7 @@ if [ "$1" = "paste" ]; then prompt="$(wl-paste)" fi -choice=$(echo "$prompt" | bemenu -i -p "Enter link or query:" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB") || exit 1 +choice=$(echo "$prompt" | bemenu -i -p "Enter link or query:" --tf="$BEMENU_TF" --tb="$BEMENU_NB" --fb="$BEMENU_NB" --fn="$BEMENU_FN" --nb="$BEMENU_NB" --nf="$BEMENU_NF" --hf="$BEMENU_HF" --hb="$BEMENU_HB" --monitor="$BEMENU_MONITOR") || exit 1 if [ "$choice" = "🌐" ]; then linkhandler |