ACPI and PMU nearly finished, but I want pretty HAL Icons...

David Zeuthen david at fubar.dk
Wed Jan 19 07:17:23 PST 2005


On Wed, 2005-01-19 at 00:29 +0000, Richard Hughes wrote:
> ACPI and PMU detection code is working as a standalone skeleton
> application (i.e. not calling HAL's functions yet). At the moment it just
> prints out:
> 
> HAL-REGISTER system.battery
> HAL-SET-INT system.battery.number 0
> HAL-SET-BOOL system.battery.present=1
> HAL-SET-BOOL system.battery.is_rechargable=1
> HAL-SET-STRING system.battery.serial=1400041317
> HAL-REGISTER system.ac_adaptor
> HAL-SET-STRING system.ac_adaptor.number=0
> HAL-SET-BOOL system.acadaptor.present=1
> HAL-REGISTER system.processor
> HAL-SET-INT system.processor.number=0
> HAL-SET-BOOL system.processor.can_throttle=0
> HAL-SET-STRING linux.acpi.version=20041210
> HAL-SET-STRING linux.powersystem acpi
> 
> But all of that is got from /proc/acpi, automatically. :-)
> 

Looks good.

> I'm doing the following to probe for devices:
> 
> /* check for ACPI */
> rc = foreach_procfs_object("/proc/acpi", acpi_scan);
> if (rc)
> 	printf("HAL-SET-STRING linux.powersystem acpi\n");
> 
> /* check for PMU */
> rc = foreach_procfs_object("/proc/pmu", pmu_scan);
> if (rc)
> 	printf("HAL-SET-STRING linux.powersystem pmu\n");
> 
> acpi_scan and pmu_scan are functions that are themselves calling:
> if ( g_strcasecmp(item, "ac_adapter") == 0)
>         foreach_procfs_object(procfspath, acpi_procfs_ac_adaptor);
> 
> As to make the adding of "fan", for instance a mere copy paste of 2 lines,
> and a new function to extract the data.
> 
> I've used some quite clever procfs recursion, so in total the code is only
> a couple of hundred lines long. (PMU functions are currently stubbed out.. )
> 
> I'll do some more testing, (and commenting :-) and then I'll post a patch
> here in the next couple of days. Or do you want a link to the pre-alpha
> code?
> 

Nah, just send the patch when you're ready and we can go over it here
on the list. I just committed a lot of code yesterday to HEAD so
you should base it off HEAD. 

> Because it's yet again gone past midnight, I've switched my less geeky
> side. Icons.
> 
> How do I link a png icon to it's device type? I'm going to need lots of
> new icons....
> 

See hal-device-manager - don't get too attached to this program, it
may become irrelevant once we get a real DeviceManager desktop 
program.

Thanks,
David


_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list