Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 24 May 2016, 21:32
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Change Luminosity, simple and effective
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [17 Posts]   Goto page: 1, 2 Next
Author Message
fabrice_035

Joined: 28 Apr 2014
Posts: 324

PostPosted: Tue 01 Dec 2015, 16:40    Post subject:  Change Luminosity, simple and effective  

Hello,

Cool

Code:

#!/bin/sh

# mini tool ! Easy change luminosity (mouse wheel)
# Fabrice (fxc) 1/12/15

b=`cat /sys/class/backlight/intel_backlight/brightness`
pth="/sys/class/backlight/intel_backlight/brightness"


lumi () {
if [ "$hs" -lt "50" ] ; then
hs="50"
echo $(( $b + $hs )) > /sys/class/backlight/intel_backlight/brightness
exit 0
fi

echo $(( $b + $hs )) > /sys/class/backlight/intel_backlight/brightness

}
export -f lumi


GTKDIALOG=gtkdialog



MAIN_DIALOG='
<window title="Lum" decorated="false"  skip_taskbar_hint="true"  window_position="2">
   
<vbox border-width="1" spacing="1">
   <hbox homogeneous="true">
<button use-stock="true" >  <input file stock="gtk-quit"></input> </button>

   
            <hscale space-expand="true" space-fill="true" range-min="10"  range-max="2000" range-value="'$b'"  range-step="10" tooltip-text="change luminosity">
               <variable>hs</variable>
            <action>lumi</action>
            </hscale>
         </hbox>
         </vbox>

   <variable>MAIN_DIALOG</variable>

</window>
'
export MAIN_DIALOG

case $1 in
   -d | --dump) echo "$MAIN_DIALOG" ;;
   *) $GTKDIALOG  --program=MAIN_DIALOG ;;
esac

Shocked

Bye..
lum.png_2015-12-01_214247.png
 Description   
 Filesize   3.76 KB
 Viewed   437 Time(s)

lum.png_2015-12-01_214247.png

Back to top
View user's profile Send private message 
uio

Joined: 31 Aug 2015
Posts: 73

PostPosted: Tue 01 Dec 2015, 23:25    Post subject:  

I like the idea !
But I just tried it, and it didn't work...
would this be the same thing as brightness ??
Back to top
View user's profile Send private message 
bigpup


Joined: 11 Oct 2009
Posts: 7502
Location: Charleston S.C. USA

PostPosted: Tue 01 Dec 2015, 23:31    Post subject:  

Specifically what device are you doing this on?

Code:
b=`cat /sys/class/backlight/intel_backlight/brightness`
pth="/sys/class/backlight/intel_backlight/brightness"


This indicates to me, it is for a specific device, that uses intel drivers.

_________________
I have found, in trying to help people, that the things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected Shocked
Back to top
View user's profile Send private message 
fabrice_035

Joined: 28 Apr 2014
Posts: 324

PostPosted: Wed 02 Dec 2015, 02:40    Post subject:  

Hi,
My laptop is a Dell E6420.

Search with Google (or other Rolling Eyes ) with "/sys/class/backlight/intel_backlight/brightness" , found solutions i think.

A+
Back to top
View user's profile Send private message 
phat7

Joined: 05 Jun 2015
Posts: 35

PostPosted: Wed 02 Dec 2015, 09:23    Post subject:  

Simple and not effective Shocked
Bye..
Back to top
View user's profile Send private message 
corvus


Joined: 12 Jun 2015
Posts: 86
Location: In the peninsula shaped like a boot.

PostPosted: Mon 08 Feb 2016, 16:13    Post subject:  

Hi fabrice_035, I tried your script on an Asus A555LB with hybrid video card ( Intel / Nvidia ) and works well. Thanks for this little gem. Very Happy

Best Regards.

corvus

_________________
Hoc unum scio, me nihil scire. Isocrate
Back to top
View user's profile Send private message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11916
Location: Arizona USA

PostPosted: Mon 08 Feb 2016, 16:30    Post subject:  

This controls the screen brightness with a scroll wheel? When it works, I mean. Smile
Back to top
View user's profile Send private message 
corvus


