diff --git a/undone/main.scm b/undone/main.scm index dca8257..5bc0fb6 100644 --- a/undone/main.scm +++ b/undone/main.scm @@ -20,6 +20,16 @@ (define todo-list-file "todo.scm") +(define rc-file + (let* ((xdg (getenv "XDG_CONFIG_HOME")) + (home (getenv "HOME")) + (rc-file-name "undonerc.scm") + (xdg-rc-file (string-append xdg "/" rc-file-name)) + (home-rc-file (string-append home "/" rc-file-name))) + (if (and xdg (file-exists? xdg-rc-file)) + xdg-rc-file + home-rc-file))) + (define todo-list (if (file-exists? todo-list-file) (let* ((port (open-input-file todo-list-file)) @@ -86,7 +96,7 @@ (apply view-func '())))) (define (main args) - (load "/home/slash/undonerc.scm") + (load rc-file) (if (> (length args) 1) (case (string->symbol (cadr args)) ((add)