LinuxCommandLibrary

handlr

modern alternative to xdg-utils for managing default applications on Linux

TLDR

Open a URL in the default application

$ handlr open https://example.com
copy
Open a PDF in the default PDF viewer
$ handlr open [path/to/file.pdf]
copy
Set imv as the default application for PNG files
$ handlr set .png imv.desktop
copy
Set MPV as the default for all audio files
$ handlr set 'audio/*' mpv.desktop
copy
List all default apps
$ handlr list
copy
Get the default application for PNG files
$ handlr get .png
copy

SYNOPSIS

handlr command [arguments]

DESCRIPTION

handlr is a modern alternative to xdg-utils for managing default applications on Linux. It handles file and URL associations through MIME types and file extensions.
The tool modifies ~/.config/mimeapps.list (and optionally the deprecated ~/.local/share/applications/mimeapps.list) to set default applications. It supports both specific file extensions (.pdf, .png) and MIME type patterns (audio/*, video/*).
handlr aims to be simpler and more predictable than xdg-open and xdg-mime, with better terminal integration and clear output.

PARAMETERS

open PATH|URL

Open file or URL with default application
set MIME|EXT HANDLER
Set default application for MIME type or extension
get MIME|EXT
Get default application for MIME type or extension
list
List all configured default applications
unset MIME|EXT
Remove default application setting
add MIME|EXT HANDLER
Add handler to list without setting as default

CAVEATS

Requires .desktop files to be properly installed in standard locations. May not be recognized by all desktop environments. Some applications may have their own file association mechanisms that override system defaults.

HISTORY

handlr was created as a Rust-based alternative to the xdg-utils suite, focusing on simplicity and reliability. It addresses common frustrations with xdg-open's unpredictable behavior and complex fallback mechanisms.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community