mirror of
https://codeberg.org/hako/Rosenthal.git
synced 2026-11-29 22:58:06 +00:00
utils: Add ‘hidden-desktop-entry’.
* modules/rosenthal/utils/file.scm (hidden-desktop-entry): New procedure.
This commit is contained in:
1 file changed
+15
-1
@@ -5,7 +5,11 @@
|
|||||||
#:use-module (ice-9 textual-ports)
|
#:use-module (ice-9 textual-ports)
|
||||||
#:use-module (guix gexp)
|
#:use-module (guix gexp)
|
||||||
#:export (computed-substitution-with-inputs
|
#:export (computed-substitution-with-inputs
|
||||||
file-content))
|
file-content
|
||||||
|
hidden-desktop-entry))
|
||||||
|
|
||||||
|
;; XXX: ‘substitute*’ doesn't fully support Unicode:
|
||||||
|
;; https://codeberg.org/guix/guix/src/commit/a88d6a45e422cede96d57d7a953439dc27c6a50c/guix/build/utils.scm#L964
|
||||||
|
|
||||||
(define (computed-substitution-with-inputs name file inputs)
|
(define (computed-substitution-with-inputs name file inputs)
|
||||||
(with-imported-modules '((guix build utils))
|
(with-imported-modules '((guix build utils))
|
||||||
@@ -20,3 +24,13 @@
|
|||||||
|
|
||||||
(define (file-content file)
|
(define (file-content file)
|
||||||
(call-with-input-file (canonicalize-path file) get-string-all))
|
(call-with-input-file (canonicalize-path file) get-string-all))
|
||||||
|
|
||||||
|
(define (hidden-desktop-entry name file)
|
||||||
|
(computed-file name
|
||||||
|
(with-imported-modules '((guix build utils))
|
||||||
|
#~(begin
|
||||||
|
(use-modules (guix build utils))
|
||||||
|
(copy-file #$file #$output)
|
||||||
|
(substitute* #$output
|
||||||
|
(("[Desktop Entry]" all)
|
||||||
|
(string-append all "NoDisplay=true\n")))))))
|
||||||
Reference in new issue
Block a user