A powerful, modern GUI tool to manage default applications on Linux. Built with Qt 6 and C++17, it strictly adheres to the XDG MIME Apps Specification, ensuring your file associations work correctly across all desktop environments (KDE Plasma, GNOME, XFCE, Hyprland, i3, etc.).
| Main Interface | Granular Conflict Resolution |
|---|---|
![]() |
![]() |
- XDG Compliant: Fully implements the XDG MIME Apps Specification for both reading and writing associations
- Precedence Handling: Correctly respects desktop-specific overrides (
$desktop-mimeapps.list) and system-wide defaults - Two-Way Management:
- Add Associations: Set an application as the default for specific file types
- Remove Associations: Remove explicit user overrides to fall back to system defaults
- Application-Centric UI: Select an application to see everything it supports and what it currently handles
- Visual Feedback: Full icon support via
QIcon::fromThemefor both applications and MIME types
- Granular Conflict Resolution: When setting associations that conflict with existing defaults, a checkbox dialog allows you to selectively choose which specific MIME types to overwrite
- Search & Filtering: Search applications by name and filter MIME types by category (e.g., audio, video, image)
- Symmetrical Layout: Clean, balanced three-panel interface with consistent spacing and alignment
- Default Window Size: Opens at a comfortable 1000×600 pixels
- Rich Help Dialog: HTML-formatted help text with clear instructions
- Verbose Logging: Use
-Vflag with customsda.logcategory to see only relevant application logs (parsing, associations) without Qt internal noise - Clean CLI Exit: Proper resource cleanup when using
--helpor--versionflags (noQThreadStoragewarnings) - Modern C++17: Uses range-based for loops, structured bindings, and Qt 6 best practices
You need Qt 6, CMake, and a C++17 compatible compiler.
sudo dnf install qt6-qtbase-devel cmake gcc-c++sudo apt install qt6-base-dev cmake g++sudo pacman -S qt6-base cmake gccThis project provides first-class support for Nix and NixOS.
To avoid building from source, use the sda-qt6 binary cache:
# Install cachix if not already installed
nix-env -iA cachix -f https://cachix.org/api/v1/install
# Add the sda-qt6 cache
cachix use sda-qt6Or add it directly to your NixOS configuration:
{
nix.settings = {
substituters = [ "https://sda-qt6.cachix.org" ];
trusted-public-keys = [ "sda-qt6.cachix.org-1:f+mZPJwYQKpzaAdGWj2DfdHV5uEjnYx1ZoAWfZfEGoA=" ];
};
}1. Ad-hoc Usage
# Run directly without installing
nix run github:THShafi170/selectdefaultapplication-Qt62. Permanent Installation
nix profile install github:THShafi170/selectdefaultapplication-Qt63. Declarative (NixOS / Home Manager)
Add to your flake.nix inputs:
inputs.sda-qt6.url = "github:THShafi170/selectdefaultapplication-Qt6";Then add it to your packages:
environment.systemPackages = [ inputs.sda-qt6.packages.${system}.default ];4. Development Shell
nix develop1. Permanent Installation
nix-env -i -f .2. Declarative (NixOS)
Add to your configuration.nix:
{ pkgs, ... }:
let
sda-qt6 = import (fetchTarball "https://github.com/THShafi170/selectdefaultapplication-Qt6/archive/master.tar.gz") { inherit pkgs; };
in {
environment.systemPackages = [ sda-qt6 ];
}3. Development Environment
nix-shell-
Clone the repository:
git clone https://github.com/THShafi170/selectdefaultapplication-Qt6.git cd selectdefaultapplication-Qt6 -
Configure and Build:
cmake -S . -B build cmake --build build -
Run:
./build/sda-qt6
-
Optional: Install (installs to
/usr/local/binby default):sudo cmake --install build
- Left Panel: Browse or search for an application
- Center Panel: View MIME types the selected application can handle
- Bold entries = already set as default for this app
- Select types you want to associate → click "Add association(s)"
- Right Panel: View current default associations for the selected app
- Select types → click "Remove association(s)" to revert to system defaults
When setting associations that conflict with existing defaults, a dialog will appear showing:
- Each conflicting MIME type
- Its current default application
- Checkboxes (checked by default) to selectively choose which to overwrite
Simply uncheck any associations you want to preserve.
-h,--help: Display help information-v,--version: Display application version (2.0)-V,--verbose: Enable verbose logging (shows XDG parsing, association writes/removals)
Example:
# Run with verbose logging to debug MIME type parsing
./build/sda-qt6 -VThis project uses a clean separation between UI and backend logic:
-
XdgMimeAppsClass: Handles all XDG specification logic- Parses
~/.config/mimeapps.list,$XDG_CONFIG_DIRS, and desktop-specific overrides - Discovers
.desktopfiles from all XDG application directories - Handles
[Default Applications],[Added Associations], and[Removed Associations]groups - Writes user overrides to
~/.config/mimeapps.listonly (never modifies system files)
- Parses
-
SelectDefaultApplicationClass: Qt widget for the UI- Three-panel layout with application list, MIME type list, and current defaults
- Delegates all file I/O and parsing to
XdgMimeApps
Uses QLoggingCategory("sda.log") for all debug output. When -V is set:
sda.log: XdgMimeApps: Parsing "/home/user/.config/mimeapps.list"
sda.log: XdgMimeApps: Writing setting: "image/png" = "gwenview.desktop"
sda.log: SelectDefaultApplication: Sync-ed 235 associations to UI
Works seamlessly across all freedesktop.org-compliant desktops:
- KDE Plasma, GNOME, XFCE, Cinnamon (traditional DEs)
- Hyprland, Sway, i3, bspwm (Wayland/X11 window managers)
- No KDE Frameworks dependency—only pure Qt 6 Core/Gui/Widgets
Main source files:
main.cpp- Application entry pointselectdefaultapplication.{h,cpp}- UI implementationxdgmimeapps.{h,cpp}- XDG MIME specification backendCMakeLists.txt- Build configuration
This project is licensed under the GNU General Public License v3.0 (GPLv3). See the LICENSE file for details.
This is a Qt 6 port and modernization of the original selectdefaultapplication by magnus-ISU. This fork includes significant enhancements:
- Ported from Qt 5 to Qt 6
- Modern C++17 codebase
- Granular conflict resolution dialog
- Improved UI symmetry and layout
- Custom logging infrastructure
- Clean command-line handling
- Enhanced XDG specification compliance
Special thanks to the original author for creating this useful tool!
Contributions are welcome! Please ensure your changes:
- Follow the existing code style (see
.clang-format) - Maintain XDG specification compliance
- Include appropriate error handling
- Update documentation as needed

