You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
3.4 KiB

2 years ago
<p align=center>
<img src="https://git.sr.ht/~shinyzenith/sohkd/blob/main/assets/sohkd.png" alt=SWHKD width=60%>
2 years ago
<p align=center>A next-generation hotkey daemon for Wayland/X11 written in Rust.</p>
2 years ago
<p align="center">
<a href="./LICENSE.md"><img src="https://img.shields.io/github/license/waycrate/sohkd?style=flat-square&logo=appveyor"></a>
2 years ago
<img src="https://img.shields.io/badge/cargo-v1.2.1-green?style=flat-square&logo=appveyor">
<img src="https://img.shields.io/github/issues/waycrate/sohkd?style=flat-square&logo=appveyor">
<img src="https://img.shields.io/github/forks/waycrate/sohkd?style=flat-square&logo=appveyor">
<img src="https://img.shields.io/github/stars/waycrate/sohkd?style=flat-square&logo=appveyor">
2 years ago
</p>
</p>
2 years ago
## SOHKD:
**S**imple **O**dilia **H**ot**K**ey **D**aemon
sohkd is a display protocol-independent hotkey daemon made in Rust. sohkd uses an easy-to-use configuration system inspired by sxhkd so you can easily add or remove hotkeys.
2 years ago
It also attempts to be a drop-in replacement for swhkd, meaning your sxhkd config file is also compatible with sohkd.
Because sohkd can be used anywhere, the same sohkd config can be used across Xorg or Wayland desktops, and you can even use sohkd in a tty.
2 years ago
## Installation and Building:
[Installation and building instructions can be found here.](./INSTALL.md)
## Running:
2 years ago
```bash
2 years ago
swhks &
pkexec sohkd
2 years ago
```
2 years ago
## Runtime signals:
After opening sohkd, you can control the program through signals:
2 years ago
- `sudo pkill -USR1 sohkd` - Pause key checking
- `sudo pkill -USR2 sohkd` - Resume key checking
- `sudo pkill -HUP sohkd` - Reload config file
2 years ago
## Configuration:
Swhkd closely follows sxhkd syntax, so most existing sxhkd configs should be functional with sohkd.
2 years ago
The default configuration file is in `/etc/sohkd/sohkdrc`. If you don't like having to edit the file as root every single time, you can create a symlink from `~/.config/sohkd/sohkdrc` to `/etc/sohkd/sohkdrc`.
2 years ago
If you use Vim, you can get sohkd config syntax highlighting with the
[sohkd-vim](https://github.com/waycrate/sohkd-vim) plugin. Install it in
vim-plug with `Plug 'waycrate/sohkd-vim'`.
2 years ago
All supported key and modifier names are listed in `man 5 sohkd-keys`.
2 years ago
2 years ago
## Autostart:
### To autostart sohkd you can do one of two things:
1. Add the commands from the ["Running" section](https://github.com/waycrate/sohkd#running) to your window managers configuration file.
1. Enable the [service file](https://github.com/waycrate/sohkd/tree/main/contrib/init) for your respective init system. Currently only systemd and OpenRC service files exist and more will be added soon including Runit.
2 years ago
## Security:
We use a server-client model to keep you safe. The daemon ( sohkd - privileged process ) communicates to the server ( swhks - running as non root user ) after checking for valid keybinds. 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 ).
2 years ago
So yes, you're safe!
## Contributors:
<a href="https://github.com/Shinyzenith/sohkd/graphs/contributors">
2 years ago
<img src="https://contrib.rocks/image?repo=waycrate/swhkd" />
</a>