LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
LinkBack Search this Thread
Old 09-18-2012, 02:26 PM   #1
RoiSoleil25
LQ Newbie
 
Registered: Sep 2012
Location: .se
Distribution: Arch Linux
Posts: 4

Rep: Reputation: Disabled
Adjust screen brightness


Hi everyone,

I am trying to enable brightness adjustment on my laptop. There are currently two keys (Fn+F5/F6) that should decrease/increase screen brightness but do not work out-of-the-box.

I am able to manually edit the screen brightness by issuing the command:

Code:
echo -n [0-8] > /sys/class/backlight/acpi_video0/brightness
Where 0-8 corresponds to the desired screen brightness.

I wanted to link this to xbindkeysrc with the use of bash scripts and did the following:

1) placed the following two files in my home directory (chmod 755)

.BrightDown.sh
Code:
#!/bin/bash

brightness_file=/sys/class/backlight/acpi_video0/brightness
brightness=$(< $brightness_file)

if [ $((brightness > 0)) '=' 1 ]
then
    brightness=$((brightness - 1))
    echo -n $brightness > $brightness_file
fi
.BrightUp.sh
Code:
#!/bin/bash

brightness_file=/sys/class/backlight/acpi_video0/brightness
brightness=$(< $brightness_file)

if [ $((brightness < 8)) '=' 1 ]
then
    brightness=$((brightness + 1))
    echo -n $brightness > $brightness_file
fi
2) I then added the following to my .xbindkeysrc
Code:
# Decrease Brightness
"/home/roisoleil/.BrightDown.sh"
    m:0x0 + c:232
    XF86MonBrightnessDown
    
# Increase Brightness
"/home/roisoleil/.BrightUp.sh"
    m:0x0 + c:233
    XF86MonBrightnessUp
3) And finally I chmod 646 /sys/devices/virtual/backlight/acpi_video0/brightness

In theory this seems like it should work with me after I restart my wm, but it does not. I also tried running ~/.BrightDown.sh mannually but it did not change the brightness. Any ideas?

EDIT: There was a problem with the .BrightDown.sh file, I have fixed it and this now works (I have updated in this post).

Last edited by RoiSoleil25; 09-18-2012 at 03:40 PM.
 
Old 09-19-2012, 01:32 PM   #2
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,765
Blog Entries: 4

Rep: Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697
Thanks for posting your solution.
 
  


Reply


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Dell Inspiron 1525 Laptop screen brightness wont adjust brighter in Mandriva spring rbixler1957 Mandriva 16 07-10-2010 08:24 PM
unable to adjust screen brightness on my laptop after installing 10.3 vitalstrike82 Suse/Novell 7 07-26-2008 01:22 PM
How to adjust screen brightness (Fedora) Completely Clueless Linux - Laptop and Netbook 7 04-06-2008 06:33 AM
Adjust Brightness 3saul Linux - Software 5 10-31-2006 10:43 PM
Brightness Adjust? Mega Man X Linux - General 2 06-06-2003 01:47 PM


All times are GMT -5. The time now is 02:15 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration