Skip to content

Latest commit

 

History

History
95 lines (67 loc) · 3.54 KB

README.md

File metadata and controls

95 lines (67 loc) · 3.54 KB

swhkdp

A next-generation hotkey daemon for Wayland/X11 written in Rust.

swhkdp

Simple Wayland HotKey Daemon Polkit

Originally forked from swhkd, deattached from the original repo due to the desire to keep the Polkit security model and improve repo discoverability.

swhkdp is a display protocol-independent hotkey daemon made in Rust. swhkdp uses an easy-to-use configuration system inspired by sxhkd, so you can easily add or remove hotkeys.

Because swhkdp can be used anywhere, the same swhkdp config can be used across Xorg or Wayland desktops, and you can even use swhkdp in a TTY.

Installation and Building

Installation and building instructions can be found here.

Running

swhks &
pkexec swhkdp

Runtime signals

After opening swhkdp, you can control the program through signals:

  • sudo pkill -USR1 swhkdp — Pause key checking
  • sudo pkill -USR2 swhkdp — Resume key checking
  • sudo pkill -HUP swhkdp — Reload config file

Configuration

swhkdp uses configuration files that follows yml or json syntax, detailed instructions can be found in CONFIGURATION.md

The default configuration file is in /etc/swhkdp/swhkdp.yml. If you don't like having to edit the file as root every single time, you can create a symlink from ~/.config/swhkdp/swhkdp.yml to /etc/swhkdp/swhkdp.yml.

Not sure what key to use, launch swhkdp with -d option and press needed key, it will be shown in logs as DEBUG swhkdp] Key: KEY_C

Autostart

To autostart swhkdp you can do one of two things

  1. Add the commands from the "Running" section to your window managers configuration file.
  2. Enable the service file for your respective init system. Currently, only systemd and OpenRC service files exist and more will be added soon including Runit.

Security

We use a server-client model to keep you safe. The daemon (swhkdp — privileged process) communicates to the server (swhks — running as non-root user) after checking for valid keybindings. Since the daemon is totally separate from the server, no other process can read your keystrokes. As for shell commands, you might be thinking that any program can send shell commands to the server and that's true! But the server runs the commands as the currently logged-in user, so no extra permissions are provided (This is essentially the same as any app on your desktop calling shell commands).

So yes, you're safe!

Contributors

Thanks to original authors

  • Shinyzenith
  • Angelo Fallaria
  • EdenQwQ