polkit
Polkit authentication agent — fuzzel prompts for your password when an action needs elevated privileges.
What runs
- Agent script:
~/.config/sway/scripts/fuzzel-polkit-agent.sh - Started by sway:
exec ~/.config/sway/scripts/fuzzel-polkit-agent.sh - When polkit needs authentication, a
fuzzelpassword prompt appears. Type your password and Enter; press Escape (empty) to cancel.
How it works
cmd-polkit-agentregisters as the polkit agent and talks JSON over a pipe.- The script parses each request with
jq, shows afuzzel --dmenu --passwordprompt, and repliesauthenticate(with the password) orcancel. - Appearance follows your normal
~/.config/fuzzel/fuzzel.initheme.
Dependencies
jq official repo (installed)
fuzzel official repo (installed)
cmd-polkit-git AUR yay -S cmd-polkit-git <- provides cmd-polkit-agent
Customizing the prompt
- Extra args are passed straight to fuzzel. Edit the
execline in~/.config/sway/config, e.g. highlight the prompt in red:exec ~/.config/sway/scripts/fuzzel-polkit-agent.sh --prompt-color=ff0000ff
Testing
- Confirm the agent is running first (it is only started by sway’s
exec):pgrep -af cmd-polkit-agentNothing printed? Reload sway ($mod+Shift+c), or start it by hand:~/.config/sway/scripts/fuzzel-polkit-agent.sh & - Trigger a prompt without rebooting:
pkexec true(runs /bin/true as root — a self-contained auth request; orsystemctl restart <unit>for a service you own) - Test one specific action and force the prompt:
pkcheck --action-id <id> --process $$ --allow-user-interaction(pkactionlists every registered action ID)
Notes / troubleshooting
- Only one polkit agent should run per session. This replaced the previous
polkit-gnomeagent (/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1). - No prompt appears? Confirm
cmd-polkit-gitis installed and reload sway ($mod+Shift+c), then re-test withpkexec true. - Source (vendored, MIT): https://codeberg.org/lukeflo/fuzzel-polkit-agent