aboutsummaryrefslogtreecommitdiff
path: root/config.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-12-28 02:32:38 +0100
committerHugo Hörnquist <hugo@hornquist.se>2019-12-28 02:32:38 +0100
commite9c12af512349cb95a0018e25a9cc54e78b468a4 (patch)
tree7bdfc3a05d673e220c5a3a49ebfbe7d4ebb6dba6 /config.scm
parentBroke out vevent->sxml into generalized function. (diff)
downloadcalp-e9c12af512349cb95a0018e25a9cc54e78b468a4.tar.gz
calp-e9c12af512349cb95a0018e25a9cc54e78b468a4.tar.xz
Move config from module to config directory.
Diffstat (limited to 'config.scm')
-rw-r--r--config.scm30
1 files changed, 30 insertions, 0 deletions
diff --git a/config.scm b/config.scm
new file mode 100644
index 00000000..f30263fd
--- /dev/null
+++ b/config.scm
@@ -0,0 +1,30 @@
+;;; Preliminary config file for the system.
+;;; Currently loaded by main, and requires that `calendar-files`
+;;; is set to a list of files (or directories).
+
+(use-modules (srfi srfi-26)
+ (srfi srfi-88)
+ (ice-9 regex)
+ (ice-9 rdelim)
+ (glob))
+
+(calendar-files (glob "~/.local/var/cal/*"))
+
+;;; TODO possibly replace with propper lookup
+(define my-courses
+ '((TSEA82 . "Datorteknik")
+ (TFYA19 . "Kvantdatorer")
+ (TATA42 . "Tvåvarren")
+ (TSRT04 . "Matlab")
+ (TDDC78 . "Paralellprogrammering")
+ (TDDB68 . "Pintos")))
+
+(define* (aref alist key optional: default)
+ (or (assoc-ref alist key) default key))
+
+(summary-filter
+ (lambda (ev str)
+ (regexp-substitute/global
+ #f "T[A-Z]{3}[0-9]{2}" str
+ 'pre (lambda (m) (aref my-courses (string->symbol (match:substring m))))
+ 'post)))