https://github.com/selfmadesystem/system76-keyboard-rainbow
https://github.com/selfmadesystem/system76-keyboard-rainbow
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/selfmadesystem/system76-keyboard-rainbow
- Owner: SelfMadeSystem
- License: mit
- Created: 2023-09-18T22:22:06.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-09-24T01:20:20.000Z (over 2 years ago)
- Last Synced: 2025-01-15T01:45:58.171Z (over 1 year ago)
- Language: Rust
- Size: 12.7 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# System76 Rainbow Keyboard
This is a simple program to have a rainbow keyboard on System76 laptops. It
should work on any System76 laptop with a backlit keyboard. Please report any
issues you have with it.
Tested on a System76 Gazelle (gaze18) laptop running Pop!_OS 22.04.
The brightness should already be set to what it was before running the program
when it exits. It should also automatically adjust when you change the
brightness with the keyboard. If it doesn't, please report it as an issue.
# Video
Here's a video of me using it. It looks better in person. You also can't really see
the brightness change, but it's very evident when you're actually using it. Furthermore,
it does reset to how your brightness/color was before you started the program.
https://github.com/SelfMadeSystem/system76-keyboard-rainbow/assets/38010540/c8e86d27-06a2-4c01-b5da-530d85edc67c
## Installation
You must install `rust` and `cargo` to build this program. You can install them
with `apt`:
```bash
sudo apt install rustc cargo
```
Then you can build and install the program with:
```bash
cargo install --git https://github.com/SelfMadeSystem/system76-keyboard-rainbow
```
To run the program, you need to add `~/.cargo/bin` to your `PATH`:
If using `bash`:
```bash
export PATH="$PATH:$HOME/.cargo/bin"
```
If using `fish`:
```fish
set -gx PATH $PATH $HOME/.cargo/bin
```
## Usage
The program must be run as root to access the following files:
- `/sys/class/leds/system76_acpi::kbd_backlight/color`
- `/sys/class/leds/system76_acpi::kbd_backlight/brightness`
If you don't want to run the program as root, you can change the permissions of
these files. I run it as root because I'm lazy. You can probably figure out how
to do this yourself.
You can run the program with:
```bash
system76-keyboard-rainbow
```
You can also run it in the background with:
```bash
system76-keyboard-rainbow &
```
### Options
You can change the sleep time of the rainbow with the `-s` or `--sleep-time`
option (in milliseconds). For example, to have a 0.1 second sleep time:
```bash
system76-keyboard-rainbow -s 100
```
You can also change the color increment with the `-c` or `--color-increment`
option. For example, to have a 10 increment:
```bash
system76-keyboard-rainbow -c 10
```
## What's the `keyboard_led_rainbow.sh` file?
That's the original script I wrote to do this. It took up to 10% of my CPU when
running, so I decided to rewrite it in Rust. I'm keeping it here for posterity.
## License
This program is licensed under the MIT license. See the [LICENSE](LICENSE.md) file
for more information.