mirror of
https://codeberg.org/hako/Rosenthal.git
synced 2025-08-23 14:36:43 +00:00
utils: Add ‘hidden-desktop-entry’.
* modules/rosenthal/utils/file.scm (hidden-desktop-entry): New procedure.
This commit is contained in:
parent
dc6ed8b930
commit
8c1b2e9c61
@ -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")))))))
|
||||||
|
Loading…
Reference in New Issue
Block a user