1
0
Fork 0
forked from wry/wry

Make Super_L chordable and implement hyprland-global-shortcuts-v1

This commit is contained in:
entailz 2026-04-30 23:21:35 -07:00
parent 8ff17aca1e
commit 6d3bff952e
16 changed files with 363 additions and 16 deletions

View file

@ -868,6 +868,10 @@ impl ConfigClient {
self.send(&ClientMessage::Quit)
}
pub fn trigger_global_shortcut(&self, app_id: &str, id: &str) {
self.send(&ClientMessage::TriggerGlobalShortcut { app_id, id })
}
pub fn switch_to_vt(&self, vtnr: u32) {
self.send(&ClientMessage::SwitchTo { vtnr })
}

View file

@ -912,6 +912,10 @@ pub enum ClientMessage<'a> {
seat: Seat,
right: bool,
},
TriggerGlobalShortcut {
app_id: &'a str,
id: &'a str,
},
}
#[derive(Serialize, Deserialize, Debug)]

View file

@ -108,6 +108,14 @@ pub fn quit() {
get!().quit()
}
/// Sends a `pressed` event to the client that has registered a Hyprland global
/// shortcut with the given `app_id` and `id`.
///
/// Has no effect if no client is currently registered for that combination.
pub fn trigger_global_shortcut(app_id: &str, id: &str) {
get!().trigger_global_shortcut(app_id, id)
}
/// Switches to a different VT.
pub fn switch_to_vt(n: u32) {
get!().switch_to_vt(n)