aboutsummaryrefslogtreecommitdiff
path: root/system/etc/pm/sleep.d
diff options
context:
space:
mode:
Diffstat (limited to 'system/etc/pm/sleep.d')
-rwxr-xr-xsystem/etc/pm/sleep.d/10lock13
1 files changed, 13 insertions, 0 deletions
diff --git a/system/etc/pm/sleep.d/10lock b/system/etc/pm/sleep.d/10lock
new file mode 100755
index 0000000..da7c018
--- /dev/null
+++ b/system/etc/pm/sleep.d/10lock
@@ -0,0 +1,13 @@
+#!/bin/sh
+#
+# 10sleep: lock i3 season before suspend
+
+case "$1" in
+ hibernate|suspend)
+ for socket in `find /run/user/*/i3 -name ipc-socket*`; do
+ i3-msg -s $socket "exec i3lock -d -c 000000"
+ done
+ ;;
+ *) exit $NA
+ ;;
+esac