Skip to content

Commit

Permalink
Add a few more options, fix a few bugs and clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
nicohman committed Jul 28, 2018
1 parent 7329018 commit bd9a349
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "raventhemer"
version = "1.2.0"
version = "1.3.0"
authors = ["nicohman <[email protected]>"]
repository="https://github.com/nicohman/raven"
description="A theme manager and switcher for desktop linux"
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ To configure a theme, start off by creating it with `raven new [theme]`. You'll
+ ranger(rc.conf)
+ lemonbar(A shell script that should spawn your lemonbar)
+ ncmpcpp(ncmpcpp config file)
+ Openbox(rc.xml)
+ Pywal(an image file that will be used as the pywal base)
+ openbox(rc.xml)
+ script: An arbitrary executable file that will be run when this theme is loaded
+ pywal(an image file that will be used as the pywal base)

If you place an i3 config named base\_i3 in ~/.config/raven, the contents of i3 for a theme will be appended to it instead of being run on their own. This allows you to have a central config for keyboard shortcuts, and have cosmetics only be stored in the theme. This also applies for a file named base\_rc.xml, for openbox.

Expand Down
10 changes: 7 additions & 3 deletions src/bin/raven.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ impl Theme {
"wall" => self.load_wall(),
"ncmpcpp" => self.load_ncm(),
"termite" => self.load_termite(),
"script" => self.load_script(),
"ranger" => self.load_ranger(),
"lemonbar" => self.load_lemon(),
"openbox" => self.load_openbox(),
Expand All @@ -77,6 +78,9 @@ impl Theme {
let arg = get_home()+"/.config/raven/themes/"+&self.name+"/pywal";
Command::new("wal").arg("-n").arg("-i").arg(arg).output().expect("Couldn't run pywal");
}
fn load_script(&self){
Command::new(get_home()+"/.config/raven/themes/"+&self.name+"/script").output().expect("Couldn't run custom script");
}
fn load_openbox(&self) {
let mut base = String::new();
if fs::metadata(get_home() + "/.config/raven/base_rc.xml").is_ok() {
Expand Down Expand Up @@ -263,7 +267,7 @@ fn print_info(editing: String) {
.expect("Couldn't read themes")
.collect::<Vec<io::Result<DirEntry>>>()
.into_iter()
.map(|x| proc_path(x.unwrap()))
.map(|x| proc_path(x.unwrap())).filter(|x| x != "theme.json")
.collect::<Vec<String>>();
println!("Current configured options for {}", editing);
for option in options {
Expand Down Expand Up @@ -456,7 +460,7 @@ fn import(file_name: &str) {
}
fn add_to_theme(theme_name: &str, option: &str, path: &str) {
//Add an option to a theme
let mut cur_theme = load_theme(theme_name).unwrap();
let cur_theme = load_theme(theme_name).unwrap();
let mut new_themes = ThemeStore {
name:theme_name.to_string(),
options:cur_theme.options,
Expand Down Expand Up @@ -544,7 +548,7 @@ fn convert_theme(theme_name: &str) {
.filter(|x| x.len() > 0)
.filter(|x| x != "|")
.collect::<Vec<String>>();
let mut themes = ThemeStore {
let themes = ThemeStore {
name: theme_name.to_string(),
enabled: Vec::new(),
options: options,
Expand Down

0 comments on commit bd9a349

Please sign in to comment.