Skip to content

Instantly share code, notes, and snippets.

@AlexTMjugador
Created August 11, 2019 18:44
Show Gist options
  • Save AlexTMjugador/34aafe6892cd837a4ae943ea592852fc to your computer and use it in GitHub Desktop.
Save AlexTMjugador/34aafe6892cd837a4ae943ea592852fc to your computer and use it in GitHub Desktop.
A script to configure the keyboard backlight and thermal control of a Sony laptop when pm-powersave is invoked. The laptop must be supported by the Linux sony-laptop driver.
#!/bin/sh
. "$PM_FUNCTIONS"
case "$1" in
true)
# Disable keyboard backlight, and set thermal control to silent
echo 0 > /sys/devices/platform/sony-laptop/kbd_backlight
echo silent > /sys/devices/platform/sony-laptop/thermal_control;;
false)
# Restore keyboard backlight and thermal control to defaults
echo 1 > /sys/devices/platform/sony-laptop/kbd_backlight
echo balanced > /sys/devices/platform/sony-laptop/thermal_control;;
help) exit 0;;
*) exit $NA;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment