Thank you for the information.
I've put some scripts in each of the directories that really make the laptop work well so far ;)
Just in case others are having battery life problems with laptops installing tuned an tuned-profiles-compat on the laptop, and putting this script in the /etc/pm/power.d directory makes a big difference in battery life.
#!/bin/sh
# 00-powermodes
case $1 in
true)
tuned-adm profile laptop-battery-powersave
;;
false)
tuned-adm profile balanced
;;
*) echo "ERROR: used incorrectly."
;;
esac
the file should name should start with 00 to 20 so I called my file 00-powermodes
As well I had a suspend and resume problem with the backlight on my Dell XPS 13 (Intel GMA 4000).. after a suspend and resume, the backlight would could not be adjusted, and was set to max brightness.
In order to fix this I put this script in /etc/brightness/fixbr.sh
#!/bin/sh
case $1 in
awake)
echo "000" > /sys/class/backlight/intel_backlight/brightness
echo "200" > /sys/class/backlight/intel_backlight/brightness
echo "000" > /sys/class/backlight/intel_backlight/brightness
if [ -f /etc/brightness/brightness ]
then
br_val=`head --lines 1 /etc/brightness/brightness`
echo $br_val > /sys/class/backlight/acpi_video0/brightness
fi
;;
suspend)
echo `cat /sys/class/backlight/acpi_video0/brightness` > /etc/brightness/brightness
;;
*) echo "ERROR: used incorrectly."
;;
esac
What this does is saves the current brightness value and restores it when the laptop is woken up or booted.. For some strange reason "poking" the brightness in the first 3 lines of the awake case statement seems to fix the brightness so that it can be then controlled by acpi_video0 properly.. Others might be able to modify this for other graphic chipsets by looking in the /sys/class/backlight directory and seeing what the graphics chipset that their laptop has uses.
/
Ok one last thing to get this working was I had to put a script in /lib/systemd/system-sleep called screenfix.sh
It looks like this
#!/bin/sh
case $1 in
pre)
/etc/brightness/fixbr.sh suspend
;;
post)
/etc/brightness/fixbr.sh awake
;;
*) echo "ERROR: used incorrectly."
;;
esac
I also set a link in the /lib/systemd/system-shutdown to screenfix.sh
ln -s /lib/systemd/system-sleep/screenfix.sh /lib/systemd/system-shutdown/screenfix.sh
So now when the laptop is shut down or sleeps, it saves it's current screen brightness :)
TAGS FOR GOOGLE: fedora brightness backlight laptop notebook power save.
Hope this will save people a lot of googling. Is this something that could be submitted to the developers as patch?