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:

  1. The Daemon (polkitd): This is the core service that processes authorization requests.
  2. 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:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Check if the core Polkit Daemon is running (it was)
systemctl status polkit.service
# Output: Active: active (running)

# Check for any running Polkit agents (only the daemon was found)
pgrep -af polkit
# Output: 824 /usr/lib/polkit-1/polkitd --no-debug --log-level=notice

# Testing a privileged command showed a terminal prompt (pkttyagent fallback)
pkexec echo "Test"
# Output:
# ==== AUTHENTICATING FOR org.freedesktop.policykit.exec ====
# Authentication is needed to run `/usr/bin/echo Polkit agent is running' as the super user
# Authenticating as: Elvin Guti (elvin)
# Password:

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:

1
sudo pacman -S polkit-gnome

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:

1
2
3
4
5
# Start the graphical Polkit authentication agent in the background
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &

# Ensure the script is executable
chmod +x ~/.config/mango/autostart.sh

If you use an exec-once command in your main config (e.g., ~/.config/mango/config.conf):

1
2
# Launch Polkit agent once at startup
exec-once /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &

Step 3: Restart and Verify

  1. Restart your Wayland session (log out and log back in).

  2. Run the test command again:

    1
    
    pkexec 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!