summaryrefslogtreecommitdiff
path: root/.b
diff options
context:
space:
mode:
authorSyndamia <kamen@syndamia.com>2023-04-21 08:58:31 +0300
committerSyndamia <kamen@syndamia.com>2023-04-21 08:58:39 +0300
commit29fedb13ef41f94d4c383c8207a02497694d622a (patch)
treed2b8ac24b8b813f4f27c943609bdb339f2b53024 /.b
parentba512800b679fe257183e512417df6adffe6b80d (diff)
downloaddotfiles-29fedb13ef41f94d4c383c8207a02497694d622a.tar
dotfiles-29fedb13ef41f94d4c383c8207a02497694d622a.tar.gz
dotfiles-29fedb13ef41f94d4c383c8207a02497694d622a.zip
[.a/sys/lock.sh] Updated suspending to be properly managed by elogind
Diffstat (limited to '.b')
-rw-r--r--.b/etc/elogind/logind.conf54
-rwxr-xr-x.b/etc/elogind/system-sleep/run-lock.sh10
2 files changed, 64 insertions, 0 deletions
diff --git a/.b/etc/elogind/logind.conf b/.b/etc/elogind/logind.conf
new file mode 100644
index 0000000..71639c8
--- /dev/null
+++ b/.b/etc/elogind/logind.conf
@@ -0,0 +1,54 @@
+# This file is part of elogind.
+#
+# elogind is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# Entries in this file show the compile time defaults.
+# You can change settings by editing this file.
+# Defaults can be restored by simply deleting this file.
+#
+# See logind.conf(5) for details.
+
+[Login]
+#KillUserProcesses=no
+#KillOnlyUsers=
+#KillExcludeUsers=root
+#InhibitDelayMaxSec=5
+#HandlePowerKey=poweroff
+#HandleSuspendKey=suspend
+#HandleHibernateKey=hibernate
+#HandleLidSwitch=suspend
+#HandleLidSwitchExternalPower=suspend
+#HandleLidSwitchDocked=ignore
+#PowerKeyIgnoreInhibited=no
+#SuspendKeyIgnoreInhibited=no
+#HibernateKeyIgnoreInhibited=no
+#LidSwitchIgnoreInhibited=yes
+HoldoffTimeoutSec=1s
+#IdleAction=ignore
+#IdleActionSec=30min
+#RuntimeDirectorySize=10%
+#RuntimeDirectoryInodes=400k
+#RemoveIPC=yes
+#InhibitorsMax=8192
+#SessionsMax=8192
+
+[Sleep]
+#AllowSuspend=yes
+#AllowHibernation=yes
+#AllowSuspendThenHibernate=yes
+#AllowHybridSleep=yes
+#AllowPowerOffInterrupts=no
+#BroadcastPowerOffInterrupts=yes
+#AllowSuspendInterrupts=no
+#BroadcastSuspendInterrupts=yes
+#HandleNvidiaSleep=no
+#SuspendState=mem standby freeze
+#SuspendMode=
+#HibernateState=disk
+#HibernateMode=platform shutdown
+#HybridSleepState=disk
+#HybridSleepMode=suspend platform shutdown
+#HibernateDelaySec=10800
diff --git a/.b/etc/elogind/system-sleep/run-lock.sh b/.b/etc/elogind/system-sleep/run-lock.sh
new file mode 100755
index 0000000..35e6691
--- /dev/null
+++ b/.b/etc/elogind/system-sleep/run-lock.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Thanks https://wiki.gentoo.org/wiki/Elogind#Suspend.2FHibernate_Resume.2FThaw_hook_scripts
+case $1/$2 in
+ pre/*) # Put here any commands expected to be run when suspending or hibernating.
+ export DISPLAY=:0
+ sudo -H -u kamen bash -c '~/.a/sys/lock.sh && until xdotool search --onlyvisible --classname i3lock; do sleep 0.2; done'
+ ;;
+ post/*) # Put here any commands expected to be run when resuming from suspension or thawing from hibernation.
+ ;;
+esac