Write a script for shutdown options

This commit is contained in:
Ohad Livne 2025-06-04 22:45:43 +03:00
parent 3d97448fee
commit c0465ec22d
Signed by: libohad-dev
GPG key ID: 34FDC68B51191A4D
2 changed files with 20 additions and 2 deletions

View file

@ -102,8 +102,8 @@ input type:touchpad {
bindsym $wm_mod+semicolon exec swaylock -f -c $(dd if=/dev/urandom bs=1 count=3 2>/dev/null | hexdump -e '"%02x"')
# Exit sway (logs you out of your Wayland session)
bindsym $wm_mod+Delete 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 Alt+Ctrl+Delete 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 $wm_mod+Delete exec leave
bindsym Alt+Ctrl+Delete exec leave
bindsym Alt+Ctrl+Shift+Delete exec systemctl poweroff
bindsym Alt+Ctrl+Backspace exec swaymsg exit
#

18
.local/bin/leave Executable file
View file

@ -0,0 +1,18 @@
#! /usr/bin/sh
listopts() {
echo "⏼ Shut down"
echo "⟲ Reboot"
echo "🚪 Log out"
}
option=$(listopts | fuzzel --dmenu)
case "${option}" in
"⏼ Shut down")
systemctl poweroff;;
"⟲ Reboot")
systemctl reboot;;
"🚪 Log out")
swaymsg exit;;
esac