Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/krish-r/caps2esc
Remap `CAPS LOCK` to `ESC` in Linux systems.
https://github.com/krish-r/caps2esc
zig
Last synced: 26 days ago
JSON representation
Remap `CAPS LOCK` to `ESC` in Linux systems.
- Host: GitHub
- URL: https://github.com/krish-r/caps2esc
- Owner: krish-r
- License: mit
- Created: 2024-10-23T17:16:33.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-11-03T06:21:34.000Z (2 months ago)
- Last Synced: 2024-11-11T08:23:59.246Z (2 months ago)
- Topics: zig
- Language: Zig
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# caps2esc
Remap `CAPS LOCK` to `ESC` in Linux systems.
## Overview
This is inspired by / based on [evremap][evremap] by [wez][wez].
Uses [`libevdev`][libevdev] to grab exclusive access to the input device, reads input events, remaps `CAPS LOCK` to `ESC` and writes them back to a virtual output device.
## Example Usage
### List devices
```shell
sudo zig-out/bin/caps2esc --list-devices
```### Remap key
```shell
sudo zig-out/bin/caps2esc --device 'device-name'
```## Building from Source
### Dependencies
- `libevdev` development package (Fedora: `sudo dnf install libevdev-devel` | Debian/Ubuntu: `sudo apt install libevdev-dev`)
- [Zig master](https://ziglang.org/download/)```shell
zig build -Doptimize=ReleaseSafe
```## Adding service to `systemd`
**Note**: Update the path and device name in the example service file (`caps2esc.service`) and the below command.
```shell
sudo cp ~/example-path/caps2esc/caps2esc.service /usr/lib/systemd/system/
sudo systemctl enable caps2esc.service
sudo systemctl start caps2esc.service
systemctl status caps2esc.service
```## Credits
- [evremap][evremap] by [@wez][wez]
- [Performance Optimizer Observation Platform][performance-optimizer-observation-platform] by [@andrewrk][andrew-kelley].[wez]: https://github.com/wez/
[evremap]: https://github.com/wez/evremap/
[andrew-kelley]: https://github.com/andrewrk/
[performance-optimizer-observation-platform]: https://github.com/andrewrk/poop/
[libevdev]: https://www.freedesktop.org/wiki/Software/libevdev/