ignore commented lines when parsing sway config

This commit is contained in:
Alex Janka 2024-10-18 09:07:31 +11:00
parent f0c7df3167
commit b43c6c9c56
3 changed files with 3 additions and 3 deletions

2
Cargo.lock generated
View file

@ -1154,7 +1154,7 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]] [[package]]
name = "sway-flash-indicator" name = "sway-flash-indicator"
version = "0.7.0" version = "0.7.1"
dependencies = [ dependencies = [
"clap", "clap",
"directories", "directories",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "sway-flash-indicator" name = "sway-flash-indicator"
version = "0.7.0" version = "0.7.1"
edition = "2021" edition = "2021"
[dependencies] [dependencies]

View file

@ -356,7 +356,7 @@ async fn get_sway_config(connection: &mut swayipc_async::Connection) -> Res<()>
let default_colours = config let default_colours = config
.config .config
.split('\n') .split('\n')
.find(|v| v.contains("client.focused")) .find(|v| v.contains("client.focused") && !v.starts_with('#'))
.ok_or(Error::NoMatchingConfig)? .ok_or(Error::NoMatchingConfig)?
.trim(); .trim();