From 30b3cc8dd977f7dc562d43ae5962c10b32f041d3 Mon Sep 17 00:00:00 2001 From: Marco van Dijk Date: Mon, 19 Jul 2021 01:04:52 +0200 Subject: [PATCH] Fix polybar power menu --- .../polybar/grayblocks/scripts/powermenu.sh | 54 +------------------ .../grayblocks/scripts/rofi/powermenu.rasi | 2 +- 2 files changed, 2 insertions(+), 54 deletions(-) diff --git a/.config/polybar/grayblocks/scripts/powermenu.sh b/.config/polybar/grayblocks/scripts/powermenu.sh index a3c978e..d41eaf9 100755 --- a/.config/polybar/grayblocks/scripts/powermenu.sh +++ b/.config/polybar/grayblocks/scripts/powermenu.sh @@ -17,78 +17,26 @@ lock=" Lock" suspend=" Sleep" logout=" Logout" -# Confirmation -confirm_exit() { - rofi -dmenu\ - -i\ - -no-fixed-num-lines\ - -p "Are You Sure? : "\ - -theme $dir/confirm.rasi -} - -# Message -msg() { - rofi -theme "$dir/message.rasi" -e "Available Options - yes / y / no / n" -} - # Variable passed to rofi options="$lock\n$suspend\n$logout\n$reboot\n$shutdown" chosen="$(echo -e "$options" | $rofi_command -p "Uptime: $uptime" -dmenu -selected-row 0)" case $chosen in $shutdown) - ans=$(confirm_exit &) - if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then systemctl poweroff - elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then - exit 0 - else - msg - fi ;; $reboot) - ans=$(confirm_exit &) - if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then systemctl reboot - elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then - exit 0 - else - msg - fi ;; $lock) - if [[ -f /usr/bin/i3lock ]]; then i3lock - elif [[ -f /usr/bin/betterlockscreen ]]; then - betterlockscreen -l - fi ;; $suspend) - ans=$(confirm_exit &) - if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then mpc -q pause amixer set Master mute systemctl suspend - elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then - exit 0 - else - msg - fi ;; $logout) - ans=$(confirm_exit &) - if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then - if [[ "$DESKTOP_SESSION" == "Openbox" ]]; then - openbox --exit - elif [[ "$DESKTOP_SESSION" == "bspwm" ]]; then - bspc quit - elif [[ "$DESKTOP_SESSION" == "i3" ]]; then - i3-msg exit - fi - elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then - exit 0 - else - msg - fi + i3-msg exit ;; esac diff --git a/.config/polybar/grayblocks/scripts/rofi/powermenu.rasi b/.config/polybar/grayblocks/scripts/rofi/powermenu.rasi index cfadb30..686956e 100644 --- a/.config/polybar/grayblocks/scripts/rofi/powermenu.rasi +++ b/.config/polybar/grayblocks/scripts/rofi/powermenu.rasi @@ -25,7 +25,7 @@ window { transparency: "real"; background-color: @bg; text-color: @fg; - border: 0px 0px 4px 0px; + border: 1px 3px 5px 1px; border-color: @ac; border-radius: 0px; width: 300px;