diff options
author | Tom Willemsen | 2012-08-14 21:23:46 +0200 |
---|---|---|
committer | Tom Willemsen | 2012-08-14 21:23:46 +0200 |
commit | 7376a87f72a17aaa2a07a6a211645b68b2b3a6ca (patch) | |
tree | a90439e203800fa92010037dec2b6a9df5a9f500 | |
parent | a90567ae22bc1f1ac0d396096fd725179b6db9b1 (diff) | |
download | undone-7376a87f72a17aaa2a07a6a211645b68b2b3a6ca.tar.gz undone-7376a87f72a17aaa2a07a6a211645b68b2b3a6ca.zip |
Load rc from appropriate location
-rw-r--r-- | undone/main.scm | 12 |
1 files changed, 11 insertions, 1 deletions
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) |