badged

Crates.iobadged
lib.rsbadged
version0.1.0
created_at2025-12-12 16:35:44.312178+00
updated_at2025-12-12 16:35:44.312178+00
descriptionA polkit authentication agent for Linux window managers
homepagehttps://github.com/jfernandez/badged
repositoryhttps://github.com/jfernandez/badged
max_upload_size
id1981821
size64,020
Jose Fernandez (jfernandez)

documentation

https://github.com/jfernandez/badged

README

badged

A polkit authentication agent for Linux window managers.

  • Fingerprint support - works with pam_fprintd out of the box. The password field only appears when PAM explicitly requests it.
  • Minimal dependencies - just GTK4 and D-Bus. Less code touching your credentials.
  • Works on Wayland and X11

Why do I need a polkit authentication agent?

Polkit handles authorization on Linux. When an app needs elevated privileges, polkit prompts you for your password or fingerprint to verify your identity. GNOME, KDE, and other desktop environments ship their own polkit agents, but if you're running a window manager like sway, i3, or Hyprland, you need to bring your own.

Requirements

The target system needs:

  • GTK4 - UI toolkit
  • polkit - provides polkit-agent-helper-1 which handles PAM authentication

D-Bus is required but is present on virtually all Linux systems.

Distro Package
Fedora gtk4 polkit
Debian/Ubuntu libgtk-4-1 policykit-1
Arch gtk4 polkit

Installation

Download the latest binary from Releases and place it in your $PATH.

Building from source

Requires GTK4 and D-Bus development libraries:

Distro Packages
Fedora gtk4-devel dbus-devel
Debian/Ubuntu libgtk-4-dev libdbus-1-dev
Arch gtk4 dbus
cargo install badged

Or clone and build:

git clone https://github.com/jfernandez/badged
cd badged
cargo install --path .

Usage

Run badged when your session starts. It registers with polkit over D-Bus and waits for authentication requests.

For Hyprland, add to ~/.config/hypr/hyprland.conf (or autostart.conf if you split your config):

exec-once = badged

How it works

When an application requests elevated privileges, polkit looks for a registered authentication agent and calls its BeginAuthentication method over D-Bus. badged shows a dialog, spawns the standard polkit-agent-helper-1 binary (provided by your distro), and relays credentials through it. The helper handles all PAM interaction, so badged never runs as root and never handles passwords directly. It just pipes them to the helper's stdin.

Commit count: 0

cargo fmt