LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices


Reply
  Search this Thread
Old 07-11-2015, 10:55 PM   #1
andrew.comly
Member
 
Registered: Dec 2012
Distribution: Trisquel-Mini 7.0, Lubuntu 14.04, Debian lxde 8.0
Posts: 311
Blog Entries: 2

Rep: Reputation: 16
Lightbulb Reducing screen's brightness: Dimmer than dimmest


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
 
Old 07-11-2015, 11:16 PM   #2
andrew.comly
Member
 
Registered: Dec 2012
Distribution: Trisquel-Mini 7.0, Lubuntu 14.04, Debian lxde 8.0
Posts: 311

Original Poster
Blog Entries: 2

Rep: Reputation: 16
Talking [Solved] am/pm screen brightness shellscript completed!

In ~/bin I make the two shell scripts. First is dimmest.sh:
Code:
#!/bin/bash
echo 1200 >/home/a/dim_value
and second is dim.sh (for regular day brightness level):
Code:
#!/bin/bash
#Program resumes screen brightness to normal.
echo 12421 >/home/a/dim_value
Start terminal,
Code:
cd ~/bin
sudo chmod +x dim.sh && sudo chmod +x dimmest.sh
Since security is very important, I then use what yo8rxp taught to me earlier to make a root daemon by writing the following code to the very end of /etc/rc.local:
Code:
while true
do
 echo $(cat /home/a/dim_value) >/sys/class/backlight/intel_backlight/brightness
sleep 5
done
Finally, I made a desktop file for both dim.sh and dimmest.sh shellscripts above. That way I now have an "am" and "pm" button on my lxpanel. Works beautifully!

With this solution you can now reduce your screen's brightness and then switch to a night colour so that you don't have to "burn the midnight oil" (turn on your lights at night time). This will facilitate conserving electricity, carrying out the acts of:
1) environmentalism and
2) reducing your electricity bills, as well as
3) health - will help you fall asleep earlier

Last edited by andrew.comly; 07-11-2015 at 11:31 PM. Reason: explanation
 
  


Reply

Tags
brightness, dark, energy, health, screen


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mint 15 = black screen (brightness = 0) on start up - have to manually set brightness Netnovice Linux Mint 4 01-16-2014 08:46 PM
samsung laptop NP-RV-509-S04IN brightness not reducing LAXMIKANT MOKADAM Linux - Laptop and Netbook 2 07-07-2013 06:58 AM
samsung laptop NP-RV-509-S04IN brightness not reducing LAXMIKANT MOKADAM Linux - Laptop and Netbook 1 07-05-2013 06:17 PM
LXer: With Vista's View Getting Dimmer, Should You Give Linux A Chance? LXer Syndicated Linux News 0 04-16-2008 04:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook

All times are GMT -5. The time now is 03:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration