Created attachment 7467 Add support for XF86Battery button This button is already grabbed by xfpm but its events just getting ignored. A long time ago this button caused battery notification to appear https://git.xfce.org/xfce/xfce4-power-manager/commit/src/xfpm-battery.c?id=2606edb1adedbe974034184d71575205a2b68fe4 Bringing this behavior back is much harder now since there may be multiple batteries installed but only single notification instance is used in xfpm. This behavior of notifications in XfpmBattery classes should be refactored in my opinion but that's another topic. For now I'm suggesting to add a new picker in settings allowing to choose what to do when battery button pressed: nothing, suspend, hibernate or ask. Probably in the future we can add an additional "show status" action.
There are some issues with the patch, e.g. here: @@ -250,6 +251,7 @@ xfpm_settings_app_launch (GApplication *app) has_sleep_button = xfpm_string_to_bool (g_hash_table_lookup (hash, "sleep-button")); has_power_button = xfpm_string_to_bool (g_hash_table_lookup (hash, "power-button")); has_hibernate_button = xfpm_string_to_bool (g_hash_table_lookup (hash, "hibernate-button")); + has_power_button = xfpm_string_to_bool (g_hash_table_lookup (hash, "power-button")); can_shutdown = xfpm_string_to_bool (g_hash_table_lookup (hash, "can-shutdown")); Obviously the "has_power_button" variable should be renamed to "has_battery_button".
Created attachment 7470 Add support for XF86Battery button Yes, I accidentally removed the changes first time so I had to rewrite them again with less attention. This is not the only place where I messed up with replacements. I'm attaching a new patch.
I noticed, I was just too lazy to point all of them out ;) I'll review/test then. Thanks! Regarding the show-status feature: Not really sure what to show there.
> Regarding the show-status feature: Not really sure what to show there. Show notification with state of all batteries. Just like it was before in 2014 but with multiple batteries on single notification support. As I told before in #xfce-dev, battery-specific notifications aren't informative. I'd suggest to remove notification support from XfpmBattery and move them all to XfpmPower. This new notification should show a state of all batteries in single popup window. For single-battery users everything remains the same, for multi-battery users it will be much informative. But that's the topic for another bug.
Viktor Odintsev referenced this bugreport in commit ebb984e33b6daf6ce320140ff4c31d533d6a3cee Add support for XF86Battery button (Bug #14055) https://git.xfce.org/xfce/xfce4-power-manager/commit?id=ebb984e33b6daf6ce320140ff4c31d533d6a3cee
Decided to merge only after releasing 1.6.1 as introducing new strings would have further delayed the (long-awaited) release. Thanks for the patch!