nixos/config/home/scripts/system/power.sh

19 lines
376 B
Bash
Raw Normal View History

2024-11-28 21:32:32 +00:00
#!/bin/bash
2024-12-01 15:34:13 +00:00
option=$(printf "sleep\nlogout\nshutdown\nrestart" | rofi -dmenu -theme Arc-Dark -font 'hack 18')
2024-11-28 21:32:32 +00:00
2024-12-01 15:34:13 +00:00
if [ "$option" = "sleep" ];
2024-11-28 21:32:32 +00:00
then
i3lock-fancy -g -t "System Locked" -f Hack-Regular
2024-11-28 21:40:48 +00:00
systemctl suspend
2024-12-01 15:34:13 +00:00
elif [ "$option" = "logout" ];
2024-11-28 21:32:32 +00:00
then
2024-11-28 21:39:47 +00:00
i3-msg exit
2024-12-01 15:34:13 +00:00
elif [ "$option" = "shutdown" ];
2024-11-28 21:32:32 +00:00
then
2024-11-28 21:39:47 +00:00
poweroff
2024-12-01 15:34:13 +00:00
elif [ "$option" = "restart" ];
2024-11-28 21:32:32 +00:00
then
2024-11-28 21:39:47 +00:00
reboot
2024-11-28 21:32:32 +00:00
fi