aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-05-06 17:59:37 +0200
committerHugo Hörnquist <hugo@hornquist.se>2019-05-06 17:59:37 +0200
commit4c72550f0f0a4a71c7381493738233c64ff04091 (patch)
treea1a966a87deaef6c71de5e36d8d5b21c1995e71a
parentAdd unused js for creating events. (diff)
downloadcalp-4c72550f0f0a4a71c7381493738233c64ff04091.tar.gz
calp-4c72550f0f0a4a71c7381493738233c64ff04091.tar.xz
Clean up in config.
-rw-r--r--module/config.scm14
1 files changed, 12 insertions, 2 deletions
diff --git a/module/config.scm b/module/config.scm
index 6a7358e4..d62b05db 100644
--- a/module/config.scm
+++ b/module/config.scm
@@ -10,10 +10,20 @@
(ice-9 regex)
(ice-9 rdelim))
+(define (p str)
+ "Pathify string."
+ (regexp-substitute/global
+ #f "~[^/]*" str
+ 'pre (lambda (_) (getenv "HOME")) 'post))
+
+(define (filename-hidden? str)
+ (char=? #\. (string-ref str 0)))
+
(calendar-files
- (let ((path (string-append (getenv "HOME") "/.calendars/")))
+ (let ((path #; "/mnt/arch/home/hugo/.calendars/"
+ (p "~/.calendars/")))
(map (cut string-append path <>)
- (scandir path (lambda (str) (not (char=? #\. (string-ref str 0))))))))
+ (scandir path (negate filename-hidden?)))))
;;; TODO possibly replace with propper lookup
(define my-courses