fd20f1a9c2
- Update README.md to document installation and usage - Implement razer-bat as simply as possible. - Most parameters can be adjusted, but only mouse and dock names are required. Further implementation of customizability should be pretty easy. |
||
---|---|---|
.. | ||
razer-bat.sh | ||
README.md |
Razer-bat - Update dock status color based on battery level
This script uses razer-cli and standard bash utilities to set the RGB LEDs of your Razer wireless dock to reflect the battery level of your wireless mouse (or keyboard).
Installation & Usage
Before installing, we need to install some dependencies:
- Install razer-cli: instructions.
- Download this script and make it executable:
curl -s https://gitea.jafner.tools/Jafner/Jafner.net/raw/branch/main/projects/razer-bat/razer-bat.sh > ./ && chmod +x ./razer-bat.sh
. - Set the
WIRELESS_DEVICE_NAME
andWIRED_DEVICE_NAME
variables at the top of the script.- Set
WIRELESS_DEVICE_NAME
with the name of your wireless mouse, keyboard, or whatever you want to monitor the battery level of. (Tip: You can find it by runningrazer-cli -ls
). - Set
WIRED_DEVICE_NAME
with the name of your wired charging dock, or whatever device whose RGB you want to reflect the battery level of your wireless device.
- Set
- Run the script once:
./razer-bat.sh
. Verify everything is working properly. - Move the script to somewhere safe. For example:
mv ./razer-bat.sh $HOME/.local/razer-bat
- Create a cronjob for the script:
echo "*/5 * * * * $HOME/.local/razer-bat" | crontab -
Tested With
razer-cli: 2.2.1
python3-openrazer: 3.8.0
openrazer-daemon: 3.8.0
Python: 3.12.3