More changes

Signed-off-by: Skylar "The Cobra" Widulski <cobra@vern.cc>
This commit is contained in:
Skylar "The Cobra" Widulski 2022-11-23 20:14:35 -05:00
parent 8c7b80b652
commit b52abd4228
Signed by: cobra
GPG Key ID: 4FD8F812083FF6F9
4 changed files with 15 additions and 4 deletions

2
.local/bin/__suspend Executable file
View File

@ -0,0 +1,2 @@
#!/usr/bin/env bash
echo mem > /sys/power/state

View File

@ -1,4 +1,7 @@
#!/usr/bin/env bash
swayidle -w timeout 180 'sudo ~/.local/bin/__suspend' &
SUSPEND=$!
swayidle -w timeout 15 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' &
SCREENOFF=$!
swaylock -eFkl -i ~/.config/sway/background.png --font "Fira Code"
pkill --newest swayidle
kill $SUSPEND $SCREENOFF

View File

@ -2,9 +2,9 @@
case "$(printf "logout\nreboot\nshutdown\nsleep\n" | wofi --dmenu -i -H 500 -W 250 -x 0 -y 0 )" in
'logout') swaymsg exit;;
'sleep') swaylock -f -F -e -i ~/.config/sway/wall -k -l -s fill --font IBM Plex Mono && systemctl suspend ;;
'reboot') reboot ;;
'shutdown') poweroff ;;
'sleep') swaylock -eFkl -i ~/.config/sway/background.png --font "Fira Code" && sudo ~/.local/bin/suspend ;;
'reboot') sudo reboot ;;
'shutdown') sudo poweroff ;;
*) exit 1 ;;
esac

6
.local/bin/suspend Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
sudo ~/.local/bin/__suspend
while grep -v '\[' /sys/power/state; do
swaylock -eFfkl -i ~/.config/sway/background.png --font "Fira Code"
break
done