Mapping form factor

Kay Sievers kay.sievers at vrfy.org
Thu Jul 2 07:32:18 PDT 2009


On Thu, Jul 2, 2009 at 16:11, Richard Hughes<hughsient at gmail.com> wrote:
> One of the nice things about DMI data is that it gives you the form
> factor of the device, so you can choose sensible defaults for laptops,
> servers and handhelds. This data is exported in HAL, but not
> DeviceKit-*
>
> What about something like this:
>
> SUBSYSTEM!="dmi", GOTO="dkp_formfactor_end"
>
> ATTR{chassis_type}=="3", ENV{DKP_FORMFACTOR}="desktop"          # Desktop
> ATTR{chassis_type}=="4", ENV{DKP_FORMFACTOR}="desktop"          # Low Profile Desktop
> ATTR{chassis_type}=="5", ENV{DKP_FORMFACTOR}="server"           # Pizza Box
> ATTR{chassis_type}=="6", ENV{DKP_FORMFACTOR}="desktop"          # Mini Tower
> ATTR{chassis_type}=="7", ENV{DKP_FORMFACTOR}="desktop"          # Tower
> ATTR{chassis_type}=="8", ENV{DKP_FORMFACTOR}="laptop"           # Portable
> ATTR{chassis_type}=="9", ENV{DKP_FORMFACTOR}="laptop"           # Laptop
> ATTR{chassis_type}=="10", ENV{DKP_FORMFACTOR}="laptop"          # Notebook
> ATTR{chassis_type}=="11", ENV{DKP_FORMFACTOR}="handheld"        # Hand Held
> ATTR{chassis_type}=="12", ENV{DKP_FORMFACTOR}="laptop"          # Docking Station
> ATTR{chassis_type}=="14", ENV{DKP_FORMFACTOR}="laptop"          # Sub Notebook
> ATTR{chassis_type}=="15", ENV{DKP_FORMFACTOR}="desktop"         # Space-saving
> ATTR{chassis_type}=="17", ENV{DKP_FORMFACTOR}="server"          # Main Server Chassis
> ATTR{chassis_type}=="28", ENV{DKP_FORMFACTOR}="server"          # Blade
>
> LABEL="dkp_formfactor_end"
>
> This seems to be the sort of thing I would need for
> gnome-power-manager, but doesn't seem to work. Is this a good idea, or
> should I just do the mapping in C?

No, better don't stuff things into the dmi device, not all platforms have that.

This?  http://cgit.freedesktop.org/~david/xdg-hostname/

Kay


More information about the devkit-devel mailing list