From 1cc843e6eb7ea2799ee69c1f3a3295de49d20110 Mon Sep 17 00:00:00 2001 From: John Mertz Date: Fri, 23 Sep 2022 17:37:09 -0400 Subject: [PATCH] Generic power-menu.sh script for rofi/wofi depending on WM --- rofi/rofi-power-menu.sh => sway/power-menu.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) rename rofi/rofi-power-menu.sh => sway/power-menu.sh (65%) diff --git a/rofi/rofi-power-menu.sh b/sway/power-menu.sh similarity index 65% rename from rofi/rofi-power-menu.sh rename to sway/power-menu.sh index 9676a57..7114853 100755 --- a/rofi/rofi-power-menu.sh +++ b/sway/power-menu.sh @@ -10,12 +10,13 @@ else fi if [[ $WM == 'i3' ]]; then - res=$(printf "🔒 Lock|↩ Logout|↻ Reload i3|↹ Restart i3|↯ Hibernate|🡙 Reboot|⏻ Shutdown" | rofi -sep "|" -dmenu -i -p 'Power: ' "" -columns 1 -rows 7 -width 32 -l 1 -theme /home/jpm/.config/rofi/sidebar.rasi -hide-scrollbar -eh 1 -location 0 -padding 12 -opacity 100 -auto-select -no-fullscreen) + res=$(printf "⚿ Lock|↩ Logout|↻ Reload i3|↹ Restart i3|↯ Hibernate|🡙 Reboot|⏻ Shutdown" | rofi -sep "|" -dmenu -i -p 'Power: ' "" -columns 1 -rows 7 -width 32 -l 1 -theme /home/jpm/.config/rofi/sidebar.rasi -hide-scrollbar -eh 1 -location 0 -padding 12 -opacity 100 -auto-select -no-fullscreen) else - res=$(echo "🔒 Lock|🖵 Toggle Displays|⚿ Yubico Authenticator|↻ Reload Sway|↻ Reload Waybar|↩ Logout|↯ Hibernate|🡙 Reboot|⏻ Shutdown" | rofi -sep "|" -dmenu -i -p 'Power: ' "" -theme /home/jpm/.config/rofi/sidebar.rasi -no-lazy-grab -auto-select -no-fullscreen) + res=$(printf "⚿ Lock\n🖵 Toggle Displays\n⚿ Yubico Authenticator\n↻ Reload Sway\n↻ Reload Waybar\n↩ Logout\n↯ Hibernate\n🡙 Reboot\n⏻ Shutdown" | wofi -I -s $HOME/.dotfiles/wofi/style.css -c $HOME/.dotfiles/wofi/sidebar --show dmenu + ) fi -if [ "$res" == "🔒 Lock" ]; then +if [ "$res" == "⚿ Lock" ]; then ${WM}lock -c 000000 elif [ "$res" == "↩ Logout" ]; then # Prevent auto-login