summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dotfiles/.dmd.d/init.scm24
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))