Page 1 of 1

Question about PolicyKit1 KDE Agent message

Posted: 6. Apr 2025, 16:26
by coaxguy99
Hello,

I'm new to Salix. I installed KDE and everything is working well. However, there is one annoying message I would like to resolve so hoping someone here can assist. When I first log into Plasma (x11) I receive a message that states the following:

System policies prevent you from getting the current battery charge limit.

An application is attempting to perform an action that requires privileges. Authentication is required to perform this action.

Password: (fil in)

My password that I set up at time of install works fine. I just want to figure out how to lset this so I don't have to enter a password... i.e. edit whatever file I need to grant the proper authorization to automate the process.

Other than this little issue, I'm enjoying this distro, so far. Thank you in advance for your assistance!

Re: Question about PolicyKit1 KDE Agent message

Posted: 7. Apr 2025, 11:24
by gapan
Do you have the polkit-kde-agent package installed?

Does the message say anything about which policy exactly it needs?

Re: Question about PolicyKit1 KDE Agent message

Posted: 7. Apr 2025, 18:14
by coaxguy99
Yes. I do have the Polkit agent installed. When I click "details", I get the following:

Action: Get current battery charger limit
ID: org.kde.powerdevil.chargethresholdhelper.getthreshold
Vendor: KDE
polkit.subject-pid: 1416
polkit.caller-pid: 1520

Re: Question about PolicyKit1 KDE Agent message

Posted: 7. Apr 2025, 20:13
by gapan
Try this: create a file /etc/polkit-1/rules.d/40-kde.powerdevil.rules with the following contents:

Code: Select all

polkit.addRule(function(action, subject) {
    if ((action.id == "org.kde.powerdevil.chargethresholdhelper.getthreshold") &&
        subject.isInGroup("plugdev")) {
        return polkit.Result.YES;
    }
});
You'll probably need to log out and log back in.

Re: Question about PolicyKit1 KDE Agent message

Posted: 7. Apr 2025, 20:58
by coaxguy99
That worked to get rid of the first error but now I get one that says

System policies prevent you from getting the brightness level (and asking for the password).

This one says

Action: Get brightness
ID org.kde.powerdevil.backlighthelper.brightness
polkit.subject-pid: 1434
polkit.caller-pid: 1523

I tried creating another file /etc/polkit-1/rules.d/50-kde.powerdevil.rules and having both files in there.

polkit.addRule(function(action, subject) {
if ((action.id == "org.kde.powerdevil.backlighthelper.brightness") &&
subject.isInGroup("plugdev")) {
return polkit.Result.YES;
}
});

But after rebooting, the brightness level error still came up.

Re: Question about PolicyKit1 KDE Agent message

Posted: 7. Apr 2025, 21:44
by gapan
Delete that new file and try editing the first file to this:

Code: Select all

polkit.addRule(function(action, subject) {
    if ((action.id == "org.kde.powerdevil.chargethresholdhelper.getthreshold" ||
        action.id == "org.kde.powerdevil.backlighthelper.brightness") &&
        subject.isInGroup("plugdev")) {
        return polkit.Result.YES;
    }
});

Re: Question about PolicyKit1 KDE Agent message

Posted: 9. Apr 2025, 20:39
by coaxguy99
That didn't work for the brightness warning. Is there a simpler way to grant permissions, perhaps through the group file (sudoers)? I can enter my password everytime I re-boot but I'm hoping I don't have to do that. Otherwise, I may just get used to XFCE. The Salix implementation may be the best I've ever come across, right out of the box. Nice job making XFCE look great.

Re: Question about PolicyKit1 KDE Agent message

Posted: 9. Apr 2025, 21:54
by gapan
That's weird. It should work. Are you sure you have the ID correct? Or perhaps you're getting a different ID now?

Re: Question about PolicyKit1 KDE Agent message

Posted: 10. Apr 2025, 11:53
by coaxguy99
I figured it out. Ended up looking like this:

40-kde.powerdevil.rules

polkit.addRule(function(action, subject) {
    if ((action.id == "org.kde.powerdevil.chargethresholdhelper.getthreshold" ||
        action.id == "org.kde.powerdevil.backlighthelper.brightness"
        ||
        action.id == "org.kde.powerdevil.backlighthelper.brightnessmax"
        ||
        action.id == "org.kde.powerdevil.backlighthelper.syspath"
        ||
        action.id == "org.kde.kded.smart.smartctl"
        ||
        action.id == "org.kde.powerdevil.backlighthelper.setbrightness") &&
        subject.isInGroup("plugdev")) {
        return polkit.Result.YES;
    }
});