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 Thu 24 Apr 2014, 13:48
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
backlight settings cl script
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [3 Posts]  
Author Message
Karl Godt


Joined: 20 Jun 2010
Posts: 3861
Location: Kiel,Germany

PostPosted: Fri 01 Jun 2012, 15:58    Post subject:  backlight settings cl script
Subject description: netbook was having "0" in daylight
 

Good day !

Today i booted my netbook to find having set a zero in

" /sys/class/backlight/acpi_video0/brightness " .

I remember iguleder had a small c binary in his squeeze dpup times nearly two years ago , but that had not been accessible for me today .

So i hug a script called " set_bl " -- if anyone discovers bugs or different paths or max values, please let me know :

Code:
#!/bin/sh
# Wriiten by Karl Reimer Godt
# Applies the usual "Puppy License"
Version='1.0 Puppy-Linux-Racy_5.3 KRG'

bckl_dir=`echo -e /sys/class/backlight/*/`
curr_file=/sys/class/backlight/*/actual_brightness
set_file=/sys/class/backlight/*/brightness
max_file=/sys/class/backlight/*/max_brightness
uevent_file=/sys/class/backlight/*/uevent

usage(){
MSG="
$0 [list|info|help|version] [ # [FILENAME]]

Script to set the display brightness for Laptops.
Defaultfilename : /sys/class/backlight/*/brightness

"
if [ "$2" ];then
MSG="$MSG

$2"
fi
echo "$MSG"
[ "$DISPLAY" ] && xmessage -bg blue3 "$MSG"
exit $1
}

case $1 in
help) usage 0;;
version) echo -e "\n$0: Version '$Version'\nTry help for more info\n"
exit 0;;
list) if find /sys -name "backlight" ;then :
else echo "No backlight support detected. Did the driver load?"
exit 1;fi
ls -1 /sys/class/backlight/*/
exit $?
;;
info)


echo "GENERAL INFO:"
ls -l $uevent_file |rev|sed 's- -\n-'|rev
CONT=`cat $uevent_file`
[ "$CONT" ] || CONT='No entry.'
echo "$CONT"
echo

echo "CURRENT:"
ls -l $curr_file |rev|sed 's- -\n-'|rev
CONT=`cat $curr_file`
[ "$CONT" ] || CONT='No entry.'
echo "CUR_SET='$CONT'"

echo

echo "SET AS:"
ls -l $set_file |rev|sed 's- -\n-'|rev
CONT=`cat $set_file`
[ "$CONT" ] || CONT='No entry.'
echo "_SET='$CONT'"

echo

echo "MAXIMUM to be SET TO:"
ls -l $max_file |rev|sed 's- -\n-'|rev
CONT=`cat $max_file`
[ "$CONT" ] || CONT='No entry.'
echo "MAX_SET='$CONT'"

;;

[0-9]*)
VAL=$1

if [ "$2" ];then
[ -e "$2" ] || usage 1 "'$2' does not exist."
[ -d "$2" ] && usage 1 "Is a directory."
[ -f "$2" ] || usage 1 "Not a regular file."
echo $VAL > "$2"
exit $?;fi

if find $bckl_dir -name "brightness";then
echo $VAL > $bckl_dir/brightness
else
usage 1 "Not Found."
fi
exit $?
;;
"") usage 1 "Need Parameter.";;
*) usage 1 "Unknown Parameter.";;
esac
Back to top
View user's profile Send private message Visit poster's website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3861
Location: Kiel,Germany

PostPosted: Wed 07 Aug 2013, 05:21    Post subject:  

Update :

Want first to say that the kernel acpi driver named video.ko apparently is responsible for creating sysfs files .
I detected it while running with the video.ko driver blacklisted .
Code:
/sbin/modprobe -v --first-time video brightness_switch_enabled=1

issues
Quote:
insmod /lib/modules/2.6.30.9-KRG-i486-compiled-AcerLaptop-rev1/kernel/drivers/acpi/video.ko brightness_switch_enabled=1


My script named as set_backlight
Code:
set_backlight info

issues
Quote:
GENERAL INFO:
/sys/class/backlight/acpi_video0/uevent
-rw-r--r-- 1 root root 4096 Aug 7 10:31
No entry.

CURRENT:
/sys/class/backlight/acpi_video0/actual_brightness
-r--r--r-- 1 root root 4096 Aug 7 10:31
CUR_SET='12'

SET AS:
/sys/class/backlight/acpi_video0/brightness
-rw-r--r-- 1 root root 4096 Aug 7 10:31
_SET='0'

MAXIMUM to be SET TO:
/sys/class/backlight/acpi_video0/max_brightness
-r--r--r-- 1 root root 4096 Aug 7 10:31
MAX_SET='15'

Code:
set_backlight 10

works for me currently running kernel 2.6.30.9 on Asus EeePC 1005HAG (also the Fn F5/F6 keys to step down/up the backlight) .

Reference to Thread that woke me up >
Laptop Brightness Issues- Toshiba T115d/Precise 5.7 (Solved)
http://murga-linux.com/puppy/viewtopic.php?t=87819
Back to top
View user's profile Send private message Visit poster's website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3861
Location: Kiel,Germany

PostPosted: Wed 07 Aug 2013, 05:46    Post subject:  

Finally found Iguleder|'s (Dima Krassner|'s) acpi researches :

ppower 1 http://murga-linux.com/puppy/viewtopic.php?p=454711&search_id=89015258#454711
ppower 2+3 http://murga-linux.com/puppy/viewtopic.php?p=458624&search_id=89015258#458624

Power saving tweaks http://murga-linux.com/puppy/viewtopic.php?p=442436&search_id=1283945961#442436
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [3 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
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.0575s ][ Queries: 11 (0.0141s) ][ GZIP on ]