diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2022-01-12 17:45:15 +0200 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2022-01-12 17:45:15 +0200 |
| commit | c465cb08b0fd5cb6c141ddeff471e172ea886396 (patch) | |
| tree | b938bba796e9e8307eb16c3a7b57a0a316d9748f /.i3lock | |
| parent | b21defab270e7e3f0405f6dc4b9c3dd63c6458c2 (diff) | |
| download | dotfiles-c465cb08b0fd5cb6c141ddeff471e172ea886396.tar dotfiles-c465cb08b0fd5cb6c141ddeff471e172ea886396.tar.gz dotfiles-c465cb08b0fd5cb6c141ddeff471e172ea886396.zip | |
Added a before_suspend "hook" to lock script
Diffstat (limited to '.i3lock')
| -rwxr-xr-x | .i3lock/lock.sh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/.i3lock/lock.sh b/.i3lock/lock.sh index 9ec6d4c..4d0b4b0 100755 --- a/.i3lock/lock.sh +++ b/.i3lock/lock.sh @@ -18,6 +18,11 @@ before_locking () { dunstctl set-paused true } +before_suspend () { + # Keep track of time when machine is suspended, as well as how long it has been up for + uptime >> ~/.i3lock/suspend-history +} + when_unlocked () { dunstctl set-paused false # Enables my notification daemon @@ -83,6 +88,8 @@ fi # ++=========++ if [[ "$1" == 'suspend' ]]; then + before_suspend + # 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 # script should run when_unlocked_after_suspend function |
