Re: Battery display generates ACPI events (stops X from powering off display)

Bill WIlson <[email protected]>
Newsgroups gmane.comp.gnome.apps.gkrellm
Message-ID <[email protected]>
On Thu, 2 Aug 2007 22:35:48 -0700
Gautam Iyer <[email protected]> wrote:

> Aha. So doing this showed that gkrellm reads
> 
>     /proc/acpi/ac_adapter/AC0/state
> 
> Now just cat'ing that file generates the above ACPI event and cause X to
> wake my monitor up from sleep.
> 
> Any idea what I can do about this? This certainly looks like a bug to
> me. But I'm not sure where to report it. Linux kernel?
> 
> Also, as a work-around, is there some quick hack I can do to gkrellm to
> avoid it reading that file? I'm getting quite tired of my scripts that
> kill gkrellm after 10 mins of inactivity...

You can apply this patch to the setup_ac_adapter() function in src/sysdeps/linux.c
to make gkrellm quit reading that file:

--- linux.c.orig	2007-08-03 09:29:12.836923445 -0500
+++ linux.c	2007-08-03 09:31:07.025742175 -0500
@@ -1488,6 +1488,8 @@
 	{
 	gchar	*path;
 
+	return FALSE;
+
 	path = get_acpi_battery_file(ACPI_AC_ADAPTOR_DIR, ac, "state");
 	if (!path)
 		path = get_acpi_battery_file(ACPI_AC_ADAPTOR_DIR, ac, "status");

The ac_adapter file has not always been available for some laptop/kernel versions,
so gkrellm already tries as a backup to assume on line state from BAT0 file charging
states when the ac_adapter file is missing.  So the battery monitor has a good chance
of continuing to work fine for you.

It does seem like an acpi bug to me.  Maybe you could get some help from one of the
acpi mailing lists at http://acpi.sourceforge.net.

Bill
_______________________________________________
Gkrellm mailing list
[email protected]
http://lists.jutley.org/cgi-bin/mailman/listinfo/gkrellm
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.