How to prevent the keyboard backlight from turning on when the laptop is woken from sleep?
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
7
down vote
favorite
I have a Thinkpad 470 and I am running Ubuntu 16.04 LTS on it. I don't like to keep the keyboard backlight on during daytime because I want to save battery among other things. What I have noticed is that the backlight turns itself on even if it is woken up from a state where the screen was dimmed completely or system had gone to sleep due to inactivity. The issue is that in day time or in presence of bright lights I am unable to see the backlight is on, thus I don't switch it off and this drains the battery.
I want to be able to control this setting. How do I do this?
After searching a bit in the following location :
/sys/class/leds/tpacpi::kbd_backlight
I found the following files:
rgh@arrakis:/sys/class/leds/tpacpi::kbd_backlight$ ls
brightness brightness_hw_changed device max_brightness
power subsystem trigger uevent
From among these, the file trigger contains the following items inside:
[none] rfkill-any kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock
kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock
kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock AC-online
BAT0-charging-or-full BAT0-charging BAT0-full
BAT0-charging-blink-full-solid BAT1-charging-or-full
BAT1-charging BAT1-full BAT1-charging-blink-full-solid usb-gadget
usb-host disk-activity ide-disk mtd nand-disk cpu cpu0 cpu1 cpu2 cpu3
panic bluetooth-power rfkill0 rfkill1 phy0rx phy0tx phy0assoc phy0radio
hci0-power rfkill41
I am guessing something here needs to be removed to get the behaviour I am looking for? Can you please tell me if I am correct? How to get this done?
16.04 thinkpad keyboard-backlight
add a comment |Â
up vote
7
down vote
favorite
I have a Thinkpad 470 and I am running Ubuntu 16.04 LTS on it. I don't like to keep the keyboard backlight on during daytime because I want to save battery among other things. What I have noticed is that the backlight turns itself on even if it is woken up from a state where the screen was dimmed completely or system had gone to sleep due to inactivity. The issue is that in day time or in presence of bright lights I am unable to see the backlight is on, thus I don't switch it off and this drains the battery.
I want to be able to control this setting. How do I do this?
After searching a bit in the following location :
/sys/class/leds/tpacpi::kbd_backlight
I found the following files:
rgh@arrakis:/sys/class/leds/tpacpi::kbd_backlight$ ls
brightness brightness_hw_changed device max_brightness
power subsystem trigger uevent
From among these, the file trigger contains the following items inside:
[none] rfkill-any kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock
kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock
kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock AC-online
BAT0-charging-or-full BAT0-charging BAT0-full
BAT0-charging-blink-full-solid BAT1-charging-or-full
BAT1-charging BAT1-full BAT1-charging-blink-full-solid usb-gadget
usb-host disk-activity ide-disk mtd nand-disk cpu cpu0 cpu1 cpu2 cpu3
panic bluetooth-power rfkill0 rfkill1 phy0rx phy0tx phy0assoc phy0radio
hci0-power rfkill41
I am guessing something here needs to be removed to get the behaviour I am looking for? Can you please tell me if I am correct? How to get this done?
16.04 thinkpad keyboard-backlight
As alluded to in answer below, the "file"brightness
is likely more suitable than the "file"trigger
which you are focusing on now.
â WinEunuuchs2Unix
Apr 29 at 20:02
add a comment |Â
up vote
7
down vote
favorite
up vote
7
down vote
favorite
I have a Thinkpad 470 and I am running Ubuntu 16.04 LTS on it. I don't like to keep the keyboard backlight on during daytime because I want to save battery among other things. What I have noticed is that the backlight turns itself on even if it is woken up from a state where the screen was dimmed completely or system had gone to sleep due to inactivity. The issue is that in day time or in presence of bright lights I am unable to see the backlight is on, thus I don't switch it off and this drains the battery.
I want to be able to control this setting. How do I do this?
After searching a bit in the following location :
/sys/class/leds/tpacpi::kbd_backlight
I found the following files:
rgh@arrakis:/sys/class/leds/tpacpi::kbd_backlight$ ls
brightness brightness_hw_changed device max_brightness
power subsystem trigger uevent
From among these, the file trigger contains the following items inside:
[none] rfkill-any kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock
kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock
kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock AC-online
BAT0-charging-or-full BAT0-charging BAT0-full
BAT0-charging-blink-full-solid BAT1-charging-or-full
BAT1-charging BAT1-full BAT1-charging-blink-full-solid usb-gadget
usb-host disk-activity ide-disk mtd nand-disk cpu cpu0 cpu1 cpu2 cpu3
panic bluetooth-power rfkill0 rfkill1 phy0rx phy0tx phy0assoc phy0radio
hci0-power rfkill41
I am guessing something here needs to be removed to get the behaviour I am looking for? Can you please tell me if I am correct? How to get this done?
16.04 thinkpad keyboard-backlight
I have a Thinkpad 470 and I am running Ubuntu 16.04 LTS on it. I don't like to keep the keyboard backlight on during daytime because I want to save battery among other things. What I have noticed is that the backlight turns itself on even if it is woken up from a state where the screen was dimmed completely or system had gone to sleep due to inactivity. The issue is that in day time or in presence of bright lights I am unable to see the backlight is on, thus I don't switch it off and this drains the battery.
I want to be able to control this setting. How do I do this?
After searching a bit in the following location :
/sys/class/leds/tpacpi::kbd_backlight
I found the following files:
rgh@arrakis:/sys/class/leds/tpacpi::kbd_backlight$ ls
brightness brightness_hw_changed device max_brightness
power subsystem trigger uevent
From among these, the file trigger contains the following items inside:
[none] rfkill-any kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock
kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock
kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock AC-online
BAT0-charging-or-full BAT0-charging BAT0-full
BAT0-charging-blink-full-solid BAT1-charging-or-full
BAT1-charging BAT1-full BAT1-charging-blink-full-solid usb-gadget
usb-host disk-activity ide-disk mtd nand-disk cpu cpu0 cpu1 cpu2 cpu3
panic bluetooth-power rfkill0 rfkill1 phy0rx phy0tx phy0assoc phy0radio
hci0-power rfkill41
I am guessing something here needs to be removed to get the behaviour I am looking for? Can you please tell me if I am correct? How to get this done?
16.04 thinkpad keyboard-backlight
asked Apr 26 at 10:53
![](https://i.stack.imgur.com/grrEJ.jpg?s=32&g=1)
![](https://i.stack.imgur.com/grrEJ.jpg?s=32&g=1)
Chani
1733621
1733621
As alluded to in answer below, the "file"brightness
is likely more suitable than the "file"trigger
which you are focusing on now.
â WinEunuuchs2Unix
Apr 29 at 20:02
add a comment |Â
As alluded to in answer below, the "file"brightness
is likely more suitable than the "file"trigger
which you are focusing on now.
â WinEunuuchs2Unix
Apr 29 at 20:02
As alluded to in answer below, the "file"
brightness
is likely more suitable than the "file" trigger
which you are focusing on now.â WinEunuuchs2Unix
Apr 29 at 20:02
As alluded to in answer below, the "file"
brightness
is likely more suitable than the "file" trigger
which you are focusing on now.â WinEunuuchs2Unix
Apr 29 at 20:02
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
2
down vote
From this reddit post OP had opposite problem with lights always being turned off when resuming from suspend.
You can follow the same approach but change the 1
(on) to a 0
(off).
Find the folder /etc/systemd/system/sleep.target.wants/
and create kb_backlight_resume.service
with these contents:
[Unit]
Description=Switch on keyboard backlight after resume
After=suspend.target
After=hibernate.target
After=hybrid-sleep.target
[Service]
ExecStart=/bin/echo 0 > "/sys/devices/platform/thinkpad_acpi/leds/tpacpi::kbd_backlight/brightness"
[Install]
WantedBy=suspend.target
WantedBy=hibernate.target
WantedBy=hybrid-sleep.target
I don't have a Thinkpad and my Dell backlight keyboard has different directory structures. I'm unable to test this for your environment. You might have to manually tweak the code if the directory names above are off.
Don't forget to reboot before testing suspend / resume.
Comment from DmC8pR2kZLzdCQZu3v: " I am running the latest Ubuntu 16.04 on a Lenovo T460s, and this problem just started happening on my machine as well. @WinEunuuchs2Unix's solution did not resolve it for me. I am unable to comment on his/her answer to indicate this, nor can I vote on the answer."
â WinEunuuchs2Unix
Apr 29 at 19:59
add a comment |Â
up vote
0
down vote
Try with:
sudo apt-get install pm-utils
Create a script in /usr/lib/pm-utils/sleep.d
sudo nano /usr/lib/pm-utils/sleep.d/KB_BACK_OFF.sh
Copy and paste the following:
#!/bin/sh
case "$1" in
resume)
xset led off
;;
esac
exit 0
Make executable the script:
sudo chmod a+x /usr/lib/pm-utils/sleep.d/KB_BACK_OFF.sh
If the command in the script xset led off does not work, try to replace it with the command xset -led (YOUR NUMBER) with a number from 1 to 32. Example: xset -led 3
I personally tried to run the script for another purpose on Kubuntu 18.04 and it works on system wake up.
YOU DON'T NEED TO RESTART THE SYSTEM
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
From this reddit post OP had opposite problem with lights always being turned off when resuming from suspend.
You can follow the same approach but change the 1
(on) to a 0
(off).
Find the folder /etc/systemd/system/sleep.target.wants/
and create kb_backlight_resume.service
with these contents:
[Unit]
Description=Switch on keyboard backlight after resume
After=suspend.target
After=hibernate.target
After=hybrid-sleep.target
[Service]
ExecStart=/bin/echo 0 > "/sys/devices/platform/thinkpad_acpi/leds/tpacpi::kbd_backlight/brightness"
[Install]
WantedBy=suspend.target
WantedBy=hibernate.target
WantedBy=hybrid-sleep.target
I don't have a Thinkpad and my Dell backlight keyboard has different directory structures. I'm unable to test this for your environment. You might have to manually tweak the code if the directory names above are off.
Don't forget to reboot before testing suspend / resume.
Comment from DmC8pR2kZLzdCQZu3v: " I am running the latest Ubuntu 16.04 on a Lenovo T460s, and this problem just started happening on my machine as well. @WinEunuuchs2Unix's solution did not resolve it for me. I am unable to comment on his/her answer to indicate this, nor can I vote on the answer."
â WinEunuuchs2Unix
Apr 29 at 19:59
add a comment |Â
up vote
2
down vote
From this reddit post OP had opposite problem with lights always being turned off when resuming from suspend.
You can follow the same approach but change the 1
(on) to a 0
(off).
Find the folder /etc/systemd/system/sleep.target.wants/
and create kb_backlight_resume.service
with these contents:
[Unit]
Description=Switch on keyboard backlight after resume
After=suspend.target
After=hibernate.target
After=hybrid-sleep.target
[Service]
ExecStart=/bin/echo 0 > "/sys/devices/platform/thinkpad_acpi/leds/tpacpi::kbd_backlight/brightness"
[Install]
WantedBy=suspend.target
WantedBy=hibernate.target
WantedBy=hybrid-sleep.target
I don't have a Thinkpad and my Dell backlight keyboard has different directory structures. I'm unable to test this for your environment. You might have to manually tweak the code if the directory names above are off.
Don't forget to reboot before testing suspend / resume.
Comment from DmC8pR2kZLzdCQZu3v: " I am running the latest Ubuntu 16.04 on a Lenovo T460s, and this problem just started happening on my machine as well. @WinEunuuchs2Unix's solution did not resolve it for me. I am unable to comment on his/her answer to indicate this, nor can I vote on the answer."
â WinEunuuchs2Unix
Apr 29 at 19:59
add a comment |Â
up vote
2
down vote
up vote
2
down vote
From this reddit post OP had opposite problem with lights always being turned off when resuming from suspend.
You can follow the same approach but change the 1
(on) to a 0
(off).
Find the folder /etc/systemd/system/sleep.target.wants/
and create kb_backlight_resume.service
with these contents:
[Unit]
Description=Switch on keyboard backlight after resume
After=suspend.target
After=hibernate.target
After=hybrid-sleep.target
[Service]
ExecStart=/bin/echo 0 > "/sys/devices/platform/thinkpad_acpi/leds/tpacpi::kbd_backlight/brightness"
[Install]
WantedBy=suspend.target
WantedBy=hibernate.target
WantedBy=hybrid-sleep.target
I don't have a Thinkpad and my Dell backlight keyboard has different directory structures. I'm unable to test this for your environment. You might have to manually tweak the code if the directory names above are off.
Don't forget to reboot before testing suspend / resume.
From this reddit post OP had opposite problem with lights always being turned off when resuming from suspend.
You can follow the same approach but change the 1
(on) to a 0
(off).
Find the folder /etc/systemd/system/sleep.target.wants/
and create kb_backlight_resume.service
with these contents:
[Unit]
Description=Switch on keyboard backlight after resume
After=suspend.target
After=hibernate.target
After=hybrid-sleep.target
[Service]
ExecStart=/bin/echo 0 > "/sys/devices/platform/thinkpad_acpi/leds/tpacpi::kbd_backlight/brightness"
[Install]
WantedBy=suspend.target
WantedBy=hibernate.target
WantedBy=hybrid-sleep.target
I don't have a Thinkpad and my Dell backlight keyboard has different directory structures. I'm unable to test this for your environment. You might have to manually tweak the code if the directory names above are off.
Don't forget to reboot before testing suspend / resume.
answered Apr 29 at 6:18
![](https://i.stack.imgur.com/2SXNl.jpg?s=32&g=1)
![](https://i.stack.imgur.com/2SXNl.jpg?s=32&g=1)
WinEunuuchs2Unix
35.6k759133
35.6k759133
Comment from DmC8pR2kZLzdCQZu3v: " I am running the latest Ubuntu 16.04 on a Lenovo T460s, and this problem just started happening on my machine as well. @WinEunuuchs2Unix's solution did not resolve it for me. I am unable to comment on his/her answer to indicate this, nor can I vote on the answer."
â WinEunuuchs2Unix
Apr 29 at 19:59
add a comment |Â
Comment from DmC8pR2kZLzdCQZu3v: " I am running the latest Ubuntu 16.04 on a Lenovo T460s, and this problem just started happening on my machine as well. @WinEunuuchs2Unix's solution did not resolve it for me. I am unable to comment on his/her answer to indicate this, nor can I vote on the answer."
â WinEunuuchs2Unix
Apr 29 at 19:59
Comment from DmC8pR2kZLzdCQZu3v: " I am running the latest Ubuntu 16.04 on a Lenovo T460s, and this problem just started happening on my machine as well. @WinEunuuchs2Unix's solution did not resolve it for me. I am unable to comment on his/her answer to indicate this, nor can I vote on the answer."
â WinEunuuchs2Unix
Apr 29 at 19:59
Comment from DmC8pR2kZLzdCQZu3v: " I am running the latest Ubuntu 16.04 on a Lenovo T460s, and this problem just started happening on my machine as well. @WinEunuuchs2Unix's solution did not resolve it for me. I am unable to comment on his/her answer to indicate this, nor can I vote on the answer."
â WinEunuuchs2Unix
Apr 29 at 19:59
add a comment |Â
up vote
0
down vote
Try with:
sudo apt-get install pm-utils
Create a script in /usr/lib/pm-utils/sleep.d
sudo nano /usr/lib/pm-utils/sleep.d/KB_BACK_OFF.sh
Copy and paste the following:
#!/bin/sh
case "$1" in
resume)
xset led off
;;
esac
exit 0
Make executable the script:
sudo chmod a+x /usr/lib/pm-utils/sleep.d/KB_BACK_OFF.sh
If the command in the script xset led off does not work, try to replace it with the command xset -led (YOUR NUMBER) with a number from 1 to 32. Example: xset -led 3
I personally tried to run the script for another purpose on Kubuntu 18.04 and it works on system wake up.
YOU DON'T NEED TO RESTART THE SYSTEM
add a comment |Â
up vote
0
down vote
Try with:
sudo apt-get install pm-utils
Create a script in /usr/lib/pm-utils/sleep.d
sudo nano /usr/lib/pm-utils/sleep.d/KB_BACK_OFF.sh
Copy and paste the following:
#!/bin/sh
case "$1" in
resume)
xset led off
;;
esac
exit 0
Make executable the script:
sudo chmod a+x /usr/lib/pm-utils/sleep.d/KB_BACK_OFF.sh
If the command in the script xset led off does not work, try to replace it with the command xset -led (YOUR NUMBER) with a number from 1 to 32. Example: xset -led 3
I personally tried to run the script for another purpose on Kubuntu 18.04 and it works on system wake up.
YOU DON'T NEED TO RESTART THE SYSTEM
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Try with:
sudo apt-get install pm-utils
Create a script in /usr/lib/pm-utils/sleep.d
sudo nano /usr/lib/pm-utils/sleep.d/KB_BACK_OFF.sh
Copy and paste the following:
#!/bin/sh
case "$1" in
resume)
xset led off
;;
esac
exit 0
Make executable the script:
sudo chmod a+x /usr/lib/pm-utils/sleep.d/KB_BACK_OFF.sh
If the command in the script xset led off does not work, try to replace it with the command xset -led (YOUR NUMBER) with a number from 1 to 32. Example: xset -led 3
I personally tried to run the script for another purpose on Kubuntu 18.04 and it works on system wake up.
YOU DON'T NEED TO RESTART THE SYSTEM
Try with:
sudo apt-get install pm-utils
Create a script in /usr/lib/pm-utils/sleep.d
sudo nano /usr/lib/pm-utils/sleep.d/KB_BACK_OFF.sh
Copy and paste the following:
#!/bin/sh
case "$1" in
resume)
xset led off
;;
esac
exit 0
Make executable the script:
sudo chmod a+x /usr/lib/pm-utils/sleep.d/KB_BACK_OFF.sh
If the command in the script xset led off does not work, try to replace it with the command xset -led (YOUR NUMBER) with a number from 1 to 32. Example: xset -led 3
I personally tried to run the script for another purpose on Kubuntu 18.04 and it works on system wake up.
YOU DON'T NEED TO RESTART THE SYSTEM
edited May 4 at 18:13
answered May 4 at 16:51
Claudio Taccogna
19418
19418
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1028368%2fhow-to-prevent-the-keyboard-backlight-from-turning-on-when-the-laptop-is-woken-f%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
As alluded to in answer below, the "file"
brightness
is likely more suitable than the "file"trigger
which you are focusing on now.â WinEunuuchs2Unix
Apr 29 at 20:02