]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/blobdiff - contrib/pm-utils/40autorandr
Fix systemd detection, closes #48
[deb_pkgs/autorandr.git] / contrib / pm-utils / 40autorandr
index 419722474a90278edd71b0f767722e8b4954702e..4d59012515821c54d630eeda5987f4b5a9653361 100755 (executable)
@@ -5,6 +5,9 @@ exec > /var/log/autorandr.log 2>&1
 
 AUTORANDR="autorandr -c --default default"
 
+# Work around #44: Long user names in w
+export PROCPS_USERLEN=32
+
 detect_display()
 {
        for X in /tmp/.X11-unix/X*; do
@@ -36,6 +39,10 @@ detect_display()
        done
 }
 
+if grep -q systemd /proc/1/comm && [ "$2" = "udev" ]; then
+    exec /bin/systemctl start autorandr-resume.service
+fi
+
 case "$1" in
        thaw|resume)
                detect_display