You should be able to edit your /usr/bin/startx script to grep
/proc/acpi/ac_adapter/state for "on" or "off."  Then, if AC is
on-line, you can use an xorg.conf with DRI, and if it's off-line, you
can start without DRI.

Something like this around line 35 on startx should do the trick:
if [ -z "$(grep "on" /proc/acpi/ac_adapter/AC/state)" ] ; then
   $defaultserverargs="$defaultserverargs -config /etc/X11/xorg.conf-nodri"
fi

With, of course, an appropriate "no dri" config file laying in wait.
I haven't tested this code, but it should be a decent starting point.
Of course, as you said, you'll have to restart X every time you change
AC states.


On 5/21/07, Flyser <[EMAIL PROTECTED]> wrote:
As I use the DRI extension of X.org from time to time, I was wondering
if it is possible to disable it, when on battery. But think neither X
nor fglrx does support it, thats why I created a "mobile" runlevel, now
I was wondering I it is possible to let X.org check if the system is in
this runlevel and disable dri in this case. This requires X to restart,
but better than nothing ;)
_______________________________________________
Power mailing list
[email protected]
http://www.bughost.org/mailman/listinfo/power



--
# Kurt H Maier
_______________________________________________
Power mailing list
[email protected]
http://www.bughost.org/mailman/listinfo/power

Reply via email to