Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a Samsung np700z5a and have managed to get most features working but would love to get the keyboard backlight keys working.

I have tried several methods including through the terminal. I have discovered that this works through the terminal:

echo 6 > /sys/class/leds/samsung\:\:kbd_backlight/brightness

after an

sudo su

(but not, sudo echo 6 > /sys/class/leds/samsung\:\:kbd_backlight/brightness where I get permissions denied).

I have tried running this in AutoKey as this script:

#!/bin/bash
sudo su
echo 3 > /sys/class/leds/samsung\:\:kbd_backlight/brightness

and assigned it to some keys in AutoKey but it did not work.

I noticed that when I tried to assign it to the Fn + F9 key, this key and FN + F10 where not recognised at all (these are the keys designated to turn the keyboard backlight up and down in a windows install) so I assigned it to SUPER + - instead. As I said it does not work.

Please help.

share|improve this question
add comment

1 Answer 1

su <user> -c <command>

You will still have to provide the password, though.

share|improve this answer
    
not exactly sure what that means... But I typed: !/bin/bash su SIMON-700Z5A -c echo 3 > /sys/class/leds/samsung\:\:kbd_backlight/brightness , then assigned a key combination in auto hotkey. no dice. –  user181401 Aug 7 '13 at 6:12
    
Didn't it prompt you for a password? –  David Aug 7 '13 at 7:50
    
didn't work at all. is what I wrote above what you were suggesting I write? not sure if that is my user name, i think it is the pc name. I just tried again and wrote in the terminal: su simon -c echo 6 > /sys/class/leds/samsung\:\:kbd_backlight/brightness but it says permission denied. –  user181401 Aug 7 '13 at 9:07
    
When you open a terminal (Ctrl+Alt+T), it says <user>@<host>:~# at the beginning of the line. <user> is your username, <host> is the name of your computer. –  David Aug 7 '13 at 9:40
    
As you have to do this as root, you should probably use su root -c 'echo "6" > /sys/class/leds/samsung\:\:kbd_backlight/brightness'. :) Also, be carefully with that >. A single > overwrites the file, while >> attaches the output to the end of it. –  David Aug 7 '13 at 9:42
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.