polkit.addRule(function(action, subject) { if (action.id == "org.freedesktop.login1.set-brightness" && subject.local && subject.active) { return polkit.Result.YES; } });