Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #18 from runabove/selector
Browse files Browse the repository at this point in the history
Selector
  • Loading branch information
d33d33 authored Feb 7, 2017
2 parents 44ecf26 + 36d2cb1 commit 27b2593
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "beamium"
version = "1.3.0"
version = "1.3.1"
authors = [ "d33d33 <[email protected]>" ]

build = "build.rs"
Expand Down
22 changes: 11 additions & 11 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,18 @@ pub fn load_config(config_path: &str) -> Result<Config, ConfigError> {
},
};

// Load from etc
if Path::new("/etc/beamium/config.yaml").exists() {
try!(load_path("/etc/beamium/config.yaml", &mut config));
}

// Load local
if Path::new("config.yaml").exists() {
try!(load_path("config.yaml", &mut config));
}
if config_path.is_empty() {
// Load from etc
if Path::new("/etc/beamium/config.yaml").exists() {
try!(load_path("/etc/beamium/config.yaml", &mut config));
}

// Load from provided path
if !config_path.is_empty() {
// Load local
if Path::new("config.yaml").exists() {
try!(load_path("config.yaml", &mut config));
}
} else {
// Load from provided path
try!(load_path(config_path, &mut config));
}

Expand Down
2 changes: 1 addition & 1 deletion src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ fn route(sinks: &Vec<config::Sink>,
for (i, sink) in sinks.iter().enumerate() {
if sink.selector.is_some() {
let selector = sink.selector.as_ref().unwrap();
if line.split_whitespace()
if !line.split_whitespace()
.nth(1)
.map_or(false, |class| selector.is_match(class)) {
continue;
Expand Down

0 comments on commit 27b2593

Please sign in to comment.