mirror of
https://github.com/Stunkymonkey/dotfiles.git
synced 2025-05-24 11:04:41 +02:00
[wofi] try makeing system.sh more beautiful
This commit is contained in:
parent
ef4aed12ac
commit
9a920248d3
1 changed files with 15 additions and 14 deletions
|
@ -1,20 +1,21 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
chosen=$(echo -e "[Cancel]\nLogout\nShutdown\nReboot\nSuspend\nHibernate\nHybrid-sleep\nSuspend-then-hibernate" | wofi --dmenu --insensitive)
|
chosen="$(wofi --dmenu --insensitive <<-END
|
||||||
|
[Cancel]
|
||||||
|
Logout
|
||||||
|
Shutdown
|
||||||
|
Reboot
|
||||||
|
Suspend
|
||||||
|
Hibernate
|
||||||
|
Suspend-then-hibernate
|
||||||
|
END
|
||||||
|
)"
|
||||||
|
|
||||||
if [[ $chosen = "Logout" ]]; then
|
if [[ "${chosen}" = "Logout" ]]; then
|
||||||
swaymsg exit
|
swaymsg exit
|
||||||
loginctl terminate-session "$(loginctl session-status | awk 'NR==1{print $1}')"
|
loginctl terminate-session "$(loginctl session-status | awk 'NR==1{print $1}')"
|
||||||
elif [[ $chosen = "Shutdown" ]]; then
|
elif [ -z "${chosen}" ] || [[ "${chosen}" = "[Cancel]" ]]; then
|
||||||
systemctl poweroff
|
exit 0;
|
||||||
elif [[ $chosen = "Reboot" ]]; then
|
|
||||||
systemctl reboot
|
|
||||||
elif [[ $chosen = "Suspend" ]]; then
|
|
||||||
systemctl suspend
|
|
||||||
elif [[ $chosen = "Hibernate" ]]; then
|
|
||||||
systemctl hibernate
|
|
||||||
elif [[ $chosen = "Hybrid-sleep" ]]; then
|
|
||||||
systemctl hibernate
|
|
||||||
elif [[ $chosen = "Suspend-then-hibernate" ]]; then
|
|
||||||
systemctl suspend-then-hibernate
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
systemctl "$(tr '[:upper:]' '[:lower:]' <<< "${chosen}")"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue