Skip to content

Commit

Permalink
refactor: Return hyprland::Result<()> from thread
Browse files Browse the repository at this point in the history
  • Loading branch information
donovanglover committed Aug 2, 2023
1 parent d6fd9fc commit d405822
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,16 @@ fn main() -> hyprland::Result<()> {
});
});

thread::spawn(move || {
thread::spawn(move || -> hyprland::Result<()> {
let (tx, rx) = mpsc::channel();

ctrlc::set_handler(move || tx.send(()).expect("Could not send signal on channel."))
.expect("Error setting Ctrl-C handler");

rx.recv().expect("Could not receive from channel.");

let _ = Keyword::set("decoration:dim_strength", dim_strength);
let _ = Keyword::set("decoration:dim_inactive", dim_inactive);
Keyword::set("decoration:dim_strength", dim_strength)?;
Keyword::set("decoration:dim_inactive", dim_inactive)?;

process::exit(0);
});
Expand Down

0 comments on commit d405822

Please sign in to comment.