summaryrefslogtreecommitdiff
path: root/sigils/home/services/xdg.scm
blob: f9ccc9077a041d8e9cdcd9151833e8c415966707 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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.")))