aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-03-11 20:09:50 -0300
committerEuAndreh <eu@euandre.org>2023-03-11 20:09:50 -0300
commit459ad2218d27551f44ffc52b20ec206aa4406617 (patch)
treeca6adec063c41deb36436cd19b2b0c7a075024b2
parentetc/guix/channels.scm: Update path to "org-euandre" channel (diff)
downloaddotfiles-459ad2218d27551f44ffc52b20ec206aa4406617.tar.gz
dotfiles-459ad2218d27551f44ffc52b20ec206aa4406617.tar.xz
etc/guix/home.scm: Inline definition of clipmenu-latest from org-euandre channel
-rw-r--r--etc/guix/home.scm96
1 files changed, 92 insertions, 4 deletions
diff --git a/etc/guix/home.scm b/etc/guix/home.scm
index fa17e27..24e8616 100644
--- a/etc/guix/home.scm
+++ b/etc/guix/home.scm
@@ -2,7 +2,6 @@
((ice-9 textual-ports) #:prefix textual-ports:)
((guix licenses) #:prefix licenses:)
((xyz euandreh heredoc) #:prefix heredoc:)
- ((xyz euandreh queue) #:prefix queue:)
(gnu home)
(gnu home services)
(gnu home services mcron)
@@ -14,10 +13,13 @@
(gnu packages curl)
(gnu packages dunst)
(gnu packages freedesktop)
+ (gnu packages gawk)
(gnu packages gnupg)
(gnu packages gpodder)
+ (gnu packages guile)
(gnu packages hunspell)
(gnu packages libreoffice)
+ (gnu packages linux)
(gnu packages mail)
(gnu packages music)
(gnu packages wget)
@@ -29,6 +31,7 @@
(gnu packages video)
(gnu packages xdisorg)
(gnu services)
+ (guix build-system gnu)
(guix build-system trivial)
(guix download)
(guix gexp)
@@ -40,6 +43,91 @@
;; Sent upstream as:
+;; https://issues.guix.gnu.org/58931
+(define-public clipmenu-latest
+ (let ((commit "7c34ace1fbab76eb1c1dc9b30dd4ac1a7fe4b90b")
+ (revision "1"))
+ (package
+ (name "clipmenu-latest")
+ (version (string-append "6.2.0-"
+ revision "." (string-take commit 7)))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/cdown/clipmenu")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1403sw49ccb8xsd8v611fzp0csaglfz8nmz3wcjsk8x11h9jvxwy"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (delete 'configure)
+ (delete 'build)
+ (replace 'install
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (bin (string-append out "/bin"))
+ (doc (string-append %output "/share/doc/"
+ ,name "-" ,version)))
+ (install-file "clipdel" bin)
+ (install-file "clipmenu" bin)
+ (install-file "clipmenud" bin)
+ (install-file "clipfsck" bin)
+ (install-file "clipctl" bin)
+ (install-file "README.md" doc))))
+ (add-after 'install 'wrap-script
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (clipnotify (assoc-ref inputs "clipnotify"))
+ (coreutils-minimal (assoc-ref inputs "coreutils-minimal"))
+ (gawk (assoc-ref inputs "gawk"))
+ (util-linux (assoc-ref inputs "util-linux"))
+ (xdotool (assoc-ref inputs "xdotool"))
+ (xsel (assoc-ref inputs "xsel"))
+ (guile (search-input-file inputs "bin/guile")))
+ (for-each
+ (lambda (prog)
+ (wrap-script (string-append out "/bin/" prog)
+ #:guile guile
+ `("PATH" ":" prefix
+ ,(map (lambda (dir)
+ (string-append dir "/bin"))
+ (list clipnotify coreutils-minimal
+ gawk util-linux xdotool xsel)))))
+ '("clipmenu" "clipmenud" "clipdel" "clipfsck" "clipctl")))))
+ (replace 'check
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ ;; substitute a shebang appearing inside a string (the test
+ ;; file writes this string to a temporary file):
+ (substitute* "tests/test-clipmenu"
+ (("#!/usr/bin/env bash")
+ (string-append "#!" (which "bash"))))
+ (invoke "tests/test-clipmenu"))))))
+ (inputs
+ (list clipnotify
+ coreutils-minimal
+ gawk
+ guile-3.0 ; for wrap-script
+ util-linux
+ xdotool
+ xsel))
+ (home-page "https://github.com/cdown/clipmenu")
+ (synopsis "Simple clipboard manager using dmenu or rofi and xsel")
+ (description "Start @command{clipmenud}, then run @command{clipmenu} to
+select something to put on the clipboard.
+
+When @command{clipmenud} detects changes to the clipboard contents, it writes
+them out to the cache directory. @command{clipmenu} reads the cache directory
+to find all available clips and launches @command{dmenu} (or @command{rofi},
+depending on the value of @code{CM_LAUNCHER}) to let the user select a clip.
+After selection, the clip is put onto the PRIMARY and CLIPBOARD X selections.")
+ (license licenses:public-domain))))
+
+;; Sent upstream as:
;; https://issues.guix.gnu.org/61823
(define-public tmux-plugin-continuum
(package
@@ -603,9 +691,9 @@ left it off the last time it was used.")
work-packages))
(services
(list
- (service (home-service 'clipmenu queue:clipmenu-latest "/bin/clipmenud"))
- (service (home-service 'dunst dunst "/bin/dunst"))
- (service (home-service 'poweralertd poweralertd "/bin/poweralertd"))
+ (service (home-service 'clipmenu clipmenu-latest "/bin/clipmenud"))
+ (service (home-service 'dunst dunst "/bin/dunst"))
+ (service (home-service 'poweralertd poweralertd "/bin/poweralertd"))
(service home-xdg-base-directories-service-type
(home-xdg-base-directories-configuration
(cache-home (xdg "var/cache"))