diff options
| -rwxr-xr-x | .i3lock/lock.sh | 33 |
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 |
