|
|
|
@ -51,26 +51,37 @@ Then run:
|
|
|
|
|
sudo xremap config.yml
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Dynamic binding
|
|
|
|
|
<details>
|
|
|
|
|
<summary>If you want to run xremap without sudo, click here.</summary>
|
|
|
|
|
|
|
|
|
|
Xremap supports application-specific key remapping.
|
|
|
|
|
To do so, your normal user should be able to use `evdev` and `uinput` without sudo.
|
|
|
|
|
In Ubuntu, this can be configured by running the following commands and rebooting your machine.
|
|
|
|
|
|
|
|
|
|
While Xremap uses `evdev` and `uinput` for key remapping, which is a lower layer than X11 and Wayland,
|
|
|
|
|
Xremap also uses X11 or Wayland compositor-specific protocols to support `application` config.
|
|
|
|
|
If you use this feature, make sure you use the appropriate binary for your platform,
|
|
|
|
|
and follow one of the following options to make it work.
|
|
|
|
|
```bash
|
|
|
|
|
sudo gpasswd -a YOUR_USER input
|
|
|
|
|
echo 'KERNEL=="uinput", GROUP="input"' | sudo tee /etc/udev/rules.d/input.rules
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
<summary>Option 1: Allow root to talk to the compositor</summary>
|
|
|
|
|
In other platforms, you might need to create an `input` group first
|
|
|
|
|
and run `echo 'KERNEL=="event*", NAME="input/%k", MODE="660", GROUP="input"' | sudo tee /etc/udev/rules.d/input.rules` as well.
|
|
|
|
|
|
|
|
|
|
If you use `sudo xremap`, root user usually cannot interact with the compositor for your normal user.
|
|
|
|
|
You may need to allow it as follows:
|
|
|
|
|
If you do this, in some environments, `--watch` may fail to recognize new devices due to temporary permission issues.
|
|
|
|
|
Using `sudo` might be more useful in such cases.
|
|
|
|
|
|
|
|
|
|
#### X11
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
You may need to run `xhost +SI:localuser:root` if you see `No protocol specified`.
|
|
|
|
|
See the following instructions for your environment to make `application`-specific remapping work.
|
|
|
|
|
|
|
|
|
|
#### GNOME Wayland
|
|
|
|
|
### X11
|
|
|
|
|
|
|
|
|
|
If you use `sudo` to run `xremap`, you may need to run `xhost +SI:localuser:root` if you see `No protocol specified`.
|
|
|
|
|
|
|
|
|
|
### GNOME Wayland
|
|
|
|
|
|
|
|
|
|
Install [the GNOME Shell extension for xremap](https://github.com/xremap/xremap-gnome) first.
|
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
<summary>If you use <code>sudo</code> to run <code>xremap</code>, also click here.</summary>
|
|
|
|
|
|
|
|
|
|
Update `/usr/share/dbus-1/session.conf` as follows, and reboot your machine.
|
|
|
|
|
|
|
|
|
@ -84,26 +95,6 @@ Update `/usr/share/dbus-1/session.conf` as follows, and reboot your machine.
|
|
|
|
|
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
<summary>Option 2: Run xremap without sudo</summary>
|
|
|
|
|
|
|
|
|
|
Alternatively, you could run `xremap` without sudo to solve the problem.
|
|
|
|
|
To do so, your normal user should be able to use `evdev` and `uinput` without sudo.
|
|
|
|
|
In Ubuntu, this can be configured by running the following commands and rebooting your machine.
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
sudo gpasswd -a YOUR_USER input
|
|
|
|
|
echo 'KERNEL=="uinput", GROUP="input"' | sudo tee /etc/udev/rules.d/input.rules
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
In other platforms, you might need to create an `input` group first
|
|
|
|
|
and run `echo 'KERNEL=="event*", NAME="input/%k", MODE="660", GROUP="input"' | sudo tee /etc/udev/rules.d/input.rules` as well.
|
|
|
|
|
|
|
|
|
|
If you take this path, in some environments, `--watch` may fail to recognize new devices due to temporary permission issues.
|
|
|
|
|
Option 1 might be more useful in such cases.
|
|
|
|
|
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
Your `config.yml` should look like this:
|
|
|
|
|
|
|
|
|
|