Skip to content

Instantly share code, notes, and snippets.

@jimmygle
Created December 12, 2023 20:34
Show Gist options
  • Save jimmygle/4a2206808956d9dded5e024a295edb2d to your computer and use it in GitHub Desktop.
Save jimmygle/4a2206808956d9dded5e024a295edb2d to your computer and use it in GitHub Desktop.
Bash script to toggle keyboard backlight on CMStorm keyboard
#!/bin/bash
ls /sys/class/leds | grep scrolllock | while read -r line ; do
onoff=`sudo brightnessctl --device="$line" get`
if [ $onoff -eq 0 ]; then
sudo brightnessctl --device="$line" set 1
else
sudo brightnessctl --device="$line" set 0
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment