EDIT: Forget this. There are two fixes:
- With sys-auth-polkit-126-r1, a .policy file under /etc to override /usr/share/polkit-1/actions/org.xfce.power.policy;
- upgrade to >=sys-auth/polkit-126-r2 and leave the .policy files alone.
Either fix works. Together, they don't.
My post described a
third fix to reconcile the first two. It works, but it's kind of stoopid. Don't do it. Ditch the .policy file under /etc and upgdate polkit.
And
bug 959152 is indeed fixed. Apologies to Sam.
== Leaving my original post below for documentation only. Don't patch! Upgrade polkit. ==
=========================================================================================
GAAAH ! It's happening again, after an update.
sys-auth/polkit was one of the updated packages.
- I'm on a merged-user profile; /usr/sbin is symlinked to /usr/bin.
- I have a file /etc/polkit-1/actions/org.xfce.power.policy, as mentioned earlier in this thread, but that is not enough.
I have a band-aid.
Code: Select all
diff --git a/common/xfpm-brightness-polkit.c b/common/xfpm-brightness-polkit.c
--- a/common/xfpm-brightness-polkit.c
+++ b/common/xfpm-brightness-polkit.c
@@ -80,7 +80,7 @@
gchar *stdout_data = NULL;
gint status;
gint value = -1;
- gchar *command = g_strdup_printf (SBINDIR "/xfpm-power-backlight-helper --%s", argument);
+ gchar *command = g_strdup_printf ("/usr/bin" "/xfpm-power-backlight-helper --%s", argument);
XFPM_DEBUG ("Executing command: %s", command);
if (!g_spawn_command_line_sync (command, &stdout_data, NULL, &status, &error)
@@ -155,7 +155,7 @@
{
GError *error = NULL;
gint status;
- gchar *command = g_strdup_printf ("pkexec " SBINDIR "/xfpm-power-backlight-helper --set-brightness %i", level);
+ gchar *command = g_strdup_printf ("pkexec " "/usr/bin" "/xfpm-power-backlight-helper --set-brightness %i", level);
XFPM_DEBUG ("Executing command: %s", command);
if (!g_spawn_command_line_sync (command, NULL, NULL, &status, &error)
@@ -193,7 +193,7 @@
{
GError *error = NULL;
gint status;
- gchar *command = g_strdup_printf ("pkexec " SBINDIR "/xfpm-power-backlight-helper --set-brightness-switch %i", _switch);
+ gchar *command = g_strdup_printf ("pkexec " "/usr/bin" "/xfpm-power-backlight-helper --set-brightness-switch %i", _switch);
if (!g_spawn_command_line_sync (command, NULL, NULL, &status, &error)
|| !g_spawn_check_wait_status (status, &error))
If you want to use this patch,
do not copy-paste from the display. Instead, click to reply to the post, copy-paste from the edit box and close the edit window.
DO NOT APPLY THE PATCH ON A SPLIT-USR PROFILE.
I think the bug is in polkit, probably
https://bugs.gentoo.org/959152 but I ended up patching
xfce4-power-manager instead, for the following reasons.
- I ran script -c "dbus-monitor --system" and tried to change the backlight level.
- I was asked to authenticate.
- The dbus trace had references to /usr/bin/xfpm-power-backlight-helper, so the policy file in /etc took effect.
- But there are still references to /usr/sbin/xfpm-power-backlight-helper.
- Those references seem to come from xfce4-power-manager, hence the above patch.
- After rebuilding, logging out and logging back in, the backlight controls work.
The bug is marked as fixed, but obviously it isn't. My band-aid is
not the right fix, but it works for now.
For completeness: full list of updated packages:
Code: Select all
2025-08-09T09:03:13 >>> dev-perl/Crypt-URandom-0.540.0
2025-08-09T09:03:24 >>> dev-perl/Authen-SASL-2.190.0
2025-08-09T09:03:36 >>> sys-apps/util-linux-2.41.1-r1
2025-08-09T09:05:26 >>> dev-libs/nettle-3.10.2
2025-08-09T09:06:01 >>> net-libs/gnutls-3.8.10
2025-08-09T09:08:11 >>> sys-fs/cryptsetup-2.8.0
2025-08-09T09:08:46 >>> dev-lang/rust-bin-1.88.0
2025-08-09T09:09:23 >>> dev-python/ensurepip-pip-25.1.1-r1
2025-08-09T09:09:43 >>> sys-kernel/ugrd-2.0.2
2025-08-09T09:10:01 >>> sys-auth/polkit-126-r2
2025-08-09T09:10:25 >>> sys-devel/binutils-2.44-r4
2025-08-09T09:12:26 >>> sys-apps/pciutils-3.14.0
2025-08-09T09:12:41 >>> sys-kernel/installkernel-60
2025-08-09T09:12:53 >>> gui-libs/libwlembed-0.0.0_pre20250715
2025-08-09T09:13:18 >>> xfce-extra/xfce4-screensaver-4.20.0-r1
2025-08-09T09:13:44 >>> xfce-base/thunar-4.20.4
2025-08-09T09:50:32 >>> sys-auth/polkit-126-r2
2025-08-09T15:58:23 >>> xfce-base/xfce4-power-manager-4.20.0
The practical unit of "Learning Experience" is the milli-Gentoo.