I would like to make a shell script program I have made to convenience night viewing from my netbook. I have the samsung NP-NC110 10” netbook, and it's lowest screen brightness setting is far too bright to use when at night with the lights off (intended to maximize environmentalist daily living habits). Thus from Lubuntu 14.04 I have to
1) start a terminal and type sudo su,
2) enter the password
3) “echo 1200 >/sys/class/backlight/intel_backlight/brightness”
The screen is at the perfect level for my eyes.
Naturally, the file /sys/class/backlight/intel_backlight/brightness is restricted.
I first create the following files:
Code:
/home/a/bin/dimmest.sh
#!/bin/bash
sudo su -c "echo 1200 >/sys/class/backlight/intel_backlight/brightness"
$SHELL
(I also try echo 1200 >/sys/class/backlight/intel_backlight/brightness for the second line, but to no avail)
Code:
/home/a/.local/share/applications/dimmest.desktop:
[Desktop Entry]
Type=Application
Name=Dimmest
Exec="sudo su -c /home/a/bin/dimmest.sh"
Icon=/home/Icons/dimmest.png
Categories=System
Terminal=true
< I also try Exec=”lxterminal -e "sudo /home/a/bin/dimmest.sh"
in above desktop, but to no avail. >
I have used visudo to alter the file as:
Code:
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
…
%sudo ALL = NOPASSWD: /home/a/bin/dimmest.sh
Any ideas on how to do this in Lubuntu 14.04?
Andrew