emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] battery.el, upower fixes


From: Stefan Monnier
Subject: Re: [PATCH] battery.el, upower fixes
Date: Tue, 04 Feb 2020 18:10:58 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>>> +(defcustom battery-upower-device
>>> +  (dbus-ignore-errors
>>> +    (battery-upower-device-autodetect :battery))
>>
>> I think there's a possibility that the set of devices changes over time
>> (e.g. on my machine (battery-upower-device-list) currently only shows
>> battery_BAT0, but I can insert a second battery and I'd expect the list
>> to then include a battery_BAT1 as well).  So maybe we should instead
>> allow a special value (e.g. nil) to mean "autodetect" and then do the
>> autodetection dynamically.  WDYT?
>
> Usually, D-Bus services send a signal when a device is added/removed. IIUC
> https://upower.freedesktop.org/docs/UPower.html,
> org.freedesktop.UPower.DeviceAdded and org.freedesktop.UPower.DeviceRemoved
> serve for that purpose. So you shall subscribe to those signals and
> handle them accordingly.

Sure, but you wouldn't want to set a `defcustom` in response to that, so
the `defcustom` should have a separate setting to mean "autodetect".


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]