summaryrefslogtreecommitdiff
path: root/.i3lock
diff options
context:
space:
mode:
authorSyndamia <kamen.d.mladenov@protonmail.com>2021-12-09 10:13:54 +0200
committerSyndamia <kamen.d.mladenov@protonmail.com>2021-12-09 10:13:54 +0200
commitcf142d462c089e462b39b329f9763991e170909e (patch)
treecb804a7f3915014ee79a3bdb57be43232af393ce /.i3lock
parentddfa7de0037e8aa24ef76fdf28652214657a7cce (diff)
downloaddotfiles-cf142d462c089e462b39b329f9763991e170909e.tar
dotfiles-cf142d462c089e462b39b329f9763991e170909e.tar.gz
dotfiles-cf142d462c089e462b39b329f9763991e170909e.zip
Fixed lock script to suspend even when already locked
Diffstat (limited to '.i3lock')
-rwxr-xr-x.i3lock/lock.sh33
1 files changed, 16 insertions, 17 deletions
diff --git a/.i3lock/lock.sh b/.i3lock/lock.sh
index 9379008..277d727 100755
--- a/.i3lock/lock.sh
+++ b/.i3lock/lock.sh
@@ -1,9 +1,5 @@
#!/bin/bash
-if pgrep i3lock 1>&2; then
- exit
-fi
-
res () {
pkill $@
nohup $@ 2>&1 &
@@ -54,18 +50,20 @@ if [ $(grep -r 'RUNNING' /proc/asound | wc -l) -gt 1 ] && [[ "$1" == 'suspend' ]
exit
fi
-# The first line of i3lock arguments uses standard arguments, while the rest of the lines are i3lock-color ones
-# If you want to use i3lock, remove those lines (and the \ at the end)
-# But I highly advise you to use i3lock-color, it's amazing: https://github.com/Raymo111/i3lock-color
-(
-before_locking && \
-i3lock -f -c d49408 -i /home/kamen/.i3lock/lockscreen.png -n \
- -F -k --indicator --keylayout 1 --radius 95 --pass-volume-keys \
- --date-str='%d.%m.%Y' --verif-text='Verifying…' --wrong-text='Wrong!' --noinput-text='No Input!' \
- --insidever-color d47408cc --ringver-color d47408 --insidewrong-color c35b5bcc --ringwrong-color c35b5b \
- --layout-color ffeede --time-color ffeede --date-color ffeede --greeter-color ffeede --verif-color ffeede --wrong-color ffeede \
-; when_unlocked && if [ -f '/tmp/slept' ]; then when_unlocked_after_suspend; rm /tmp/slept; fi
-) &
+if ! pgrep i3lock 1>&2; then
+ # The first line of i3lock arguments uses standard arguments, while the rest of the lines are i3lock-color ones
+ # If you want to use i3lock, remove those lines (and the \ at the end)
+ # But I highly advise you to use i3lock-color, it's amazing: https://github.com/Raymo111/i3lock-color
+ (
+ before_locking && \
+ i3lock -f -c d49408 -i /home/kamen/.i3lock/lockscreen.png -n \
+ -F -k --indicator --keylayout 1 --radius 95 --pass-volume-keys \
+ --date-str='%d.%m.%Y' --verif-text='Verifying…' --wrong-text='Wrong!' --noinput-text='No Input!' \
+ --insidever-color d47408cc --ringver-color d47408 --insidewrong-color c35b5bcc --ringwrong-color c35b5b \
+ --layout-color ffeede --time-color ffeede --date-color ffeede --greeter-color ffeede --verif-color ffeede --wrong-color ffeede \
+ ; when_unlocked && if [ -f '/tmp/slept' ]; then when_unlocked_after_suspend; rm /tmp/slept; fi
+ ) &
+fi
if [[ "$1" == 'suspend' ]]; then
# A file is created to indicate that the system was suspended
@@ -90,5 +88,6 @@ if [[ "$1" == 'suspend' ]]; then
#
# kamen ALL = (root) NOPASSWD: /usr/local/sbin/sleep.sh
# sudo -u root /usr/local/sbin/sleep.sh
- systemctl suspend
+ # systemctl suspend
+ loginctl suspend
fi