Dialogue of shutdown, sleep, reboot PC
Dialogue of shutdown, logout, sleep, reboot PC
https://github.com/govnorice/powerdialog/assets/80642969/c9da78da-2c6e-497f-b96e-89570ffad2ca
Just install the package from the AUR, damn it!
yay -S powerdialog
cd download_location
chmod +x powerdialog
sudo mv powerdialog /usr/bin/powerdialog
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.login1.power-off" ||
action.id == "org.freedesktop.login1.reboot" ||
action.id == "org.freedesktop.login1.suspend" ||
action.id == "org.freedesktop.login1.hibernate") {
if (subject.user == "root" &&
subject.process.binary == "/usr/bin/powerdialog") {
return polkit.Result.YES;
}
}
});
sudo systemctl restart polkit.service
hyprland example:
bind = $mainMod, P, exec, powerdialog