diff --git a/.env.dist b/.env.dist new file mode 100644 index 0000000..243b66a --- /dev/null +++ b/.env.dist @@ -0,0 +1,3 @@ +TODO_DIR=example +TODO_FILE=example/todo.txt +DONE_FILE=example/done.txt diff --git a/.gitignore b/.gitignore index cd6768f..a983a99 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +/.env +/example/*.bak /Cargo.lock /target/ **/*.rs.bk diff --git a/Cargo.toml b/Cargo.toml index 03f9db6..22498c9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,7 @@ edition = "2018" [dependencies] cairo-rs = "^0.8" chrono = "^0.4" +dotenv = "0.15" dirs-sys = "^0.3" gdk = "^0.12" gdk-sys = "^0.9" diff --git a/example/done.txt b/example/done.txt new file mode 100644 index 0000000..43eeb42 --- /dev/null +++ b/example/done.txt @@ -0,0 +1 @@ +x 2016-02-21 (B) Seal ship's cracks with biomatter +Galactica\Repairs diff --git a/example/todo.txt b/example/todo.txt new file mode 100644 index 0000000..f3dd12a --- /dev/null +++ b/example/todo.txt @@ -0,0 +1,9 @@ +(A) Make peace between Cylons and humans +PeaceProject +(B) Report to Admiral Adama about FTL @CIC +Galactica\Repairs due:2013-05-24 +2016-12-08 Feed Schrodinger's Cat due:2014-02-23 +(C) Upgrade jump drives with Cylon technology +Galactica\Repairs +2016-12-12 +Galactica\Repairs Check hull integrity due:2016-12-12 +Check for DRADIS contact @CIC +Check if http://google.com is available +Download code from
https://github.com/QTodoTxt/QTodoTxt/archive/master.zip
and give it a try! +Think about future t:2099-12-31 diff --git a/src/main.rs b/src/main.rs index 2e974f3..350107f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,6 +17,10 @@ mod widgets; fn main() { human_panic::setup_panic!(); + #[cfg(debug_assertions)] + dotenv::dotenv() + .ok(); + if std::env::args().nth(1) == Some("usage".to_string()) { usage(&std::env::args().nth(0).unwrap());