diff --git a/bin/lock.sh b/bin/lock.sh index f5e9089..0daaa74 100755 --- a/bin/lock.sh +++ b/bin/lock.sh @@ -4,7 +4,11 @@ if mpc status | grep -F '[playing]'; then mpc pause RESTORE=1 fi -slock +if [ -n "$LOCKER" ]; then + $LOCKER +else + slock +fi if [ "$RESTORE" = 1 ]; then mpc play fi diff --git a/gui/awesome.sh b/gui/awesome.sh index 1f5fc3e..f4f1aa5 100755 --- a/gui/awesome.sh +++ b/gui/awesome.sh @@ -34,6 +34,8 @@ export VIM_MODE=enhanced export XDG_RUNTIME_DIR=/tmp/runtime-klesh mkdir -p $XDG_RUNTIME_DIR +export LOCKER='i3lock -i /home/klesh/Nextcloud/wallpapers/1027.png -t --nofork' + autorandr --change --force mpd picomdaemon diff --git a/gui/awesome/rc.lua b/gui/awesome/rc.lua index f0625dd..7040bec 100644 --- a/gui/awesome/rc.lua +++ b/gui/awesome/rc.lua @@ -340,7 +340,7 @@ awful.screen.connect_for_each_screen(function(s) onlogout = awful.quit, 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, + onlock = function () awful.spawn.with_shell("loginctl lock-session") end, onsuspend = function() awful.spawn.with_shell("loginctl suspend") end, }, }, diff --git a/gui/i3lock.sh b/gui/i3lock.sh new file mode 100755 index 0000000..d3e84c2 --- /dev/null +++ b/gui/i3lock.sh @@ -0,0 +1,19 @@ +#!/bin/sh +DIR=$(dirname "$(readlink -f "$0")") +. "$DIR/../env.sh" + +log 'Setting up i3lock' + +case "$UNAMEA" in + *Ubuntu*) + sudo apt install -y \ + xss-lock i3lock + ;; + *artix*) + sudo pacman -S --noconfirm --needed \ + xss-lock i3lock + ;; +esac + + +echo "export LOCKER=i3lock" diff --git a/gui/slock.sh b/gui/slock.sh index 8e5e403..5f0706c 100755 --- a/gui/slock.sh +++ b/gui/slock.sh @@ -16,3 +16,5 @@ case "$UNAMEA" in esac makeinstallrepo https://gitee.com/klesh/slock.git slock + +echo "export LOCKER=slock"