summaryrefslogtreecommitdiff
path: root/.i3lock
diff options
context:
space:
mode:
Diffstat (limited to '.i3lock')
-rwxr-xr-x.i3lock/lock.sh7
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