Merge pull request #798 from fwSmit/move-config

Change config location to /etc/dunst/dunstrc
This commit is contained in:
Nikos Tsipinakis 2021-01-27 00:40:58 +02:00 committed by GitHub
commit 5d1b58559c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 25 additions and 15 deletions

View File

@ -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

View File

@ -1,6 +1,7 @@
# paths
PREFIX ?= /usr/local
BINDIR ?= ${PREFIX}/bin
SYSCONFDIR ?= /etc
DATADIR ?= ${PREFIX}/share
# around for backwards compatibility
MANPREFIX ?= ${DATADIR}/man

View File

@ -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.

View File

@ -54,6 +54,10 @@ static FILE *xdg_config(const char *filename)
g_free(path);
}
if (!f) {
f = fopen("/etc/dunst/dunstrc", "r");
}
return f;
}

View File

@ -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) - <<EOF
bin/dunst
bin/dunstctl
bin/dunstify
diff -u <(find "${DESTDIR}" -type f -printf "%P\n" | sort) - <<EOF
dbus/org.knopwob.dunst.service
share/dunst/dunstrc
share/man/man1/dunst.1
share/man/man1/dunstctl.1
sysconfdir/dunst/dunstrc
systemd/dunst.service
testprefix/bin/dunst
testprefix/bin/dunstctl
testprefix/bin/dunstify
testprefix/share/man/man1/dunst.1
testprefix/share/man/man1/dunstctl.1
EOF
# make sure to manually sort the above values
make -C "${BASE}" SYSTEMD=1 SERVICEDIR_SYSTEMD="${PREFIX}/systemd" SERVICEDIR_DBUS="${PREFIX}/dbus" PREFIX="${PREFIX}" uninstall
make -C "${BASE}" SYSTEMD=1 DESTDIR="${DESTDIR}" PREFIX="${PREFIX}" SYSCONFDIR="${SYSCONFDIR}" SERVICEDIR_SYSTEMD="/systemd" SERVICEDIR_DBUS="/dbus" uninstall
if ! [ -z "$(find "${PREFIX}" -type f)" ]; then
if ! [ -z "$(find "${DESTDIR}" -type f)" ]; then
echo "Uninstall failed, following files weren't removed"
find "${PREFIX}" -type f
find "${DESTDIR}" -type f
exit 1
fi