Hi folks,
Was anybody able to make XFCE's battery monitor plugin work in NetBSD 9.1?
I've done some research (works with APM and ACPI), looked into the source code of the plugin (there is a "patch" for NetBSD) but I haven't found any way to make it work:
#if defined(__OpenBSD__) || defined(__NetBSD__)
/* Code for OpenBSD by Joe Ammond <jra@twinight.org>. Using the same
procedure as for FreeBSD.
Made to work on NetBSD by Stefan Sperling <stsp@stsp.in-berlin.de>
*/
struct apm_power_info apm;
int fd;
fd = open(APMDEVICE, O_RDONLY);
if (fd == -1) return TRUE;
if (ioctl(fd, APM_IOC_GETPOWER, &apm) == -1)
return TRUE;
close(fd);
charge = apm.battery_life;
time_remaining = apm.minutes_left;
acline = apm.ac_state ? TRUE : FALSE;
method = BM_USE_APM;
My instance displays the following:
[ 1.032653] apm0 at acpi0: Power Management spec V1.2
And the apm command works like a charm:
Battery charge state: high
Battery remaining: 100 percent
A/C adapter state: connected
Power management enabled
Number of batteries: 1
It looks like I'm missing something or the version shipped with pkgin (xfce4-battery-plugin-1.1.3nb4) doesn't include the patch, which I doubt as the code above is available in the mainstream version.
Does anyone have the same issue? By the way, I'm running NetBSD on a cutting edge Asus EeePC 1005P 🙂 which, indeed, is back to life thanks to NetBSD and an SDD disk.
Thanks in advance.
bsdprof