]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/commitdiff
Merge branch 'retry_commands'
authorPhillip Berndt <phillip.berndt@googlemail.com>
Sun, 5 Jun 2016 19:15:37 +0000 (21:15 +0200)
committerPhillip Berndt <phillip.berndt@googlemail.com>
Sun, 5 Jun 2016 19:16:27 +0000 (21:16 +0200)
Makefile
README.md
autorandr.py
contrib/pm-utils/40autorandr

index 42ee710fcd5c04f0b4fa57dc98df0abf14a5eb25..a312da8fde60c30c0d4ef038af2e7900407d8591 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -45,7 +45,7 @@ uninstall_pmutils:
        rm -f ${DESTDIR}/etc/pm/sleep.d/40autorandr
 
 # Rules for systemd
-HAVE_SYSTEMD=$(shell grep -q systemd $$(readlink -f $$(awk '{print $$1}' /proc/1/cmdline)) && echo "y")
+HAVE_SYSTEMD=$(shell grep -q systemd /proc/1/comm && echo "y")
 ifeq ($(HAVE_SYSTEMD),y)
 DEFAULT_TARGETS+=systemd
 endif
@@ -62,7 +62,7 @@ ifeq ($(HAVE_UDEV),y)
 DEFAULT_TARGETS+=udev
 endif
 
-install_udev:
+install_udev: install_pmutils
        install -D -m 644 contrib/udev/40-monitor-hotplug.rules ${DESTDIR}/etc/udev/rules.d/40-monitor-hotplug.rules
 ifeq (${USER},root)
        udevadm control --reload-rules
@@ -71,7 +71,7 @@ else
        @echo "    udevadm control --reload-rules"
 endif
 
-uninstall_udev:
+uninstall_udev: uninstall_pmutils
        rm -f ${DESTDIR}/etc/udev/rules.d/40-monitor-hotplug.rules
 
 
index 52867d176952bf4cbafcf193ca733424896ba440..1bda138ac9b5f09f66e9819afa07c10fe738e7b0 100644 (file)
--- a/README.md
+++ b/README.md
@@ -85,9 +85,12 @@ To change this behaviour and switch to a fallback configuration, specify
 `--default <profile>`.
 
 Another script called `postswitch` can be placed in the directory
-`~/.config/autorandr` (or `~/.autorandr` if you have an old installation) as well as in all profile directories: The scripts are executed
-after a mode switch has taken place and can notify window managers or other
-applications about it.
+`~/.config/autorandr` (or `~/.autorandr` if you have an old installation) as
+well as in all profile directories: The scripts are executed after a mode
+switch has taken place and can notify window managers or other applications
+about it. The same holds for `preswitch`, which is executed before the switch
+takes place, and `postsave`, which is executed after a profile was
+stored/altered.
 
 All scripts can also be placed in any of the `$XDG_CONFIG_DIRS`. In addition to
 the script names themselves, any executables in subdirectories named
index 812329ddf72e78d8dd01bc158fa37cc74ed1cdc1..c8b8f8fcebbd15f2de349876c82bf605cf98181a 100755 (executable)
@@ -23,7 +23,6 @@
 #
 
 from __future__ import print_function
-import time
 
 import binascii
 import copy
@@ -35,6 +34,7 @@ import re
 import subprocess
 import sys
 import shutil
+import time
 
 from collections import OrderedDict
 from distutils.version import LooseVersion as Version
@@ -113,7 +113,8 @@ class AutorandrException(Exception):
             retval.append(":\n  ")
             retval.append(str(self.original_exception).replace("\n", "\n  "))
         if self.report_bug:
-            retval.append("\nThis appears to be a bug. Please help improving autorandr by reporting it upstream."
+            retval.append("\nThis appears to be a bug. Please help improving autorandr by reporting it upstream:"
+                          "\nhttps://github.com/phillipberndt/autorandr/issues"
                          "\nPlease attach the output of `xrandr --verbose` to your bug report if appropriate.")
         return "".join(retval)
 
@@ -945,5 +946,5 @@ if __name__ == '__main__':
             print("Exception: {0}".format(e.__class__.__name__))
             sys.exit(2)
 
-        print("Unhandled exception ({0}). Please report this as a bug.".format(e), file=sys.stderr)
+        print("Unhandled exception ({0}). Please report this as a bug at https://github.com/phillipberndt/autorandr/issues.".format(e), file=sys.stderr)
         raise
index f44739a609e2aa032ed868c584a773d48851c234..4d59012515821c54d630eeda5987f4b5a9653361 100755 (executable)
@@ -39,7 +39,7 @@ detect_display()
        done
 }
 
-if grep -q systemd $(readlink -f $(awk '{print $1}' /proc/1/cmdline)) && [ "$2" = "udev" ]; then
+if grep -q systemd /proc/1/comm && [ "$2" = "udev" ]; then
     exec /bin/systemctl start autorandr-resume.service
 fi