2024-11-09 16:25:08 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Credit to the following for comming up with this:
|
|
|
|
# https://code.krister.ee/lock-screen-in-sway/
|
|
|
|
# To Do: The fancier screen lock mentioned on that page might be cool to try.
|
|
|
|
|
|
|
|
# Times the screen off and puts it to background
|
|
|
|
swayidle \
|
2024-11-09 17:10:20 +01:00
|
|
|
timeout 10 'swaymsg "output * dpms off"' \
|
|
|
|
resume 'swaymsg "output * dpms on"' &
|
2024-11-09 16:25:08 +01:00
|
|
|
|
|
|
|
# Locks the screen immediately
|
|
|
|
swaylock -c 550000
|
|
|
|
|
|
|
|
# Kills last background task so idle timer doesn't keep running
|
|
|
|
kill %%
|