Post Ahw8imxr5ierXdmsL2 by kristof@pleroma.marussy.com
 (DIR) More posts by kristof@pleroma.marussy.com
 (DIR) Post #Ahw8imxr5ierXdmsL2 by kristof@pleroma.marussy.com
       2024-04-01T22:00:39.550436Z
       
       0 likes, 0 repeats
       
       Thinking about binding a key combination to restart services that tend to misbehave. First up, logid.service, which configures my mouse, but sometimes fails to do so (due to udev shenanigans I'm not patient enough to debug, probably)I can tell polkit that I don't need a password to restart this service:// https://stackoverflow.com/a/63729664polkit.addRule(function(action, subject) {    if (action.id == "org.freedesktop.systemd1.manage-units" &&        action.lookup("unit") == "logid.service" &&        subject.isInGroup("wheel")) {        return polkit.Result.YES;    }});(NOPASSWD sudo would be equally effective, and I am not sure which is creepier between that and this javascript mess)Now I can bind a #sway key combo like this:bindsym $mod+Shift+s exec systemctl restart logid.serviceHa! if my mouse forgets how to scroll, I just have to punch Super+Shift+s :ablobfoxbongo: