diff --git a/.gitignore b/.gitignore index 28f615d..e5a7404 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ target *.out com.github.swhkd.pkexec.policy *rc +.direnv diff --git a/CHANGELOG.md b/CHANGELOG.md index fec1fcd..7c11209 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,14 +18,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Detection of added/removed devices (e.g., when plugging or unplugging a keyboard). The devices are grabbed by `swhkd` if they match the `--device` parameters if present or if they are recognized as keyboard devices otherwise. +- `Altgr` modifier added (https://github.com/waycrate/swhkd/pull/213). ### Changed - The project `Makefile` now builds the polkit policy file dynamically depending on the target installation directories. +- Alt modifier no longer maps to the right aly key. It only maps to the left alt key. Right alt is referred to as Altgr (alt graph). +- Tokio version bumped from 1.23.0 to 1.24.2 (https://github.com/waycrate/swhkd/pull/198). ### Fixed - Mouse cursors and other devices are no longer blocked when running `swhkd`. - Option prefixes on modifiers are now properly parsed. e.g., `~control` is now understood by `swhkd` as the `control` modifier with an option +- Install mandocs in the correct locations. diff --git a/Cargo.lock b/Cargo.lock index cfd9419..530bec7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -637,9 +637,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.23.0" +version = "1.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eab6d665857cc6ca78d6e80303a02cea7a7851e85dfbd77cbdc09bd129f1ef46" +checksum = "597a12a59981d9e3c38d216785b0c37399f6e415e8d0712047620f189371b0bb" dependencies = [ "autocfg", "bytes", diff --git a/Makefile b/Makefile index 538071d..b1227ad 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ install: @find ./docs -type f -iname "*.1.gz" \ -exec install -Dm 644 {} -t $(DESTDIR)/$(MAN1_DIR) \; @find ./docs -type f -iname "*.5.gz" \ - -exec install -Dm 644 {} -t $(DESTDIR)/$(MAN1_DIR) \; + -exec install -Dm 644 {} -t $(DESTDIR)/$(MAN5_DIR) \; @install -Dm 755 ./target/release/$(DAEMON_BINARY) -t $(DESTDIR)/$(TARGET_DIR) @install -Dm 755 ./target/release/$(SERVER_BINARY) -t $(DESTDIR)/$(TARGET_DIR) @install -Dm 644 -o root ./$(POLKIT_POLICY_FILE) -t $(DESTDIR)/$(POLKIT_DIR) diff --git a/README.md b/README.md index 28cb18e..834b35c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@
-
A next-generation hotkey daemon for Wayland/X11 written in Rust.
+A next-generation hotkey daemon for Wayland/X11 written in Rust.
-## SWHKD: +## SWHKD **S**imple **W**ayland **H**ot**K**ey **D**aemon -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. +`swhkd` is a display protocol-independent hotkey daemon made in +[Rust](https://www.rust-lang.org). `swhkd` uses an easy-to-use configuration +system inspired by `sxhkd`, so you can easily add or remove hotkeys. -It also attempts to be a drop-in replacement for sxhkd, meaning your sxhkd config file is also compatible with swhkd. +It also attempts to be a drop-in replacement for `sxhkd`, meaning your `sxhkd` +config file is also compatible with `swhkd`. -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. +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. -## Installation and Building: +## Installation and Building [Installation and building instructions can be found here.](./INSTALL.md) -## Running: +## Running ```bash swhks & pkexec swhkd ``` -## Runtime signals: +## Runtime signals -After opening swhkd, you can control the program through signals: +After opening `swhkd`, you can control the program through signals: -- `sudo pkill -USR1 swhkd` - Pause key checking -- `sudo pkill -USR2 swhkd` - Resume key checking -- `sudo pkill -HUP swhkd` - Reload config file +- `sudo pkill -USR1 swhkd` — Pause key checking +- `sudo pkill -USR2 swhkd` — Resume key checking +- `sudo pkill -HUP swhkd` — Reload config file -## Configuration: +## Configuration -Swhkd closely follows sxhkd syntax, so most existing sxhkd configs should be functional with swhkd. +`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`. +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 +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`. -## Autostart: +## Autostart -### To autostart swhkd you can do one of two things: +### To autostart `swhkd` you can do one of two things -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. +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: +## 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 ). +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 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! -## Support: +## Support 1. https://matrix.to/#/#waycrate-tools:matrix.org 1. https://discord.gg/KKZRDYrRYW -## Contributors: +## Contributors