Update readme

main
Tait Hoyem 2 years ago
parent 32beeb44a3
commit 2f7ba17fbf

@ -1,58 +0,0 @@
DAEMON_BINARY := sohkd
SERVER_BINARY := sohks
CONTROL_BINARY := sohkctl
MODE_CHANGE_BINARY := sohkmc
BUILDFLAGS := --release
UDEV_DIR := /etc/udev/rules.d/
UDEV_RULE := sohkd.rules
TARGET_DIR := /usr/bin
all: build
build:
@cargo build $(BUILDFLAGS) --target=x86_64-unknown-linux-musl
@cp ./target/x86_64-unknown-linux-musl/release/$(DAEMON_BINARY) ./bin/$(DAEMON_BINARY)
@cp ./target/x86_64-unknown-linux-musl/release/$(SERVER_BINARY) ./bin/$(SERVER_BINARY)
glibc:
@cargo build $(BUILDFLAGS)
@cp ./target/release/$(DAEMON_BINARY) ./bin/$(DAEMON_BINARY)
@cp ./target/release/$(SERVER_BINARY) ./bin/$(SERVER_BINARY)
@cp ./target/release/$(CONTROL_BINARY) ./bin/$(CONTROL_BINARY)
install:
@mkdir -p $(TARGET_DIR)
@mkdir -p $(UDEV_DIR)
@mkdir -p /etc/$(DAEMON_BINARY)
@touch /etc/$(DAEMON_BINARY)/$(DAEMON_BINARY)rc
@cp ./bin/$(DAEMON_BINARY) $(TARGET_DIR)
@cp ./bin/$(SERVER_BINARY) $(TARGET_DIR)
@cp ./bin/$(CONTROL_BINARY) $(TARGET_DIR)
@cp ./bin/$(CHANGE_MODE_BINARY) $(TARGET_DIR)
@cp ./$(UDEV_RULE) $(UDEV_DIR)/$(UDEV_RULE)
@chmod +x $(TARGET_DIR)/$(DAEMON_BINARY)
@chmod +x $(TARGET_DIR)/$(SERVER_BINARY)
@chmod +x $(TARGET_DIR)/$(CONTROL_BINARY)
@chmod +x $(TARGET_DIR)/$(CHANGE_MODE_BINARY)
uninstall:
@rm $(TARGET_DIR)/$(SERVER_BINARY)
@rm $(TARGET_DIR)/$(DAEMON_BINARY)
@rm $(TARGET_DIR)/$(CONTROL_BINARY)
@rm $(TARGET_DIR)/$(CHANGE_MODE_BINARY)
@rm $(UDEV_DIR)/$(UDEV_RULE)
check:
@cargo fmt
@cargo check --target=x86_64-unknown-linux-musl
clean:
@cargo clean
setup:
@mkdir -p ./bin
@rustup install stable
@rustup default stable
@rustup target add x86_64-unknown-linux-musl
.PHONY: check clean setup all install build glibc

@ -1,48 +1,78 @@
# SOHKD
<p align=center>
<img src="https://git.sr.ht/~shinyzenith/swhkd/blob/main/assets/swhkd.png" alt=SWHKD width=60%>
**S**imple **O**dilia **H**ot**K**ey **D**aemon
<p align=center>A next-generation hotkey daemon for Wayland/X11 written in Rust.</p>
*A next-generation hotkey daemon for Wayland/X11 written in Rust.*
<p align="center">
<a href="./LICENSE.md"><img src="https://img.shields.io/github/license/waycrate/swhkd?style=flat-square&logo=appveyor"></a>
<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/swhkd?style=flat-square&logo=appveyor">
<img src="https://img.shields.io/github/forks/waycrate/swhkd?style=flat-square&logo=appveyor">
<img src="https://img.shields.io/github/stars/waycrate/swhkd?style=flat-square&logo=appveyor">
</p>
</p>
sohkd is a display protocol-independent hotkey daemon made in Rust (based off the original, [swhkd](https://waycrate.github.io/swhkd/)). sohkd uses an easy-to-use configuration system inspired by swhkd so you can easily add or remove hotkeys, and it integrates with the [Odilia screen reader](https://odilia.app) to provide modal access to key bindings.
## SWHKD:
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.
**S**imple **W**ayland **H**ot**K**ey **D**aemon
**Note: The project is a WIP.**
swhkd is a display protocol-independent hotkey daemon made in Rust. swhkd uses an easy-to-use configuration system inspired by sxhkd so you can easily add or remove hotkeys.
**BUT!! It does work right now [Example config file](./docs/sohkdrc).**
It also attempts to be a drop-in replacement for sxhkd, meaning your sxhkd config file is also compatible with swhkd.
## Installation
Because swhkd can be used anywhere, the same swhkd config can be used across Xorg or Wayland desktops, and you can even use swhkd in a tty.
See [INSTALL.md](./docs/INSTALL.md) for installing sohkd.
## Installation and Building:
[Installation and building instructions can be found here.](./INSTALL.md)
## Running:
```bash
sohks &
sohkd
```
To refresh the config at runtime, make a script like so:
```bash
#!/bin/sh
killall sohkd
sohkd
swhks &
pkexec swhkd
```
Mark it as executable using `chmod +x <path_to_refresh_script>`.
## Runtime signals:
Then call it using `setsid -f <path_to_refresh_script>`.
After opening swhkd, you can control the program through signals:
A better implementation using signals will be developed later.
- `sudo pkill -USR1 swhkd` - Pause key checking
- `sudo pkill -USR2 swhkd` - Resume key checking
- `sudo pkill -HUP swhkd` - Reload config file
## Contributors:
## Configuration:
Swhkd closely follows sxhkd syntax, so most existing sxhkd configs should be functional with swhkd.
The default configuration file is in `/etc/swhkd/swhkdrc`. If you don't like having to edit the file as root every single time, you can create a symlink from `~/.config/swhkd/swhkdrc` to `/etc/swhkd/swhkdrc`.
If you use Vim, you can get swhkd config syntax highlighting with the
[swhkd-vim](https://github.com/waycrate/swhkd-vim) plugin. Install it in
vim-plug with `Plug 'waycrate/swhkd-vim'`.
All supported key and modifier names are listed in `man 5 swhkd-keys`.
Original developers:
## Autostart:
* Shinyzenith `<aakashsensharma@gmail.com>`
* Angelo Fallaria `<ba.fallaria@gmail.com>`
* EdenQwQ `<lsahlm1eden@gmail.com>`
### To autostart swhkd you can do one of two things:
Adapters:
1. Add the commands from the ["Running" section](https://github.com/waycrate/swhkd#running) to your window managers configuration file.
1. Enable the [service file](https://github.com/waycrate/swhkd/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.
## Security:
We use a server-client model to keep you safe. The daemon ( swhkd - 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 ).
So yes, you're safe!
## Support:
1. https://matrix.to/#/#waycrate-tools:matrix.org
1. https://discord.gg/KKZRDYrRYW
## Contributors:
* Tait Hoyem `<tait@tait.tech>`
<a href="https://github.com/Shinyzenith/swhkd/graphs/contributors">
<img src="https://contrib.rocks/image?repo=waycrate/swhkd" />
</a>

Loading…
Cancel
Save