feat: screen locking

This commit is contained in:
Klesh Wong 2022-05-17 15:47:19 +08:00
parent 8eef329851
commit 99528721bf
4 changed files with 19 additions and 4 deletions

View File

@ -38,6 +38,10 @@ autorandr --change --force
mpd
picomdaemon
# power save
xset 600
xss-lock $(command -v lock.sh) &
exec dbus-run-session -- awesome 2> /tmp/awesome.log
EOT

View File

@ -337,10 +337,11 @@ awful.screen.connect_for_each_screen(function(s)
wibox.widget.systray(),
mytextclock,
logout_menu_widget{
onpoweroff = function() awful.spawn.with_shell("sudo poweroff") end,
onlogout = awful.quit,
onreboot = function() awful.spawn.with_shell("sudo shutdown -r now") end,
onlock = function () awful.spawn.with_shell("xset dpms force off") end
onpoweroff = function() awful.spawn.with_shell("loginctl poweroff") end,
onreboot = function() awful.spawn.with_shell("loginctl reboot") end,
onlock = function () awful.spawn.with_shell("loginctl lock-sessions") end,
onsuspend = function() awful.spawn.with_shell("loginctl suspend") end,
},
},
},

View File

@ -14,7 +14,6 @@ case "$UNAMEA" in
pavucontrol \
ibus ibus-table ibus-table-wubi \
gnome-keyring \
xss-lock \
nitrogen \
network-manager network-manager-gnome \
exfat-utils \

View File

@ -4,4 +4,15 @@ DIR=$(dirname "$(readlink -f "$0")")
log 'Setting up slock'
case "$UNAMEA" in
*Ubuntu*)
sudo apt install -y \
xss-lock
;;
*artix*)
sudo pacman -S --noconfirm --needed \
xss-lock
;;
esac
makeinstallrepo https://gitee.com/klesh/slock.git slock