Mapping form factor

Martin Pitt martin.pitt at ubuntu.com
Thu Jul 2 09:30:11 PDT 2009


Richard Hughes [2009-07-02 17:08 +0100]:
> So, I do need another property regardless to inform the prefs ui if
> the machine has a closable lid or not. We know this as we already
> monitor and export a property about the lid state.

I agree, forming default policies based on "how many batteries"/"lid"
etc. makes sense.

> Ignoring form factor for a little bit, how about a property
> "has-closable-lid" or does this imply "is-laptop"?

Fortunately lids are input devices nowadays, so udev (and thus gudev)
already knows them:

P: /devices/LNXSYSTM:00/device:00/PNP0C0D:00/input/input0
E: UDEV_LOG=3
E: DEVPATH=/devices/LNXSYSTM:00/device:00/PNP0C0D:00/input/input0
E: PRODUCT=19/0/5/0
E: NAME="Lid Switch"
E: PHYS="PNP0C0D/button/input0"
E: EV==21
E: SW==1
E: MODALIAS=input:b0019v0000p0005e0000-e0,5,kramlsfw0,

Would it be possible for g-p-m to query for this?

On a related note, I had always wished g-p-m (and GNOME in general)
had a separate mode/policy for "laptop is docked", i. e. this exists:

P: /devices/platform/dock.0
E: UDEV_LOG=3
E: DEVPATH=/devices/platform/dock.0
E: MODALIAS=platform:dock

It's less interesting for g-p-m itself, since it's a special case of
"on AC", but it's the same conceptual question for the xrandr control
applet ("when docked, disable internal screen and use full
resolution", etc.).

I wouldn't like to accumulate those "flags" on a central device, I'd
rather make it easier to ask udev "does such a device exist".

Martin

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)


More information about the devkit-devel mailing list