Joined: 12 Jun 2015
Posts: 86
Location: In the peninsula shaped like a boot.

PostPosted: Mon 08 Feb 2016, 17:49    Post subject:  

Not everything is for everyone. Cool

corvus

_________________
Hoc unum scio, me nihil scire. Isocrate
Back to top
View user's profile Send private message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11916
Location: Arizona USA

PostPosted: Mon 08 Feb 2016, 21:03    Post subject:  

Thanks for clearing it up. Confused
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 983
Location: Japan

PostPosted: Tue 09 Feb 2016, 01:26    Post subject:  

Flash wrote:
This controls the screen brightness with a scroll wheel? When it works, I mean. Smile

Laughing Yes, when it works.
It doesn't work for me either though I have Intel graphics and the file /sys/class/backlight/intel_backlight/brightness is present. Contains 0 and doesn't do anything when changed to a different value.

What works for me is changing the value in /sys/class/backlight/acpi_video0/brightness. And, to fend off any funny comments, I do not claim that it works for everyone and on any system. You may have to experiment.

Speaking of simplicity I could control brightness with 2 simple scripts, each assigned to its own desktop icon. Works similar as the button on my laptop where I have to press dedicated keys to increase/decrease brightness 1 notch.

Code:
#!/bin/bash
#Decrease brightness
BP=/sys/class/backlight/acpi_video0
AB=$(< $BP/actual_brightness)
((AB>0)) && echo $((AB-1)) > $BP/brightness


Code:
#!/bin/bash
#Increase brightness
BP=/sys/class/backlight/acpi_video0
MB=$(< $BP/max_brightness)
AB=$(< $BP/actual_brightness)
((AB<MB)) && echo $((AB+1)) > $BP/brightness
Back to top
View user's profile Send private message 
drunkjedi


Joined: 24 May 2015
Posts: 156

PostPosted: Tue 09 Feb 2016, 01:41    Post subject:  

There is a brightness script in /usr/sbin of tahr64.
But I don't know how to use it.
It's contents are
Code:
#!/bin/sh
if find /sys/class/backlight/acpi_video0/brightness
then
brightness=`cat /sys/class/backlight/acpi_video0/brightness`
echo $brightness > /root/.config/brightness.conf
fi
Ohh and mine isn't a laptop but a desktop, so I don't know if this will work for me. I generally control brightness from physical buttons.
Back to top
View user's profile Send private message 
fabrice_035

Joined: 28 Apr 2014
Posts: 324

PostPosted: Tue 09 Feb 2016, 07:59    Post subject:  

hi,

of course work fine for me,

Device info, display:

Code:

OpenGL Renderer      : Mesa DRI Intel(R) Sandybridge Mobile x86/MMX/SSE2


My computer is a DELL E6420.
Back to top
View user's profile Send private message 
corvus


Joined: 12 Jun 2015
Posts: 86
Location: In the peninsula shaped like a boot.

PostPosted: Tue 09 Feb 2016, 13:48    Post subject:  

Flash wrote:
Thanks for clearing it up. Confused

I apologise if my answer has offended you but as pointed out by bigpup and MochiMoppel only works with certain hardware and you must anyway experiment.
Greetings to all.

corvus

_________________
Hoc unum scio, me nihil scire. Isocrate
Back to top
View user's profile Send private message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11916
Location: Arizona USA

PostPosted: Tue 09 Feb 2016, 17:09    Post subject:  

I wasn't offended, just not enlightened. Smile
Back to top
View user's profile Send private message 
corvus


Joined: 12 Jun 2015
Posts: 86
Location: In the peninsula shaped like a boot.

PostPosted: Tue 09 Feb 2016, 18:49    Post subject:  

Flash wrote:
I wasn't offended, just not enlightened. Smile

The important thing is to have clarified.

corvus

_________________
Hoc unum scio, me nihil scire. Isocrate

Last edited by corvus on Sat 13 Feb 2016, 06:55; edited 1 time in total
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [17 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0522s ][ Queries: 12 (0.0067s) ][ GZIP on ]