Skip to content

Commit 56ca621

Browse files
committed
Install completions by default
This fixes #1262. To better distinguish (maintained) completions from community contributions, they are move to completions.
1 parent 660e8ba commit 56ca621

11 files changed

+53
-10
lines changed

Diff for: Makefile

+27-1
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,26 @@ install-dunstify: dunstify
235235
install -Dm755 dunstify ${DESTDIR}${BINDIR}/dunstify
236236
endif
237237

238+
ifneq (0,${COMPLETIONS})
239+
install: install-completions
240+
install-completions:
241+
install -Dm644 completions/dunst.bashcomp ${DESTDIR}${BASHCOMPLETIONDIR}/dunst
242+
install -Dm644 completions/dunstctl.bashcomp ${DESTDIR}${BASHCOMPLETIONDIR}/dunstctl
243+
install -Dm644 completions/_dunst.zshcomp ${DESTDIR}${ZSHCOMPLETIONDIR}/_dunst
244+
install -Dm644 completions/_dunstctl.zshcomp ${DESTDIR}${ZSHCOMPLETIONDIR}/_dunstctl
245+
install -Dm644 completions/dunst.fishcomp ${DESTDIR}${FISHCOMPLETIONDIR}/dunst
246+
install -Dm644 completions/dunstctl.fishcomp ${DESTDIR}${FISHCOMPLETIONDIR}/dunstctl
247+
248+
ifneq (0,${DUNSTIFY})
249+
install: install-completions-dunstify
250+
install-completions-dunstify:
251+
install -Dm644 completions/dunstify.fishcomp ${DESTDIR}${FISHCOMPLETIONDIR}/dunstify
252+
endif
253+
endif
254+
238255
uninstall: uninstall-keepconf
239256
uninstall-purge: uninstall-keepconf uninstall-dunstrc
240-
uninstall-keepconf: uninstall-service uninstall-dunstctl
257+
uninstall-keepconf: uninstall-service uninstall-dunstctl uninstall-completions
241258
rm -f ${DESTDIR}${BINDIR}/dunst
242259
rm -f ${DESTDIR}${BINDIR}/dunstify
243260
rm -f ${DESTDIR}${MANPREFIX}/man1/dunst.1
@@ -260,3 +277,12 @@ uninstall-service: uninstall-service-systemd
260277
uninstall-service-systemd:
261278
rm -f ${DESTDIR}${SERVICEDIR_SYSTEMD}/dunst.service
262279
endif
280+
281+
uninstall-completions:
282+
rm -f ${DESTDIR}${BASHCOMPLETIONDIR}/dunst
283+
rm -f ${DESTDIR}${BASHCOMPLETIONDIR}/dunstctl
284+
rm -f ${DESTDIR}${ZSHCOMPLETIONDIR}/_dunst
285+
rm -f ${DESTDIR}${ZSHCOMPLETIONDIR}/_dunstctl
286+
rm -f ${DESTDIR}${FISHCOMPLETIONDIR}/dunst
287+
rm -f ${DESTDIR}${FISHCOMPLETIONDIR}/dunstctl
288+
rm -f ${DESTDIR}${FISHCOMPLETIONDIR}/dunstify

Diff for: README.md

+13-9
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99
## Table of Contents
1010

