mirror of
https://github.com/Stunkymonkey/dotfiles.git
synced 2025-05-24 11:04:41 +02:00
21 lines
414 B
Bash
Executable file
21 lines
414 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
chosen="$(wofi --dmenu --insensitive <<-END
|
|
[Cancel]
|
|
Logout
|
|
Poweroff
|
|
Reboot
|
|
Suspend
|
|
Hibernate
|
|
Suspend-then-hibernate
|
|
END
|
|
)"
|
|
|
|
if [[ "${chosen}" = "Logout" ]]; then
|
|
swaymsg exit
|
|
loginctl terminate-session "$(loginctl session-status | awk 'NR==1{print $1}')"
|
|
elif [ -z "${chosen}" ] || [[ "${chosen}" = "[Cancel]" ]]; then
|
|
exit 0;
|
|
fi
|
|
|
|
systemctl "$(tr '[:upper:]' '[:lower:]' <<< "${chosen}")"
|