A Guide to fixing Polkit Authentication Agents on Arch Linux.
If you run a minimal Wayland compositor like MangoWC, Sway, or Hyprland, you may run into a common, frustrating issue: when a graphical application (like GParted, a System Settings tool, or a package manager) requires administrative privileges, you get no password prompt, or worse, a terminal password prompt that blocks your workflow.
This happened to me recently, and here is the breakdown of why it occurs and how to fix it on Arch Linux.
Polkit is Running, but the Agent is Missing
The core issue is a missing Graphical Polkit Authentication Agent. Polkit is a two-part system:
- The Daemon (
polkitd): This is the core service that processes authorization requests. - The Agent (
polkit-gnome-authentication-agent-1,xfce-polkit, etc.): This is the user-facing application that provides the graphical dialogue box for you to enter your password.
My system outputs confirmed the issue:
| |
The Solution: Install and Autostart a Wayland-Compatible Agent
Since Wayland compositors like Hyprland, MangoWC don’t include a full Desktop Environment stack, the authentication agent must be installed and manually added to the compositor’s startup script.
MangoWC recommends xfce-polkit, for Hyprland the hyprpolkitagent is an option, however a robust and widely compatible choice is the GNOME Polkit Agent.
Step 1: Install the polkit-gnome Package
Use the Arch package manager to install the agent:
| |
Step 2: Configure the Agent to Autostart
The agent must be launched once when your session starts. For Wayland compositors based on wlroots (like MangoWC, Sway, River, etc.), you typically add this command to your main configuration file or an autostart.sh script.
If you use an autostart.sh (recommended for MangoWC):
Edit or create ~/.config/mango/autostart.sh and add the following line:
| |
If you use an exec-once command in your main config (e.g., ~/.config/mango/config.conf):
| |
Step 3: Restart and Verify
Restart your Wayland session (log out and log back in).
Run the test command again:
1pkexec echo "Polkit is now working!"
Success! You should now see a proper, graphical password dialogue box pop up, allowing you to run privileged applications without hassle.
Did this fix your issue in MangoWC or another minimal compositor? Let me know in the comments!