xdgctl is a TUI for managing XDG default applications. View and set defaults
for file categories without using xdg-mime directly.
Built with C using GLib/GIO and termbox2.
xdgctl.mp4
- Browse by category (Browsers, Text Editors, etc.)
- Current default marked with
*
| Key | Action |
|---|---|
| Arrow Up/Down | Navigate through categories or applications |
| Arrow Right/Tab | Switch from category list to application list |
| Arrow Left | Switch back to category list |
| Enter | Set selected application as default for current category |
| Esc / q | Quit the application |
To build xdgctl, you need the following development libraries:
glib-2.0gio-2.0gio-unix-2.0clangorgcc
# On Void Linux
sudo xbps-install glibc-devel pkg-configgit clone https://github.com/mitjafelicijan/xdgctl.git
cd xdgctl
# Build
make
sudo make install
# Using prefix
sudo make PREFIX=/usr/local install
make PREFIX=~/.local installIf you manually add new applications to your ~/.local/share/applications
directory, you might need to run update-desktop-database again.
xdgctl is available on the AUR:
- xdgctl (release package)
- xdgctl-git (git package)
You can install it using your AUR helper of choice.
Example:
yay -Sy xdgctlls /usr/share/applications
ls ~/.local/share/applicationsxdg-mime query default text/plain
xdg-mime query default text/html
xdg-mime query default x-scheme-handler/http
xdg-mime query default x-scheme-handler/https
xdg-mime query default inode/directoryxdg-mime default brave.desktop x-scheme-handler/http
xdg-mime default brave.desktop x-scheme-handler/https# ~/.local/share/applications/brave.desktop
[Desktop Entry]
Version=1.0
Type=Application
Name=Brave
GenericName=Web Browser
Comment=Brave browser
Exec=/home/m/Applications/brave --new-window %U
Terminal=false
Icon=brave
Categories=Network;WebBrowser;
MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/chromium;
Actions=new-window;new-private-window;
[Desktop Action new-window]
Name=New Window
Exec=/home/m/Applications/brave --new-window
[Desktop Action new-private-window]
Name=New Private Window
Exec=/home/m/Applications/brave --incognitoValidate file with desktop-file-validate ~/.local/share/applications/brave.desktop.
update-desktop-database ~/.local/share/applications
less ~/.config/mimeapps.list
less /usr/share/applications/mimeapps.list