Skip to content

Commit 637cd9e

Browse files
committed
Use system_actions for suspend
1 parent 7899fcc commit 637cd9e

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

Cargo.lock

Lines changed: 16 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ wayland-protocols = { version = "0.32.3", features = ["client", "staging"] }
1010
wayland-protocols-wlr = { version = "0.3.3", features = ["client"] }
1111
cosmic-config = { git = "https://github.com/pop-os/libcosmic", features = ["calloop"] }
1212
cosmic-idle-config = { path = "./cosmic-idle-config" }
13-
cosmic-settings-config = { git = "https://github.com/pop-os/cosmic-settings-daemon" }
13+
cosmic-settings-config = { git = "https://github.com/pop-os/cosmic-settings-daemon", branch = "suspend" }
1414
calloop = { version = "0.14.0", features = ["executor"] }
1515
calloop-wayland-source = "0.4.0"
1616
log = "0.4.22"

src/main.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,11 @@ impl State {
181181

182182
fn update_suspend_idle(&mut self, is_idle: bool) {
183183
if is_idle {
184-
// TODO: Make command configurable
185-
run_command("systemctl suspend".to_string());
184+
let command = self
185+
.system_actions
186+
.get(&shortcuts::action::System::Suspend)
187+
.map_or("systemctl suspend", |s| s.as_str());
188+
crate::run_command(command.to_string());
186189
}
187190
}
188191

0 commit comments

Comments
 (0)