mirror of https://github.com/sgoudham/dotfiles.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
503 B
Plaintext
24 lines
503 B
Plaintext
1 year ago
|
#!/usr/bin/env bash
|
||
2 years ago
|
|
||
|
OFF=0
|
||
|
ON=2
|
||
2 years ago
|
KEYBOARD_PATH=/sys/devices/platform/dell-laptop/leds/dell::kbd_backlight/brightness
|
||
|
PREVIOUS_SETTING=$(< $KEYBOARD_PATH)
|
||
2 years ago
|
|
||
|
if [[ $PREVIOUS_SETTING -eq $OFF ]]
|
||
|
then
|
||
2 years ago
|
echo $ON > $KEYBOARD_PATH
|
||
2 years ago
|
if [[ $? -ne 0 ]]; then
|
||
|
echo "ERROR: Could Not Update Settings"
|
||
|
exit 1
|
||
|
fi
|
||
2 years ago
|
echo "Keyboard Backlighting: ON"
|
||
|
else
|
||
2 years ago
|
echo $OFF > $KEYBOARD_PATH
|
||
2 years ago
|
if [[ $? -ne 0 ]]; then
|
||
|
echo "ERROR: Could Not Update Settings"
|
||
|
exit 1
|
||
|
fi
|
||
2 years ago
|
echo "Keyboard Backlighting: OFF"
|
||
|
fi
|