From 64a12d5fd8f349cf25dc4fe3dba4302173ee5e8f Mon Sep 17 00:00:00 2001 From: Nazar Mokrynskyi Date: Sat, 1 Oct 2016 05:55:37 +0300 Subject: [PATCH] Add xdg autostart config so that configuration will be applied on login. Small fix for files searching. --- Makefile | 11 ++++++++++- contrib/etc/xdg/autostart/autorandr.desktop | 6 ++++++ contrib/packaging/debian/make_deb.sh | 4 ++-- 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 contrib/etc/xdg/autostart/autorandr.desktop diff --git a/Makefile b/Makefile index 65d4708..51cfd7f 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ DESTDIR=/ PREFIX=/usr/ -.PHONY: all install uninstall autorandr bash_completion pmutils systemd udev +.PHONY: all install uninstall autorandr bash_completion autostart_config pmutils systemd udev all: @echo "Call \"make install\" to install this program." @@ -37,6 +37,15 @@ install_bash_completion: uninstall_bash_completion: rm -f ${DESTDIR}/${BASH_COMPLETION_DIR}/autorandr +# Rules for autostart config +XDG_AUTOSTART_DIR=/etc/xdg/autostart + +install_autostart_config: + install -D -m 644 contrib/etc/xdg/autostart/autorandr.desktop ${DESTDIR}/${XDG_AUTOSTART_DIR}/autorandr.desktop + +uninstall_autostart_config: + rm -f ${DESTDIR}/${XDG_AUTOSTART_DIR}/autorandr.desktop + # Rules for pmutils PM_UTILS_DIR=/etc/pm/sleep.d HAVE_PMUTILS=$(shell [ -x /usr/sbin/pm-suspend ] && echo "y") diff --git a/contrib/etc/xdg/autostart/autorandr.desktop b/contrib/etc/xdg/autostart/autorandr.desktop new file mode 100644 index 0000000..47b9b9a --- /dev/null +++ b/contrib/etc/xdg/autostart/autorandr.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Name=Autorandr +Comment=Automatically select a display configuration based on connected devices +Type=Application +Exec=/usr/bin/autorandr -c --default default +X-GNOME-Autostart-Phase=Initialization diff --git a/contrib/packaging/debian/make_deb.sh b/contrib/packaging/debian/make_deb.sh index 404aaef..dddc08f 100755 --- a/contrib/packaging/debian/make_deb.sh +++ b/contrib/packaging/debian/make_deb.sh @@ -34,7 +34,7 @@ mkdir $D # Debian(ish) specific part make -C "$P/../../../" \ DESTDIR="$D" \ - TARGETS="autorandr bash_completion pmutils systemd udev" \ + TARGETS="autorandr bash_completion autostart_config pmutils systemd udev" \ BASH_COMPLETION_DIR=/usr/share/bash-completion/completions \ SYSTEMD_UNIT_DIR=/lib/systemd/system \ PM_UTILS_DIR=/usr/lib/pm-utils/sleep.d \ @@ -44,7 +44,7 @@ make -C "$P/../../../" \ SIZE=$(du -s $D | awk '{print $1}') cp -r "$P/debian" "$D/DEBIAN" -[ -d "$D/etc" ] && (cd $D; find etc) > "$D/DEBIAN/conffiles" +[ -d "$D/etc" ] && (cd $D; find etc -type f) > "$D/DEBIAN/conffiles" sed -i -re "s#Version:.+#Version: $V#" "$D/DEBIAN/control" echo "Installed-Size: $SIZE" >> "$D/DEBIAN/control" fakeroot dpkg-deb -b "$D" "$O" -- 2.39.2