LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-30-2014, 09:40 PM   #1
amaro
Member
 
Registered: Jun 2014
Distribution: Slackware 14.1 on HP 6910p
Posts: 50

Rep: Reputation: 2
How to make intel_backlight settings permanent


Hi guys!

I want to make this permanent
Code:
echo 123 > /sys/class/backlight/intel_backlight/brightness
How to do it?

Thank you!
 
Old 09-30-2014, 11:47 PM   #2
yars
Member
 
Registered: Apr 2012
Location: Russia
Distribution: Slackware64-current
Posts: 249

Rep: Reputation: 24
You can put this line in your /etc/rc.d/rc.local, but the DE may have own settings and override them.
 
Old 10-01-2014, 01:37 AM   #3
amaro
Member
 
Registered: Jun 2014
Distribution: Slackware 14.1 on HP 6910p
Posts: 50

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by yars View Post
You can put this line in your /etc/rc.d/rc.local, but the DE may have own settings and override them.
Absolutely right. Having it in rc.local doesn't work. Something different has to be done.
 
Old 10-01-2014, 07:12 AM   #4
EYo
Member
 
Registered: Jun 2009
Distribution: Slackware
Posts: 190

Rep: Reputation: 153Reputation: 153
Quote:
Originally Posted by amaro View Post
I want to make this permanent
Code:
echo 123 > /sys/class/backlight/intel_backlight/brightness
A search revealed this timing issue solution for setting in rc.local:
Code:
(sleep 5; echo 123 > /sys/class/backlight/intel_backlight/brightness)&
Or man sysctl I can set my backlight from the cli with
Code:
echo 2 > /sys/class/backlight/acpi_video0/brightness
/etc/sysctl.conf for permanent setting. Or maybe
Code:
xbacklight -set N
might also work from a DE autostart script, I did not test. HTH

If you do have success with the sysctl.conf, hope you can post back what works. Thanks.
 
1 members found this post helpful.
Old 10-01-2014, 08:49 AM   #5
solarfields
Senior Member
 
Registered: Feb 2006
Location: Outer Shpongolia
Distribution: Slackware, CRUX
Posts: 1,473

Rep: Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028
That's how I set xgamma and xbacklight:

no graphic log in
using GDM
using KDM

Note that KDE will remember your backlight settings.

Last edited by solarfields; 10-01-2014 at 08:51 AM.
 
1 members found this post helpful.
Old 10-01-2014, 11:51 AM   #6
amaro
Member
 
Registered: Jun 2014
Distribution: Slackware 14.1 on HP 6910p
Posts: 50

Original Poster
Rep: Reputation: 2
@ solarfields
Nice! I didn't try it though. I used to use gamma in the past but now I prefer rc.local. Thank you!

@ EYo
Thank you for your suggestions!

Here is the solution:
Code:
sleep 10 && echo '123' > '/sys/class/backlight/intel_backlight/brightness' &
 
1 members found this post helpful.
Old 10-01-2014, 07:14 PM   #7
dunric
Member
 
Registered: Jul 2004
Distribution: Void Linux, former Slackware
Posts: 498

Rep: Reputation: 100Reputation: 100
A little bit dirty solution, if you'd ask me. Better find out where the brightness get altered and avoid sleeping to work around race condition.

Insipred by Arch Linux wiki you may use an udev rule, by putting following line in /etc/udev/rules.d/81-backlight.rules
Code:
SUBSYSTEM=="backlight", ACTION=="add", KERNEL=="intel_backlight", ATTR{brightness}="123"
Written from top of my head, untested.
 
1 members found this post helpful.
Old 10-02-2014, 12:35 AM   #8
amaro
Member
 
Registered: Jun 2014
Distribution: Slackware 14.1 on HP 6910p
Posts: 50

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by dunric View Post
A little bit dirty solution, if you'd ask me. Better find out where the brightness get altered and avoid sleeping to work around race condition.
Insipred by Arch Linux wiki you may use an udev rule.
Sleeping is not something I prefer but it works. I decided to try the udev rule you mention and it didn't work. Here is an interesting read on that suggesting there is a bug in kernel 3.14.x (though I am using 3.10) with link to the Arch forum http://eatpeppershothot.blogspot.com...ht-bug-in.html,
If something more elegant come out I will give it a shot.
Thanks!
 
Old 10-03-2014, 02:55 PM   #9
yars
Member
 
Registered: Apr 2012
Location: Russia
Distribution: Slackware64-current
Posts: 249

Rep: Reputation: 24
I'm was the same problem, but I would like to have automatically saving and restoring the brightness. Reading this thread I'm found a solution:
1. To avoid sleeping I'm use a udev rule:
Code:
ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="intel_backlight", RUN+="/etc/udev/brightness.sh restore"
2. To save a brightness state, I'm have a rc.local_shutdown with these lines:
Code:
if [ -x /etc/udev/brightness.sh ] ; then
    /etc/udev/brightness.sh store
fi
3. Here is a script that makes all the work:
Code:
#!/bin/sh

restore() {
    if [ -f /etc/brightness ]; then
	echo -n "Restoring previous brightness value... "
	cat /etc/brightness > /sys/class/backlight/intel_backlight/brightness && echo "Done."
    fi
}

store() {
    echo -n "Saving current brightness value to /etc/brightness... "
    cat /sys/class/backlight/intel_backlight/brightness > /etc/brightness && echo "Done."
}

case $1 in
      store) store;;
    restore) restore;;
          *) echo "Usage: $0 store | restore"
esac

Last edited by yars; 10-03-2014 at 02:57 PM. Reason: Typo fix.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to make system use intel_backlight instad of acpi_video0? Abscissa256 Linux - Hardware 4 10-28-2014 03:26 PM
[SOLVED] Slackware 14.1 xfce4-mixer make capture settings permanent amaro Slackware 2 06-21-2014 08:40 AM
[SOLVED] How to make permanent display settings changes on OpenSUSE? yeri Linux - Newbie 2 01-30-2010 05:23 PM
How do I make my hdparm settings permanent? zmaint Mandriva 2 11-17-2006 12:44 PM
Make duplex settings permanent? rgates Linux - Networking 1 03-07-2006 03:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:13 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