diff options
author | David Thompson <davet@gnu.org> | 2015-06-19 21:24:21 -0400 |
---|---|---|
committer | David Thompson <davet@gnu.org> | 2015-06-19 21:24:21 -0400 |
commit | 97fc19700179c188d9b51996ab34b1746c645885 (patch) | |
tree | d5e6a7e8da0051290a4a564189a0224a05cbf42f | |
parent | 6fd928594534b2b297071b1790a3d91f6714982c (diff) |
dmd: Update mpd service and add sshfs service.
-rw-r--r-- | dotfiles/.dmd.d/init.scm | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/dotfiles/.dmd.d/init.scm b/dotfiles/.dmd.d/init.scm index 4effd13..45d950c 100644 --- a/dotfiles/.dmd.d/init.scm +++ b/dotfiles/.dmd.d/init.scm @@ -8,6 +8,9 @@ (0 (begin body ...)) (pid pid))) +(define (touch-file file) + (close-port (open-file file "a0b"))) + (define (run-command command) (zero? (status:exit-val (apply system* command)))) @@ -64,12 +67,29 @@ (system* "offlineimap") (sleep 20)))) #:stop (make-kill-destructor)) + ;; FUSE + (make <service> + #:provides '(sshfs) + #:requires '() + #:start (make-forkexec-constructor + (list "sshfs" "aigis:Music" (string-append %home "/Music")))) ;; Music. - (simple-service "mpd") + (make <service> + #:provides '(mpd) + #:requires '() + #:start (lambda args + (define (scope file) + (string-append %home "/.config/mpd/" file)) + + (unless (file-exists? (scope "playlists")) + (mkdir (scope "playlists"))) + (touch-file (scope "database")) + (fork+exec-command + (list "mpd" (scope "mpd.conf"))))) (simple-service "mpdscribble")) ;; Send dmd into the background (action 'dmd 'daemonize) ;; Services to start when dmd starts: -(for-each start '(emacs xmodmap gpg-agent offlineimap)) +(for-each start '(emacs xmodmap gpg-agent offlineimap sshfs mpd)) |