Expand description
shortcutd is a daemon and client library to allow listening for global shortcuts for systems that don’t support it otherwise (such as wayland).
The shortcutd daemon hooks into the evdev system and exposes a dbus interface for clients to hook into to. By separating out the code that hooks into evdev (which needs to be done as root) into a separate daemon it allows non-privileged users to hook into global shortcuts.
Protection against clients using the shortcutd daemon for a keylogger is done by only allowing 3 shortcuts without modifiers to be registered at the same time.
See the README for instruction to running the shortcut daemon.
Example:
let client = ShortcutClient::new().await?;
let shortcut: Shortcut = "<Ctrl><Alt>-KeyO".parse()?;
let stream = client.listen(shortcut).await?;
pin_mut!(stream);
while let Some(event) = stream.next().await {
println!("{} {}", event.shortcut, event.state);
}
Structs
- Set of modifier keys for shortcuts
- A keyboard shortcut consisting of zero or more modifier keys and a non-modifier key
- Event emitted when a shortcut is pressed or released.
Enums
- evdev keycode
- Modifier key for shortcuts
- Whether the shortcut was pressed or released