From e3567781db43e840587903fd0ca0b3a16e9202ef Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 23 Dec 2021 14:03:02 +0200 Subject: Updated configs for Funtoo --- .i3lock/lock.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to '.i3lock/lock.sh') diff --git a/.i3lock/lock.sh b/.i3lock/lock.sh index 277d727..9ec6d4c 100755 --- a/.i3lock/lock.sh +++ b/.i3lock/lock.sh @@ -1,11 +1,16 @@ #!/bin/bash +## Helper functions res () { pkill $@ nohup $@ 2>&1 & disown } +# ++=================================++ +# || Actions before and after unlock || +# ++=================================++ + before_locking () { # Disables dunst, my notification daemon, so I don't see notification on lock screen # https://github.com/dunst-project/dunst/issues/697 @@ -25,6 +30,10 @@ when_unlocked_after_suspend () { gtk-launch picom # sometimes my compositor stops working after suspend, this makes sure it's running } +# ++==================================++ +# || Prevent locking because of audio || +# ++==================================++ + # This makes sure to not lock the screen if audio is playing and there are no arguments given # It's mainly for preventing automatic screen locking while a video/music is playing # If you still want to lock, just give it some argument, doesn't matter what @@ -50,6 +59,10 @@ if [ $(grep -r 'RUNNING' /proc/asound | wc -l) -gt 1 ] && [[ "$1" == 'suspend' ] exit fi +# ++============================++ +# || Lock if not locked already || +# ++============================++ + 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) @@ -65,6 +78,10 @@ if ! pgrep i3lock 1>&2; then ) & fi +# ++=========++ +# || Suspend || +# ++=========++ + if [[ "$1" == 'suspend' ]]; then # A file is created to indicate that the system was suspended # After i3lock is done (unlocked), existence of this file is checked to determine if -- cgit v1.2.3