mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
15 lines
612 B
Plaintext
15 lines
612 B
Plaintext
polkit.addRule(function(action, subject) {
|
|
if (action.id == "com.local.battery-manager.ACTUAL_USER_PLACEHOLDER" &&
|
|
subject.user == "ACTUAL_USER_PLACEHOLDER") {
|
|
|
|
// Check if the parent process is quickshell or set-battery-threshold
|
|
var pid = subject.pid;
|
|
var ppid = polkit.spawn(["ps", "-o", "ppid=", "-p", pid.toString()]).trim();
|
|
var parentCmd = polkit.spawn(["ps", "-o", "comm=", "-p", ppid]).trim();
|
|
|
|
if (parentCmd.indexOf("quickshell") !== -1 || parentCmd.indexOf("set-battery-treshold") !== -1) {
|
|
return polkit.Result.YES;
|
|
}
|
|
}
|
|
});
|