You are not logged in.
Pages: 1
I have a keyboard which has LED Lights under it. When i power my computer up it will light up when accessing the BIOS, but once it gets to the Grub screen it turns off, and im not exactly sure how to enable the light, my BIOS setting is set to ALWAYS have it on, but that is not working and im trying to find out how and can enable and disable it upon command if possible.
Ive googled and havent found anything on this, do you guys know what to do with this?
~The Dyzaster
Offline
What laptop is this? Odds are there are files you can use to modulate the brightness. I have a MBP(8,2), and there are several ways of dealing with the keyboard (and display) backlights. So, more information == needed
All the best,
-HG
Offline
What laptop is this? Odds are there are files you can use to modulate the brightness. I have a MBP(8,2), and there are several ways of dealing with the keyboard (and display) backlights. So, more information == needed
All the best,
-HG
This HERE is a link to the sexy beast on Toshibas website
Offline
This HERE is a link to the sexy beast on Toshibas website
What files/folders do you see in /sys/class/leds/?
I'd bet that the script I use to deal with my keyboard backlights could be easily adapted to work for your keyboard.
All the best,
-HG
Offline
Dyzaster wrote:This HERE is a link to the sexy beast on Toshibas website
What files/folders do you see in /sys/class/leds/?
I'd bet that the script I use to deal with my keyboard backlights could be easily adapted to work for your keyboard.
All the best,
-HG
phy0-led toshiba::illumination
Those are what i see
Offline
Yeah, I'd bet that "toshiba::illumination" is a symlinked folder and inside of that are some files which you can modify to deal with the keyboard backlights. Here is a copy of the script I wrote and use to control my keyboard backlights (and my screen backlight) to give you a good idea of how to handle this pretty easily.
All the best,
-HG
Last edited by HalosGhost (2013-04-09 19:40:03)
Offline
Yeah, I'd bet that "toshiba::illumination" is a symlinked folder and inside of that are some files which you can modify to deal with the keyboard backlights. Here is a copy of the script I wrote and use to control my keyboard backlights (and my screen backlight) to give you a good idea of how to handle this pretty easily.
All the best,
-HG
Thanks ill be taking a look at that, hopefully that will fix this for me
~The Dyzaster
Offline
I hope it works out for you. If you have questions specific to the script, feel free to drop me an email. Otherwise, if you get it to work for you, please add [Solved] to the beginning of your thread title. Also, when you have a minute, read this. "Life as a two way street," as the Forum Etiquette mentions. You should try and help us to help you as much as possible.
All the best,
-HG
Offline
Ok so here is the config from what i have now:
#!/bin/bash
#<- Configuration ->
disp=/sys/class/backlight/intel_backlight/brightness
dstep=2048
kbd=/sys/class/leds/toshiba::illumination/brightness
kstep=15
self="$(basename $0)"
#<- Error Handling ->
E_HELP=44
E_PERMS=45
#<- Function Declarations ->
permissions () {
if [ "$UID" != 0 ]; then
echo "$self must be run with root privileges"
exit "$E_PERMS"
fi
}
usage () {
echo "Usage: $self [-h|--help] [<increase|decrease> device]"
exit "$E_HELP"
}
update-kbd () {
permissions
sudo tee "$kbd" <<< "$new"
exit 0
}
update-disp () {
permissions
sudo tee "$disp" <<< "$new"
exit 0
}
#<- Run Contents ->
case "$1" in
-h|--help)
usage
;;
increase)
case "$2" in
keyboard)
current="$(<"$kbd")"
new="$(( current + kstep ))"
update-kbd
;;
display)
current="$(<"$disp")"
new="$(( current + dstep ))"
update-disp
;;
*)
usage
;;
esac
;;
decrease)
case "$2" in
keyboard)
current="$(<"$kbd")"
new="$(( current - kstep ))"
update-kbd
;;
display)
current="$(<"$disp")"
new="$(( current - dstep ))"
update-disp
;;
*)
usage
;;
esac
;;
*)
usage
;;
esac
No when i sh it it gives me the error "LED Keys.sh: line 33: `update-kbd': not a valid identifier", i dont understand what change should be made to correct this, i understand where it needs to be changed, but im confused as to what it should be changed to, do you have any ideas?
Im not the best with bash sadly, i know enough to get by normally though.
~The Dyzaster
Last edited by Dyzaster (2013-04-09 20:11:07)
Offline
please use code tags when pasting code snippets.
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
please use code tags when pasting code snippets.
Definitely follow this advice. Makes life much easier. As for the code itself, first be aware that you can't just "sh" it. It runs using arguments, so you'd run something like
# ./enlighten increase keyboard
Though I wrote that script for zsh, I believe it should be compatible with bash without issue. Below is a much simpler version of the script which will only increase or decrease the keyboard backlights:
#!/bin/bash
#<- Configuration ->
kbd=/sys/class/leds/toshiba::illumination/brightness
kstep=15
self="$(basename $0)"
#<- Error Handling ->
E_HELP=44
E_PERMS=45
#<- Function Declarations ->
permissions () {
if [ "$UID" != 0 ]; then
echo "$self must be run with root privileges"
exit "$E_PERMS"
fi
}
usage () {
echo "Usage: $self [-h|--help] <increase|decrease>"
exit "$E_HELP"
}
update-kbd () {
permissions
sudo tee "$kbd" <<< "$new"
exit 0
}
#<- Run Contents ->
case "$1" in
-h|--help)
usage
;;
increase)
current="$(<"$kbd")"
new="$(( current + kstep ))"
update-kbd
;;
decrease)
current="$(<"$kbd")"
new="$(( current - kstep ))"
update-kbd
;;
*)
usage
;;
esac
Assuming you have the correct file being pointed to, you should be able to just run (assuming you keep it named "enlighten")
# ./enlighten increase
Let me know how that works for you.
All the best,
-HG
Offline
Yea i tried to use [spoiler] but i guess that doesnt work on these forums, i switched to code to make it look better.
Also, i will try that, for some reason my computer will not get passed the HDD check, SystemD doesnt start, so now i have to fix this before i can try anything else
Offline
Inxsible wrote:please use code tags when pasting code snippets.
Definitely follow this advice. Makes life much easier. As for the code itself, first be aware that you can't just "sh" it. It runs using arguments, so you'd run something like
# ./enlighten increase keyboard
Though I wrote that script for zsh, I believe it should be compatible with bash without issue. Below is a much simpler version of the script which will only increase or decrease the keyboard backlights:
#!/bin/bash #<- Configuration -> kbd=/sys/class/leds/toshiba::illumination/brightness kstep=15 self="$(basename $0)" #<- Error Handling -> E_HELP=44 E_PERMS=45 #<- Function Declarations -> permissions () { if [ "$UID" != 0 ]; then echo "$self must be run with root privileges" exit "$E_PERMS" fi } usage () { echo "Usage: $self [-h|--help] <increase|decrease>" exit "$E_HELP" } update-kbd () { permissions sudo tee "$kbd" <<< "$new" exit 0 } #<- Run Contents -> case "$1" in -h|--help) usage ;; increase) current="$(<"$kbd")" new="$(( current + kstep ))" update-kbd ;; decrease) current="$(<"$kbd")" new="$(( current - kstep ))" update-kbd ;; *) usage ;; esac
Assuming you have the correct file being pointed to, you should be able to just run (assuming you keep it named "enlighten")
# ./enlighten increase
Let me know how that works for you.
All the best,
-HG
Ok so i copied that script, and tried to run "./enlighten increase" but it said i needed to be sudo, so i did it with sudo, and it said "sudo: ./enlighten: command not found"
Then i just did 'sh enlighten increase" And this time it gave me:
enlighten: line 29: `update-kbd': not a valid identifier
I have no idea what that would mean.
When i google "`update-kbd': not a valid identifier" all it comes up with is my topic lmfao. Not much help there.
~The Dyzaster
Offline
Ok so i copied that script, and tried to run "./enlighten increase" but it said i needed to be sudo, so i did it with sudo, and it said "sudo: ./enlighten: command not found"
Yeah, the "#" made note that you need to have root perms to run it. Try passing it the full path `sudo $(pwd)/enlighten increase` you might also try explicitly running it with bash: `sudo bash $(pwd)/enlighten increase`.
Then i just did 'sh enlighten increase" And this time it gave me:
enlighten: line 29: `update-kbd': not a valid identifier
That could be an incompatibility with bash (or a different shell if you're using one), but I don't think it is because I can run this script using bash and it works fine. So I don't quite know what's going wrong there.
When i google "`update-kbd': not a valid identifier" all it comes up with is my topic lmfao. Not much help there.
Yeah, that won't help much. "update-kbd" is the name of a function in that script, so you'll probably only get results for that script.
The error you're getting would suggest that there is either an error in the code or in how it's being run, but I'm not entirely sure which it is (much more likely to be the latter since the code works fine for me). Thus, my suggestions above are largely guess-and-check trouble-shooting.
All the best,
-HG
Last edited by HalosGhost (2013-04-12 07:46:04)
Offline
Pages: 1