aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLMBishop <13875753+LMBishop@users.noreply.github.com>2023-07-17 02:18:51 +0100
committerLMBishop <13875753+LMBishop@users.noreply.github.com>2023-07-17 02:18:51 +0100
commitc85829dff52c0b3c2f6ecb02b98c1b78050b9c04 (patch)
treea57506fe3842238cdeecec0829d369ba1d5d7288
parent659e9d81cbb5fda8d77e8ab2f7b4cc3fcfe74c20 (diff)
Add wofi exit menu
-rw-r--r--sway/config2
-rwxr-xr-xsway/scripts/exit-menu.sh18
2 files changed, 19 insertions, 1 deletions
diff --git a/sway/config b/sway/config
index 985bf95..330f12f 100644
--- a/sway/config
+++ b/sway/config
@@ -67,7 +67,7 @@ bindsym $mod+Return exec $term
bindsym $mod+Shift+Return exec $term --class="termfloat"
bindsym $mod+d exec pgrep -x wofi >/dev/null 2>&1 && killall wofi || $menu
bindsym $mod+Shift+c reload
-bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'
+bindsym $mod+Shift+e exec ~/.config/sway/scripts/exit-menu.sh
# Politely quit
bindsym $mod+q kill
diff --git a/sway/scripts/exit-menu.sh b/sway/scripts/exit-menu.sh
new file mode 100755
index 0000000..a492df8
--- /dev/null
+++ b/sway/scripts/exit-menu.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+entries=" Lock\n󰹆 Suspend\n󰍃 Logout\n󰜉 Reboot\n󰐥 Shutdown"
+
+selected=$(echo -e $entries|wofi --width 100 --height 185 --dmenu --cache-file /dev/null --define content_halign=center --define prompt="Exit menu" | awk '{print tolower($2)}')
+
+case $selected in
+ lock)
+ swaylock;;
+ logout)
+ swaymsg exit;;
+ suspend)
+ exec systemctl suspend;;
+ reboot)
+ exec systemctl reboot;;
+ shutdown)
+ exec systemctl poweroff -i;;
+esac