Dialogue of shutdown, logout, sleep, reboot PC
2024-05-06.14-09-09.mp4
Just install the package from the AUR, damn it!
yay -S powerdialog
- Download executable file and move to /usr/bin:
cd download_location
chmod +x powerdialog
sudo mv powerdialog /usr/bin/powerdialog
- Create polkit rule in "/etc/polkit-1/rules.d/powerdialog.rules":
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;
}
}
});
- Restart polkit service
sudo systemctl restart polkit.service
hyprland example:
bind = $mainMod, P, exec, powerdialog