Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Ubuntu User (http://www.linux-archive.org/ubuntu-user/)
-   -   dbus problem (http://www.linux-archive.org/ubuntu-user/126421-dbus-problem.html)

"Oguz Yarimtepe" 07-17-2008 11:32 AM

dbus problem
 
I tried to run the script below to test and adjust my brightness form
console at my hardy. Although i am able to set and get the brightness
values i dont see any change at the backlight. I dont know where to
check. What can be the reason?


Power Manager Brightness Applet is not working, too.

#!/bin/bash
#dependencies : hal and dbus
if [ "x$*" = "x" ]
then
echo ""
echo "Usage : $0 [OPTION]"
echo ""
echo 'Options :'
echo ' get : get the current brightness level'
echo ' up : increase the brightness with one level'
echo ' down : decrease the brightness with one level'
echo ' <level> : set the brigtness level'
exit
fi

dest="org.freedesktop.Hal"
object_path="/org/freedesktop/Hal/devices/computer_backlight_0"
message="org.freedesktop.Hal.Device.LaptopPanel.Ge tBrightness"


#get the current brightness
value="$(dbus-send --system --print-reply --dest="$dest"
"$object_path" "$message" | grep int32 | awk '{print $2}')"

echo "your current brightness level is : $value"

#change the current brightness
if [ "x$1" = "xget" ]
then
echo "your current value is: $value"
exit 0
elif [ "x$1" = "xup" ]
then
value="$(( $value +1 ))"
elif [ "x$1" = "xdown" ]
then
value="$(( $value - 1 ))"
else
value="$1"
fi
message="org.freedesktop.Hal.Device.LaptopPanel.Se tBrightness"
dbus-send --system --print-reply --dest=$dest $object_path $message int32:$value

echo "your new brighness level is :$value"


--
Oğuz Yarımtepe
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users


All times are GMT. The time now is 02:04 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.