Need help with steps for LED keyboard

Skybane

Reputable
Dec 30, 2014
3
0
4,510
Hello and Happy Hollidays , I have a new Cooler Master red led CM storm Devastator keyboard . When I plug the keyboard in the lighting does not work . It works in all aspects except no lighting which , leaves it worthless as it's impossible to read as the keys are blank without the back lighting !

I found this thread on launchpad it's a conversation between RickB (malydog) and Michael Ireland . In this conversation he RickB gives directions ( with corrections and alternatives ) that fix the lighting issue .
Unfortunately , I find it a wee bit confusing Could someone please give me a concise set of steps to use his sollution ? Something like an Idiots guide of steps . Just pretend I'm a linux idiot




Preferably , I'd like it to light up when I turn the comp on but , if I could get it to where I turn the comp on and when the log in screen pops up I hit the scroll lock button and it lights up would be almost as good .


Thanks
Here are the pertinent parts of the conversation without the rest of the banter in the thread ---------------------------------------------------------------------------------------------------------------------------



The magic juice to turn on the backlight on this keyboard in linux is this:

xset led 3

So to get it to turn on automatically you need to execute "xset led 3" on startup .

Create file /etc/xdg/autostart/backlight.desktop

Edit the file so it looks something like this:

[Desktop Entry]
Type=Application
Name=Devastator Backlight
Exec=xset led 3
Icon=system-run
X-GNOME-Autostart-enabled=true

The method above turns on the backlight once any user logs in.

The comand below makes the scroll lock key turn the backlight on and off (but does not override "xset led 3").

sudo xmodmap -e 'add mod3 = Scroll_Lock'

Sometimes the backlight fails to turn on. No idea why, maybe there is a race condition when logging in.

So I have written a tiny shell script, put in a one second sleep to help avoid any potential race, and just in case it still fails I also execute the xmodmap command in the same script. So hopefully you can turn the backlight on with the scroll lock key if it does not come on automatically.

Here is the shell script:

#!/bin/bash
sleep 1
xset led 3
xmodmap -e 'add mod3 = Scroll_Lock'

I saved it as /home/Keyboard/scripts/backlight.sh (don't forget to make it executable!).

Then I updated the .desktop file at /etc/xdg/autostart/backlight.desktop so that it runs the new shell script, like so:

[Desktop Entry]
Type=Application
Name=Devastator Backlight
Exec=/home/Keyboard/scripts/backlight.sh
Icon=system-run
X-GNOME-Autostart-enabled=true

"Ideally I wanted to get the backlight to activate at the login screen (before any user has logged on)"

The trick to get this going (on Ubuntu 14.04 now BTW) is to edit /etc/lightdm/lightdm.conf

In the section [SeatDefaults] add a display-setup-script pointing to the backlight.sh script mentioned in the post above, like this:
display-setup-script=/home/Keyboard/scripts/backlight.sh

Here's what my lightdm.conf looks like now:

[SeatDefaults]
user-session=ubuntu
greeter-session=unity-greeter
display-setup-script=/home/Keyboard/scripts/backlight.sh

QUESTION - Is it possible to just put the xset led mod3 command directly into the lightdm.conf file somehow? I realize this might still cause the race condition, but it seems more elegant than using a shell script. Also, I'd be tempted to put the shell script somewhere other than a user's home directory; I assume it wouldn't have any trouble running from somewhere else.

But really, what confuses me is that the backlight key (scroll lock) works perfectly fine when I boot to the BIOS.

ANSWER -
Add the command to ~/.xinitrc so it starts with X. You can also add it to your autostart file for lightdm.
---------------------------------------------------------------------------------------------------------------------------

So I hope someone can explain the steps posted above . For example it appears he corrects his explaination several times , so I do not know which steps to take or in which order . He says " Create file /etc/xdg/autostart/backlight.desktop "

but how and where do I create this file ?

Then , he says
" Edit the file so it looks something like this:

[Desktop Entry]
Type=Application
Name=Devastator Backlight
Exec=xset led 3
Icon=system-run
X-GNOME-Autostart-enabled=true "

But , I do not understand what or how .

Then later he appears to change his mind !



As of now , I boot my comp . log in , open terminal and paste this shell script
#!/bin/bash
sleep 1
xset led 3
xmodmap -e 'add mod3 = Scroll_Lock'
Bingo , my keyboard lights up .
What I can't figure out is the steps to first make the shell script permanent and , make this happen automatically apon booting up .
End goal is I need to get the keyboard backlighting to activate at the login screen automatically , before I logg on .


The comp it's goint to -
I'm running Mint 17 Cinnamon
ASUS M5A97 LE R2.0
AMD FX 6300
10 gigs of Kingston Hyper X
ASUS GTX 650E
300gb VelociRaptor for op system
1tb Seagate
Liqtech 120X cooler


Can someone help please ?
Sky
 
@Skybane - if you don't know how to create a text file in Linux, why do you suffer?
* Open the terminal from Mint, or press <Ctrl><Alt><F1>, then login with your username/password. You can return to your desktop with <Ctrl><Alt><F7>
* Navigate to the folder you want to create the file in, e.g. "cd /etc/xdg/autostart/"
* Use a text editor, nano is usually present on all platforms, so "sudo nano backlight.desktop" will open that editor, with new or existing file. There is on-screen help about the keys to save and exit

Once you do that - post more questions. And don't write a novel - couple of sencentes is more than enough
 

Skybane

Reputable
Dec 30, 2014
3
0
4,510


Alabalcho , I have shrapnel near my brain stem that can't be removed . I can not remember/learn very much . I forget words and terms . No mater how long I use computers or study tutorials , I'll always be a neub for the most part .
There are many reasons why some people can not learn things . My TBI is just one . I use Linux because I simply hate windows . I love Linux even with my limitations .
Now my request was for a simple step guide to making the shel script perminant and to have the keyboard backlighting start automatically at the log in screen .
I asked " please give me a concise set of steps to use his sollution ? Something like an Idiots guide of steps . Just pretend I'm a linux idiot "
If you can help with that wonderful , if not ok .