From 41e408eb1f93d96b549d345e2de74143220b7b76 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 22 Sep 2024 13:05:41 +0300 Subject: [PATCH] gnu: swayhide: Install shell completions. * gnu/packages/rust-apps.scm (swayhide)[arguments]: Add a phase to install the shell completions. Change-Id: I143667394a9c4b8a6c0f5ed275f8c80a5508c305 --- gnu/packages/rust-apps.scm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm index ad9afb1923..e6cce4d372 100644 --- a/gnu/packages/rust-apps.scm +++ b/gnu/packages/rust-apps.scm @@ -3025,7 +3025,22 @@ (define-public swayhide `(#:install-source? #f #:cargo-inputs (("rust-exitcode" ,rust-exitcode-1) - ("rust-swayipc" ,rust-swayipc-2)))) + ("rust-swayipc" ,rust-swayipc-2)) + #:phases + (modify-phases %standard-phases + (add-after 'install 'install-completions + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bash (string-append out "/etc/bash_completion.d/")) + (fish (string-append out "/share/fish/vendor_completions.d/")) + (zsh (string-append out "/share/zsh/site-functions/"))) + (mkdir-p bash) + (mkdir-p zsh) + (copy-file "completions/swayhide.bash" + (string-append bash "swayhide")) + (copy-file "completions/swayhide.zsh" + (string-append zsh "_swayhide")) + (install-file "completions/swayhide.fish" fish))))))) (home-page "https://github.com/NomisIV/swayhide/") (synopsis "Swallow windows on swaywm") (description "swayhide hides the currently active terminal (by moving it