aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 42656f80..6680e11b 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -100,6 +100,11 @@ fn main() {
if is_systemd_service {
// We're starting as a systemd service. Export our variables.
import_env_to_systemd();
+
+ // Inhibit power key handling so we can suspend on it.
+ if let Err(err) = state.niri.inhibit_power_key() {
+ warn!("error inhibiting power key: {err:?}");
+ }
}
state.niri.start_dbus(&state.backend, is_systemd_service);