diff --git a/Makefile b/Makefile index 143c7c3..e3f36d0 100644 --- a/Makefile +++ b/Makefile @@ -206,7 +206,7 @@ install-dunstctl: dunstctl install -Dm755 dunstctl ${DESTDIR}${BINDIR}/dunstctl install-doc: - install -Dm644 dunstrc ${DESTDIR}${DATADIR}/dunst/dunstrc + install -Dm644 dunstrc ${DESTDIR}${SYSCONFDIR}/dunst/dunstrc install-service: install-service-dbus install-service-dbus: service-dbus @@ -225,7 +225,7 @@ uninstall: uninstall-service uninstall-dunstctl rm -f ${DESTDIR}${BINDIR}/dunstify rm -f ${DESTDIR}${MANPREFIX}/man1/dunst.1 rm -f ${DESTDIR}${MANPREFIX}/man1/dunstctl.1 - rm -rf ${DESTDIR}${DATADIR}/dunst + rm -rf ${DESTDIR}${SYSCONFDIR}/dunst uninstall-dunstctl: rm -f ${DESTDIR}${BINDIR}/dunstctl diff --git a/config.mk b/config.mk index f71d49f..54426a7 100644 --- a/config.mk +++ b/config.mk @@ -1,6 +1,7 @@ # paths PREFIX ?= /usr/local BINDIR ?= ${PREFIX}/bin +SYSCONFDIR ?= /etc DATADIR ?= ${PREFIX}/share # around for backwards compatibility MANPREFIX ?= ${DATADIR}/man diff --git a/docs/dunst.pod b/docs/dunst.pod index 0497382..cc43f6a 100644 --- a/docs/dunst.pod +++ b/docs/dunst.pod @@ -35,7 +35,8 @@ rules or using the output in other scripts. =head1 CONFIGURATION -An example configuration file is included (usually /usr/share/dunst/dunstrc). +An example configuration file is included (usually /etc/dunst/dunstrc). Note: +this was previously /usr/share/dunst/dunstrc. To change the configuration, copy this file to ~/.config/dunst/dunstrc and edit it accordingly. diff --git a/src/settings.c b/src/settings.c index 0e1e8e2..99f865b 100644 --- a/src/settings.c +++ b/src/settings.c @@ -54,6 +54,10 @@ static FILE *xdg_config(const char *filename) g_free(path); } + if (!f) { + f = fopen("/etc/dunst/dunstrc", "r"); + } + return f; } diff --git a/test/test-install.sh b/test/test-install.sh index ab0d950..e21ddff 100755 --- a/test/test-install.sh +++ b/test/test-install.sh @@ -1,27 +1,31 @@ #!/usr/bin/env bash +# Throw error any time a command fails set -euo pipefail BASE="$(dirname "$(dirname "$(readlink -f "$0")")")" -PREFIX="${BASE}/install" +DESTDIR="${BASE}/install" +PREFIX="/testprefix" +SYSCONFDIR="/sysconfdir" -make -C "${BASE}" SYSTEMD=1 SERVICEDIR_SYSTEMD="${PREFIX}/systemd" SERVICEDIR_DBUS="${PREFIX}/dbus" PREFIX="${PREFIX}" install +make -C "${BASE}" SYSTEMD=1 DESTDIR="${DESTDIR}" PREFIX="${PREFIX}" SYSCONFDIR="${SYSCONFDIR}" SERVICEDIR_SYSTEMD="/systemd" SERVICEDIR_DBUS="/dbus" install -diff -u <(find "${PREFIX}" -type f -printf "%P\n" | sort) - <