summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSisiutl <sisiutl@egregore.fun>2025-02-01 01:37:25 +0100
committerSisiutl <sisiutl@egregore.fun>2025-02-01 01:52:10 +0100
commitaae428799375840cdd2c000e0e4c8b13cf2abc34 (patch)
treeab3f9e6c7dd4eb2a1a36e623a467da4f7f131aa2
parent3ea36c309362671f0638c0c7a70ae28007ffc8cb (diff)
revamp sigils xdg service
-rw-r--r--sigils/home/services/xdg.scm30
-rw-r--r--sigils/services/xdg.scm26
2 files changed, 30 insertions, 26 deletions
diff --git a/sigils/home/services/xdg.scm b/sigils/home/services/xdg.scm
new file mode 100644
index 0000000..f9ccc90
--- /dev/null
+++ b/sigils/home/services/xdg.scm
@@ -0,0 +1,30 @@
+(define-module (sigils home services xdg)
+ #:use-module (gnu home services)
+ #:use-module (gnu packages)
+ #:use-module (guix gexp)
+ #:use-module (ice-9 match)
+ #:use-module (srfi srfi-1))
+
+(define xdg-autostart-files-directory "autostart")
+
+(define (xdg-autostart-files files)
+ "Put each file in FILES into the autostart directory
+FILES is an array of pairs in the form of @lisp{(package . filename.desktop)}.
+If filename.desktop exists in the package, it will be placed in the autostart directory."
+ (map (match-lambda
+ ((package . desktop-file)
+ (list (string-append xdg-autostart-files-directory "/" desktop-file)
+ (file-append
+ package
+ (string-append "/share/applications/" desktop-file)))))
+ files))
+
+(define-public home-xdg-autostart-files-service-type
+(service-type (name 'home-xdg-autostart)
+ (extensions
+ (list (service-extension home-xdg-configuration-files-service-type
+ xdg-autostart-files)))
+ (compose concatenate)
+ (extend append)
+ (default-value '())
+ (description "Files that will be put in @file{~/.guix-home/config/autostart} for XDG autostart compliance.")))
diff --git a/sigils/services/xdg.scm b/sigils/services/xdg.scm
deleted file mode 100644
index b0725b7..0000000
--- a/sigils/services/xdg.scm
+++ /dev/null
@@ -1,26 +0,0 @@
-(define-module (sigils services xdg)
- #:use-module (gnu home services)
- #:use-module (gnu packages)
- #:use-module (guix gexp)
- #:use-module (ice-9 match)
- #:use-module (srfi srfi-1))
-
-(define xdg-autostart-files-directory "autostart")
-(define (xdg-autostart-files files)
- "Put each file in FILES into the autostart directory"
- (map (match-lambda
- ((desktop-file package)
- (cons (string-append xdg-autostart-files-directory "/" desktop-file ".desktop")
- `(,(file-append (specification->package package)
- (string-append "/share/applications/" desktop-file ".desktop"))))))
- files))
-
-(define-public home-xdg-autostart-files-service-type
- (service-type (name 'home-xdg-autostart)
- (extensions
- (list (service-extension home-xdg-configuration-files-service-type
- xdg-autostart-files)))
- (compose concatenate)
- (extend append)
- (default-value '())
- (description "Files that will be put in @file{~/.guix-home/config/autostart} for XDG autostart compliance.")))