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
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
@echo " udevadm control --reload-rules"
endif
-uninstall_udev:
+uninstall_udev: uninstall_pmutils
rm -f ${DESTDIR}/etc/udev/rules.d/40-monitor-hotplug.rules
`--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
#
from __future__ import print_function
-import time
import binascii
import copy
import subprocess
import sys
import shutil
+import time
from collections import OrderedDict
from distutils.version import LooseVersion as Version
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)
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
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