Merge pull request #148678 from anund/fix_autorandr_zsh_completions

autorandr: install zsh completions
This commit is contained in:
Jörg Thalheim 2021-12-05 09:27:47 +00:00 committed by GitHub
commit b1d73d99e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,7 +2,8 @@
, python3Packages
, fetchFromGitHub
, systemd
, xrandr }:
, xrandr
, installShellFiles }:
stdenv.mkDerivation rec {
pname = "autorandr";
@ -10,6 +11,8 @@ stdenv.mkDerivation rec {
buildInputs = [ python3Packages.python ];
nativeBuildInputs = [ installShellFiles ];
# no wrapper, as autorandr --batch does os.environ.clear()
buildPhase = ''
substituteInPlace autorandr.py \
@ -23,7 +26,12 @@ stdenv.mkDerivation rec {
runHook preInstall
make install TARGETS='autorandr' PREFIX=$out
make install TARGETS='bash_completion' DESTDIR=$out/share/bash-completion/completions
# zsh completions exist but currently have no make target, use
# installShellCompletions for both
# see https://github.com/phillipberndt/autorandr/issues/197
installShellCompletion --cmd autorandr \
--bash contrib/bash_completion/autorandr \
--zsh contrib/zsh_completion/_autorandr
make install TARGETS='autostart_config' PREFIX=$out DESTDIR=$out