File gnome-settings-daemon-more-power-button-actions.patch of Package gnome-settings-daemon
diff --unified --recursive --text --new-file --color -x subprojects gnome-settings-daemon-48.0.old/data/gnome-settings-daemon/gsd-enums.h gnome-settings-daemon-48.0.new/data/gnome-settings-daemon/gsd-enums.h
--- gnome-settings-daemon-48.0.old/data/gnome-settings-daemon/gsd-enums.h 2025-03-17 21:08:20.000000000 +0800
+++ gnome-settings-daemon-48.0.new/data/gnome-settings-daemon/gsd-enums.h 2025-03-20 13:04:44.137390428 +0800
@@ -105,6 +105,7 @@
typedef enum
{
GSD_POWER_BUTTON_ACTION_NOTHING,
+ GSD_POWER_BUTTON_ACTION_SHUTDOWN,
GSD_POWER_BUTTON_ACTION_SUSPEND,
GSD_POWER_BUTTON_ACTION_HIBERNATE,
GSD_POWER_BUTTON_ACTION_INTERACTIVE
diff --unified --recursive --text --new-file --color -x subprojects gnome-settings-daemon-48.0.old/plugins/media-keys/gsd-media-keys-manager.c gnome-settings-daemon-48.0.new/plugins/media-keys/gsd-media-keys-manager.c
--- gnome-settings-daemon-48.0.old/plugins/media-keys/gsd-media-keys-manager.c 2025-03-17 21:08:20.000000000 +0800
+++ gnome-settings-daemon-48.0.new/plugins/media-keys/gsd-media-keys-manager.c 2025-03-20 13:04:44.143659944 +0800
@@ -2137,6 +2137,9 @@
}
switch (action_type) {
+ case GSD_POWER_BUTTON_ACTION_SHUTDOWN:
+ do_config_power_action (manager, GSD_POWER_ACTION_SHUTDOWN, in_lock_screen);
+ break;
case GSD_POWER_BUTTON_ACTION_SUSPEND:
action = GSD_POWER_ACTION_SUSPEND;
break;