Author Topic: Keyboard Back-light scripts (2 required) for multimedia keys to work  (Read 1819 times)

jedi

  • DEFCON 1
  • Posts: 1555
  • Not all those who wander are lost.
    • View Profile
    • NixNut.com
This was originally intended for an Asus G73 laptop.  I have an Asus G55VW laptop, and it works great. (It requires the installation of 2 separate scripts!)  I didn't even change the directory name.  (/home/jed/g73)
This is taken directly from the README file included with the g73 script;

1. Clone this repository to your home directory (or wherever you want to, I'll do this example for ~/ for simplicity)

        cd
        git clone git://github.com/ktoso/g73-keyboard-backlight-sh.git g73

2. Make sure all scripts are marked executable:

        cd g73
        chmod +x *.sh

3. Take a look at these scripts to make sure you trust them, why? Because they'll need root access, without asking for the password.  Now, we'll add these scripts to allow `sudo`to run them without asking for any password:

        su -c 'visudo' # or 'sudo visudo' if you're a sudoer (on VSIDO etc)

Then just add the following lines at the end of the sudoer file (or similar, with the script names etc). Of course, replace `ktoso` and `/home/ktoso/` with your *username* and *your home directory*. (ktoso is the author of the g73 script, and here's a heartfelt "Thank-You" to ktoso!)

        ## allow running keyboard backlight scripts
        YOURUSERNAME ALL=(ALL) NOPASSWD:/home/YOURUSERNAME/g73/*

Once you have the script installed, open your ~/.fluxbox/keys file and add the following lines (changing username and home directory of course)  I used xev to determine the numbers for the keybindings.  xev is included with VSIDO by default.

# Keyboard Brightness Controls
# keys: dim 237, bright 238
237 :Exec /home/jed/g73/light_down.sh
238 :Exec /home/jed/g73/light_up.sh

Next you'll need to install the 2nd script that is attached below.  There is a README with it as well explaining how to "get 'er done"!  This script adds the necessary files and folders to /sys/class/leds/asus.  This is where the other script gets the info to turn on and off the lights, as well as a dim, bright, brighter setting!

Now with all that said, there is one other little detail I hadn't considered when asked to share this info.  It is intended to work with an Asus laptop as I stated above.  It also relies on the attached scripts to be installed.  This may be a show stopper as it is specific to an Asus laptop.  I'm not sure if names can be changed to protect the innocent, err, I mean work with a different brand/model or not.  This was all just kind of thrown together over the last couple of nights.  Mainly it is here so I can recreate this scenario on my laptop in the event a disaster occurs on my machine!  You'd be amazed at how much simpler this way is than the outrageous hack I had working before!

If you find this confusing, don't worry, I did too!  Patience and Google do pay off.  (I've also been told I'm as stubborn as a mule)  I will also try to help if there are questions.  When it gets right down to it, I don't see why these two scripts couldn't be edited to work with any brand of laptop out there.  I also am not a programmer/scripter by any stretch of the imagination.  I have learned the greatest lesson to be learned in Linux;  Copy/Paste (otherwise known as Ctrl-c, and Ctrl-v)  Seriously.  Scripts are basically 'human readable code', and as such, with a little determination and study you can usually edit them to do what you want.  (I have even got to the point of having written a couple for myself!)

I said all that to say this;  If I can do it, anyone can do it!  BUT, don't expect me, or anyone associated with VSIDO to be responsible for you machine if something goes horribly awry after this exercise.  I mean seriously, would you let a chimp drive your Corvette?

Forum Netiquette

"No matter how smart you are you can never convince someone stupid that they are stupid."  Anonymous

lwfitz

  • DEFCON 1
  • Posts: 1758
  • sudo rm -rf /
    • View Profile
Re: Keyboard Back-light scripts (2 required) for multimedia keys to work
« Reply #1 on: March 05, 2014, 04:15:55 AM »
Worked perfect Jedi!!

AMAZING! Thank you!

jedi

  • DEFCON 1
  • Posts: 1555
  • Not all those who wander are lost.
    • View Profile
    • NixNut.com
Re: Keyboard Back-light scripts (2 required) for multimedia keys to work
« Reply #2 on: March 05, 2014, 05:42:21 AM »
Worked perfect Jedi!!

AMAZING! Thank you!

Your very welcome sir!!!  Glad I could finally be of some small help to someone!!!  ;)
Forum Netiquette

"No matter how smart you are you can never convince someone stupid that they are stupid."  Anonymous

lwfitz

  • DEFCON 1
  • Posts: 1758
  • sudo rm -rf /
    • View Profile
Re: Keyboard Back-light scripts (2 required) for multimedia keys to work
« Reply #3 on: March 05, 2014, 07:33:20 AM »
And by the way... Id loan you my Corvette anytime  :D