aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/input.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/input.rs b/src/input.rs
index ca08c379..4fcfa98c 100644
--- a/src/input.rs
+++ b/src/input.rs
@@ -1,3 +1,5 @@
+use std::process::Command;
+
use smithay::backend::input::{
AbsolutePositionEvent, Axis, AxisSource, ButtonState, Event, InputBackend, InputEvent,
KeyState, KeyboardKeyEvent, PointerAxisEvent, PointerButtonEvent, PointerMotionEvent,
@@ -12,6 +14,7 @@ use crate::niri::Niri;
enum InputAction {
Quit,
ChangeVt(i32),
+ SpawnTerminal,
}
impl Niri {
@@ -45,6 +48,9 @@ impl Niri {
let vt = (keysym - keysyms::KEY_XF86Switch_VT_1 + 1) as i32;
FilterResult::Intercept(InputAction::ChangeVt(vt))
}
+ keysyms::KEY_t if mods.logo => {
+ FilterResult::Intercept(InputAction::SpawnTerminal)
+ }
_ => FilterResult::Forward,
}
} else {
@@ -62,6 +68,11 @@ impl Niri {
InputAction::ChangeVt(vt) => {
(*change_vt)(vt);
}
+ InputAction::SpawnTerminal => {
+ if let Err(err) = Command::new("alacritty").spawn() {
+ warn!("error spawning alacritty: {err}");
+ }
+ }
}
}
}