11-
* [Features](#features)
12-
* [Building](#building)
13-
* [Contributing](#contributing)
14-
* [Documentation](#documentation)
15-
* [Troubleshooting](#troubleshooting)
16-
* [Copyright](#copyright)
11+
- [Features](#features)
12+
- [Building](#building)
13+
- [Contributing](#contributing)
14+
- [Documentation](#documentation)
15+
- [Troubleshooting](#troubleshooting)
16+
- [Copyright](#copyright)
1717

1818
# Features
1919

@@ -56,8 +56,8 @@ If you want to take a break and not receive any notifications for a while, just
5656
pause dunst. All notifications will be saved for you to catch up
5757
later.
5858

59-
Additionally, you can set a numeric pause level, which allows you to pause dunst
60-
selectively for some notifications, where more urgent notifications get through,
59+
Additionally, you can set a numeric pause level, which allows you to pause dunst
60+
selectively for some notifications, where more urgent notifications get through,
6161
but less urgent stay paused.
6262

6363
## 🕘 History
@@ -112,6 +112,9 @@ sudo make install
112112
- `PREFIX=<PATH>`: Set the prefix of the installation. (Default: `/usr/local`)
113113
- `BINDIR=<PATH>`: Set the `dunst` executable's path (Default: `${PREFIX}/bin`)
114114
- `DATADIR=<PATH>`: Set the path for shared files. (Default: `${PREFIX}/share`)
115+
- `BASHCOMPLETIONDIR=<PATH>`: Set the path for installation of bash completion files. (Default: `${DATADIR}/bash-completion/completions`)
116+
- `FISHCOMPLETIONDIR=<PATH>`: Set the path for installation of fish completion files. (Default: `${DATADIR}/fish/vendor_completions.d`)
117+
- `ZSHCOMPLETIONDIR=<PATH>`: Set the path for installation of zsh completion files. (Default: `${DATADIR}/zsh/site-functions`)
115118
- `SYSCONFDIR=<PATH>`: Set the base directory for system config files. (Default: `${PREFIX}/etc/xdg`)
116119
- `SYSCONFFILE=<PATH>`: Set the absolute path to which the default dunstrc shall be installed. (Default: `${SYSCONFDIR}/dunst/dunstrc`)
117120
- `SYSCONF_FORCE_NEW=(0|1)`: Overwrite existing `${SYSCONFFILE}`. (Default: 0 (don't overwrite))
@@ -120,6 +123,7 @@ sudo make install
120123
- `WAYLAND=(0|1)`: Disable/Enable wayland support. (Default: 1 (enabled))
121124
- `X11=(0|1)`: Disable/Enable X11 support. (Default: 1 (enabled))
122125
- `DUNSTIFY=(0|1)`: Disable/Enable the libnotify dunstctl utility. (Default: 1 (enabled))
126+
- `COMPLETIONS=(0|1)`: Disable/Enable installation of shell completions. (Default: 1 (enabled))
123127
- `SERVICEDIR_SYSTEMD=<PATH>`: The path to put the systemd user service file. Unused, if `SYSTEMD=0`. (Default: `${PREFIX}/lib/systemd/user`)
124128
- `SERVICEDIR_DBUS=<PATH>`: The path to put the dbus service file. (Default: `${DATADIR}/dbus-1/services`)
125129
- `EXTRA_CFLAGS=<FLAGS>`: Additional flags for the compiler.
@@ -197,7 +201,7 @@ Written by Sascha Kruse <[email protected]>
197201

198202
Copyright 2013 Sascha Kruse and contributors (see [`LICENSE`](./LICENSE) for licensing information)
199203

200-
[issue-tracker]: https://github.com/dunst-project/dunst/issues
204+
[issue-tracker]: https://github.com/dunst-project/dunst/issues
201205
[wiki]: https://github.com/dunst-project/dunst/wiki
202206
[website]: https://dunst-project.org
203207
[FAQ]: https://dunst-project.org/faq
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: config.mk

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ BINDIR ?= ${PREFIX}/bin
44
SYSCONFDIR ?= ${PREFIX}/etc/xdg
55
SYSCONFFILE ?= ${SYSCONFDIR}/dunst/dunstrc
66
DATADIR ?= ${PREFIX}/share
7+
BASHCOMPLETIONDIR ?= ${DATADIR}/bash-completion/completions
8+
FISHCOMPLETIONDIR ?= ${DATADIR}/fish/vendor_completions.d
9+
ZSHCOMPLETIONDIR ?= ${DATADIR}/zsh/site-functions
710
# around for backwards compatibility
811
MANPREFIX ?= ${DATADIR}/man
912
MANDIR ?= ${MANPREFIX}
@@ -36,6 +39,9 @@ VALGRIND ?= valgrind
3639
# Other applications will continue to work, as they use direct D-Bus.
3740
# DUNSTIFY ?=0
3841

42+
# Disable installation of completions.
43+
# COMPLETIONS ?= 0
44+
3945
ifneq (0, ${WAYLAND})
4046
ENABLE_WAYLAND= -DENABLE_WAYLAND
4147
endif

Diff for: test/test-install.sh

+7
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,16 @@ systemd/dunst.service
3131
testprefix/bin/dunst
3232
testprefix/bin/dunstctl
3333
testprefix/bin/dunstify
34+
testprefix/share/bash-completion/completions/dunst
35+
testprefix/share/bash-completion/completions/dunstctl
36+
testprefix/share/fish/vendor_completions.d/dunst
37+
testprefix/share/fish/vendor_completions.d/dunstctl
38+
testprefix/share/fish/vendor_completions.d/dunstify
3439
testprefix/share/man/man1/dunst.1
3540
testprefix/share/man/man1/dunstctl.1
3641
testprefix/share/man/man5/dunst.5
42+
testprefix/share/zsh/site-functions/_dunst
43+
testprefix/share/zsh/site-functions/_dunstctl
3744
EOF
3845

3946
do_make uninstall

0 commit comments

Comments
 (0)