sway config better and locking screen
parent
41df408336
commit
3ee805f855
@ -0,0 +1,41 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
###
|
||||||
|
# way_lock
|
||||||
|
# Lock Wayland session
|
||||||
|
#
|
||||||
|
# Run-Depends
|
||||||
|
# x11/swayidle
|
||||||
|
# x11/swaylock
|
||||||
|
# {any /bin/sh capable of background execution}
|
||||||
|
#
|
||||||
|
# Note: swayidle implements KDE's idle protocol[1], so the compositor
|
||||||
|
# acting as a window manager must support it. Swayidle will not
|
||||||
|
# work as intended otherwise.
|
||||||
|
# [1] https://github.com/swaywm/sway/blob/57d6f6f19e3088dcb8e202acade8c39a80075b4a/protocols/idle.xml
|
||||||
|
###
|
||||||
|
|
||||||
|
# Number of seconds before screen turns off
|
||||||
|
timeout=10
|
||||||
|
|
||||||
|
# Turn screen off after $timeout seconds of inactivity.
|
||||||
|
# Turn it on again when there is activity.
|
||||||
|
#
|
||||||
|
# swayidle acts like a daemon, meaning it continues execution even after
|
||||||
|
# the script is terminated, so we need to execute it in the background
|
||||||
|
# to be able to terminate it later (unless you like your screen turning
|
||||||
|
# off every 10 seconds for some reason?)
|
||||||
|
swayidle \
|
||||||
|
timeout $timeout 'swaymsg output \* dpms off' \
|
||||||
|
resume 'swaymsg output \* dpms on' \
|
||||||
|
&
|
||||||
|
|
||||||
|
playerctl play-pause
|
||||||
|
|
||||||
|
# Lock the screen and wait for it to be unlocked.
|
||||||
|
swaylock -f -e -c 1d2021 --inside-color 000000b3 -s fill -i ~/.cache/lockscreen
|
||||||
|
|
||||||
|
# Screen unlocked: terminate swayidle and clean up PID
|
||||||
|
kill -TERM $!
|
||||||
|
wait
|
||||||
|
|
@ -1,3 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
ln -s $(pwd)/sway ~/.config
|
ln -s $(pwd)/sway ~/.config
|
||||||
|
sudo ln -s sway_manual_lock /usr/bin
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue