mirror of https://gitlab.com/dabruh/dotfiles.git
Prevent re-locking.
This commit is contained in:
parent
7881471854
commit
53179f1ee6
|
@ -9,13 +9,18 @@
|
|||
|
||||
LOCK_SCREEN_BLUR=${LOCK_SCREEN_BLUR:-false}
|
||||
LOCK_SCREEN_COLOR=${LOCK_SCREEN_COLOR:-29414f}
|
||||
I3LOCK_RE="i3lock -(c|i) "
|
||||
|
||||
_lock() {
|
||||
i3lock -c "$LOCK_SCREEN_COLOR"
|
||||
}
|
||||
|
||||
_unlock() {
|
||||
pkill -u "$USER" -f "i3lock -(c|i) "
|
||||
pkill -u "$USER" -f "$I3LOCK_RE"
|
||||
}
|
||||
|
||||
is_locked() {
|
||||
pgrep -u "$USER" -f "$I3LOCK_RE" >/dev/null
|
||||
}
|
||||
|
||||
lock() {
|
||||
|
@ -44,7 +49,7 @@ lock() {
|
|||
|
||||
case "$1" in
|
||||
lock)
|
||||
lock
|
||||
is_locked || lock
|
||||
;;
|
||||
logout)
|
||||
i3-msg exit
|
||||
|
|
Loading…
Reference in New Issue