From 2d22dbead465b4a8bb9fb756a2f776877d6287e2 Mon Sep 17 00:00:00 2001 From: Leo Date: Thu, 9 Sep 2021 21:14:58 -0300 Subject: [PATCH] fix openbox detection by using a cleaner case...esac fixes #41 --- 1080p/powermenu/powermenu.sh | 18 +++++++++++------- 720p/powermenu/powermenu.sh | 18 +++++++++++------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/1080p/powermenu/powermenu.sh b/1080p/powermenu/powermenu.sh index 9b444f4..289995a 100755 --- a/1080p/powermenu/powermenu.sh +++ b/1080p/powermenu/powermenu.sh @@ -101,13 +101,17 @@ case $chosen in $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 + case "$DESKTOP_SESSION" in + Openbox|openbox) + openbox --exit + ;; + bspwm) + bspc quit + ;; + i3) + i3-msg exit + ;; + esac elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then exit 0 else diff --git a/720p/powermenu/powermenu.sh b/720p/powermenu/powermenu.sh index 9b444f4..289995a 100755 --- a/720p/powermenu/powermenu.sh +++ b/720p/powermenu/powermenu.sh @@ -101,13 +101,17 @@ case $chosen in $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 + case "$DESKTOP_SESSION" in + Openbox|openbox) + openbox --exit + ;; + bspwm) + bspc quit + ;; + i3) + i3-msg exit + ;; + esac elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then exit 0 else