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
option=$(printf "Sleep\nLogout\nShutdown\nRestart" | rofi -dmenu -theme Arc-Dark -font 'hack 18')
if [ "$option" = "Sleep" ];
then
i3lock-fancy -g -t "System Locked" -f Hack-Regular
2024-11-28 21:40:48 +00:00
systemctl suspend
2024-11-28 21:32:32 +00:00
elif [ "$option" = "Logout" ];
then
2024-11-28 21:39:47 +00:00
i3-msg exit
2024-11-28 21:32:32 +00:00
elif [ "$option" = "Shutdown" ];
then
2024-11-28 21:39:47 +00:00
poweroff
2024-11-28 21:32:32 +00:00
elif [ "$option" = "Restart" ];
then
2024-11-28 21:39:47 +00:00
reboot
2024-11-28 21:32:32 +00:00
fi