From 97fc19700179c188d9b51996ab34b1746c645885 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Fri, 19 Jun 2015 21:24:21 -0400 Subject: dmd: Update mpd service and add sshfs service. --- dotfiles/.dmd.d/init.scm | 24 ++++++++++++++++++++++-- 1 file 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 + #:provides '(sshfs) + #:requires '() + #:start (make-forkexec-constructor + (list "sshfs" "aigis:Music" (string-append %home "/Music")))) ;; Music. - (simple-service "mpd") + (make + #: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)) -- cgit v1.2.3