Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Install completions by default #1263

Merged
merged 1 commit into from
Mar 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,26 @@ install-dunstify: dunstify
install -Dm755 dunstify ${DESTDIR}${BINDIR}/dunstify
endif

ifneq (0,${COMPLETIONS})
install: install-completions
install-completions:
install -Dm644 completions/dunst.bashcomp ${DESTDIR}${BASHCOMPLETIONDIR}/dunst
install -Dm644 completions/dunstctl.bashcomp ${DESTDIR}${BASHCOMPLETIONDIR}/dunstctl
install -Dm644 completions/_dunst.zshcomp ${DESTDIR}${ZSHCOMPLETIONDIR}/_dunst
install -Dm644 completions/_dunstctl.zshcomp ${DESTDIR}${ZSHCOMPLETIONDIR}/_dunstctl
install -Dm644 completions/dunst.fishcomp ${DESTDIR}${FISHCOMPLETIONDIR}/dunst
install -Dm644 completions/dunstctl.fishcomp ${DESTDIR}${FISHCOMPLETIONDIR}/dunstctl
bynect marked this conversation as resolved.
Show resolved Hide resolved

ifneq (0,${DUNSTIFY})
install: install-completions-dunstify
install-completions-dunstify:
install -Dm644 completions/dunstify.fishcomp ${DESTDIR}${FISHCOMPLETIONDIR}/dunstify
endif
endif

uninstall: uninstall-keepconf
uninstall-purge: uninstall-keepconf uninstall-dunstrc
uninstall-keepconf: uninstall-service uninstall-dunstctl
uninstall-keepconf: uninstall-service uninstall-dunstctl uninstall-completions
rm -f ${DESTDIR}${BINDIR}/dunst
rm -f ${DESTDIR}${BINDIR}/dunstify
rm -f ${DESTDIR}${MANPREFIX}/man1/dunst.1
Expand All @@ -260,3 +277,12 @@ uninstall-service: uninstall-service-systemd
uninstall-service-systemd:
rm -f ${DESTDIR}${SERVICEDIR_SYSTEMD}/dunst.service
endif

uninstall-completions:
rm -f ${DESTDIR}${BASHCOMPLETIONDIR}/dunst
rm -f ${DESTDIR}${BASHCOMPLETIONDIR}/dunstctl
rm -f ${DESTDIR}${ZSHCOMPLETIONDIR}/_dunst
rm -f ${DESTDIR}${ZSHCOMPLETIONDIR}/_dunstctl
rm -f ${DESTDIR}${FISHCOMPLETIONDIR}/dunst
rm -f ${DESTDIR}${FISHCOMPLETIONDIR}/dunstctl
rm -f ${DESTDIR}${FISHCOMPLETIONDIR}/dunstify
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

## Table of Contents

* [Features](#features)
* [Building](#building)
* [Contributing](#contributing)
* [Documentation](#documentation)
* [Troubleshooting](#troubleshooting)
* [Copyright](#copyright)
- [Features](#features)
- [Building](#building)
- [Contributing](#contributing)
- [Documentation](#documentation)
- [Troubleshooting](#troubleshooting)
- [Copyright](#copyright)

# Features

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

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

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

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

[issue-tracker]: https://github.com/dunst-project/dunst/issues
[issue-tracker]: https://github.com/dunst-project/dunst/issues
[wiki]: https://github.com/dunst-project/dunst/wiki
[website]: https://dunst-project.org
[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.
6 changes: 6 additions & 0 deletions config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ BINDIR ?= ${PREFIX}/bin
SYSCONFDIR ?= ${PREFIX}/etc/xdg
SYSCONFFILE ?= ${SYSCONFDIR}/dunst/dunstrc
DATADIR ?= ${PREFIX}/share
BASHCOMPLETIONDIR ?= ${DATADIR}/bash-completion/completions
FISHCOMPLETIONDIR ?= ${DATADIR}/fish/vendor_completions.d
ZSHCOMPLETIONDIR ?= ${DATADIR}/zsh/site-functions
# around for backwards compatibility
MANPREFIX ?= ${DATADIR}/man
MANDIR ?= ${MANPREFIX}
Expand Down Expand Up @@ -36,6 +39,9 @@ VALGRIND ?= valgrind
# Other applications will continue to work, as they use direct D-Bus.
# DUNSTIFY ?=0

# Disable installation of completions.
# COMPLETIONS ?= 0

ifneq (0, ${WAYLAND})
ENABLE_WAYLAND= -DENABLE_WAYLAND
endif
Expand Down
7 changes: 7 additions & 0 deletions test/test-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,16 @@ systemd/dunst.service
testprefix/bin/dunst
testprefix/bin/dunstctl
testprefix/bin/dunstify
testprefix/share/bash-completion/completions/dunst
testprefix/share/bash-completion/completions/dunstctl
testprefix/share/fish/vendor_completions.d/dunst
testprefix/share/fish/vendor_completions.d/dunstctl
testprefix/share/fish/vendor_completions.d/dunstify
testprefix/share/man/man1/dunst.1
testprefix/share/man/man1/dunstctl.1
testprefix/share/man/man5/dunst.5
testprefix/share/zsh/site-functions/_dunst
testprefix/share/zsh/site-functions/_dunstctl
EOF

do_make uninstall
Expand Down
Loading