diff --git a/Cargo.toml b/Cargo.toml index 2e1ecc3..5344e2e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "raventhemer" -version = "1.2.0" +version = "1.3.0" authors = ["nicohman "] repository="https://github.com/nicohman/raven" description="A theme manager and switcher for desktop linux" diff --git a/README.md b/README.md index b5c45a9..aed945b 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/src/bin/raven.rs b/src/bin/raven.rs index 8e987b8..ff5327f 100644 --- a/src/bin/raven.rs +++ b/src/bin/raven.rs @@ -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(), @@ -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() { @@ -263,7 +267,7 @@ fn print_info(editing: String) { .expect("Couldn't read themes") .collect::>>() .into_iter() - .map(|x| proc_path(x.unwrap())) + .map(|x| proc_path(x.unwrap())).filter(|x| x != "theme.json") .collect::>(); println!("Current configured options for {}", editing); for option in options { @@ -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, @@ -544,7 +548,7 @@ fn convert_theme(theme_name: &str) { .filter(|x| x.len() > 0) .filter(|x| x != "|") .collect::>(); - let mut themes = ThemeStore { + let themes = ThemeStore { name: theme_name.to_string(), enabled: Vec::new(), options: options,