Skip to content

Commit

Permalink
Add a few templates
Browse files Browse the repository at this point in the history
  • Loading branch information
zakkor committed Aug 20, 2016
1 parent 2fad925 commit 019a399
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,24 @@
"init.el",
"~/.emacs.d/"
]
},
".xinitrc": {
"Arch": [
".xinitrc",
"~/"
]
},
"compton": {
"Arch": [
".compton.conf",
"~/"
]
},
"i3status": {
"Arch": [
".i3status.conf",
"~/"
]
}
},
"themes": {}
Expand Down
12 changes: 10 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,19 @@ fn main() {
for (key, val) in json_obj["themes"][&selected_theme].entries() {
let mut theme_path = ricem_dir.join(&selected_theme);
theme_path.push(val[0].as_str().unwrap());
println!("Applied '{:?}'.", theme_path);


let mut track_buf = JsonUtil::json_path_to_pathbuf(&val[0], &val[1]);

std::fs::copy(theme_path, track_buf).unwrap();

std::fs::copy(&theme_path, &track_buf).expect("Failed to copy a file due to permissions probably");
// // check if we have the required permissions...
// match std::fs::copy(&theme_path, &track_buf) {
// Ok(_) => println!("Applied '{:?}'.", theme_path),
// Err(_) => {
// exec_shell(&(String::from("sudo cp ") + &theme_path.to_str().unwrap() + &track_buf.to_str().unwrap()));
// }
// }
}
},
"delete" | "del" => {
Expand Down

0 comments on commit 019a399

Please sign in to comment.