aboutsummaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
Diffstat (limited to 'sway')
-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