Translations: English - Português (Brasil)
This page links to other pages that explain how to change the various defaults provided by Debian, from parts of the BootProcess to which applications your desktop or command line use by default.
Debian Reference Manual : Customizing program to be started
Contents
- Firmware
- Boot loader
- Init system
- Login shell
- Display manager
- Desktop system
- The GUI application used to open file types
- File type handlers for text tools (mailcap)
- Debian Alternatives
- sensible-utils
- Environment variables that select a program to launch
- Application specific default applications
- Related links
Firmware
Most computers are started via a UEFI or BIOS firmware: this is, theoretically, software which can (sometimes) be replaced. See Firmware.
Boot loader
A boot loader is run early in the BootProcess to ensure your Kernel can start. The default is GRUB2, but some others are available for the advanced user. See BootLoader.
Init system
The init system is the first process started and is responsible for starting everything else on your system (some called services or daemons). The default in Debian is systemd but other init systems can be installed by advanced users, see Init for details.
Login shell
The login shell is a command line application used to run other applications. The default is Bash, but each user account can choose a different shell by running chsh. Available shells are listed in shells. The default for new user accounts is set in adduser.conf.
Display manager
A display manager is a graphical front-end from which users log into the system. It usually starts a desktop system. The default is gdm3 which is part of Gnome.
Desktop system
The DesktopEnvironment is an Graphical User Interface (GUI)-based environment that users log into and start other applications from. The Debian default is Gnome, but several others are actively supported.
The GUI application used to open file types
GUI interface
Most desktop environments have a GUI to of assigning a default application to open files based on the MIME type. For example, this is part of the main settings application of Gnome and KDE.
From a command line
From a command line you can also run the xdg-open(1) (also installed as open) command to launch the default application on any file: open file.pdf will open the default PDF reader.
Advanced usage: associating an application with a MIME type using XDG .desktop files
For advanced use, you will need to know the MIME type, and possibly the URI protocol, to use. For example, the DefaultWebBrowser can open files of type text/html (HMTL) and application/xhtml+xml (XTML) using the protocols x-scheme-handler/http (http:) or http: (x-scheme-handler/http). The application is not associated directly, but via a .desktop` file.
The xdg-utils package contains commands to list and set the default application:
xdg-mime query default x-scheme-handler/mailto xdg-settings get default-url-scheme-handler https # this calls xdg-mime xdg-mime query default application/xhtml+xml xdg-settings set default-url-scheme-handler mailto thunderbird.desktop xdg-mime default thunderbird.desktop x-scheme-handler/mailto xdg-mime default firefox-esr.desktop text/html
Notice the argument order varies. Unlike xdg-mime, xdg-settings may append values to the MimeType record inside .desktop files in ~/.local/share/applications.
Some desktop environments also have their own tools. For example in KDE the following command lists the available handlers sorted by priority:
ktraderclient5 --mimetype x-scheme-handler/mailto --servicetype Application
Configuration files that set preferred application may also be edited directly. The user-specific settings are in ~/.config/mimeapps.list, system-wide settings are read from /etc/xdg/mimeapps.list. These locations may be overridden by the XDG_CONFIG_HOME and XDG_CONFIG_DIRS environment variables. See the specification for information about other paths like ~/.local/share/applications/mimeapps.list ($XDG_CONFIG_DIRS/applications/mimeapps.list) and files specific to particular desktop environments.
An example of an extract that sets a default application:
[Default Applications] x-scheme-handler/mailto=thunderbird.desktop;
If a .desktop file provided by an application does not include all supported MIME types or URI schemes, they may be added via an the [Added Associations] section. For example, browsers do not declare support of PDF files in their .desktop files but often do have built-in PDF viewers. When adding new associations it is also necessary to explicitly set the default application as well:
[Added Associations] application/pdf=firefox-esr.desktop;chromium.desktop; [Default Applications] application/pdf=org.gnome.Evince.desktop;
Note that these are setting lists of .desktop files after =: the separator is ; (semicolon), which must also be added at the end of the list.
You can remove applications from an "Open with" menu by adding then a [Removed Associations] section:
[Removed Associations] text/html=abiword.desktop
When a lightweight window manager is used without any desktop environment then xdg-open (or open) may use a browser to open links with unknown URI protocols (x-scheme-handler/...).
In KDE the default applications are cached so to make file edits take effect immediately you may need to run
kbuildsycoca5
Before mimeapps.list files became a standard way to configure default applications, desktop environments provided defaults.list files. In Debian 12 bookworm they were still used at least by Xfce and Mate (via. /etc/mate/defaults.list and /usr/share/xfce4/applications/defaults.list). The specification recommends to use files like kde-mimeapps.list for settings specific to desktop environments, however defaults.list might still be taken into account.
After upgrading the desktop, remnants of earlier configuration files may exist, so it may be necessary to check all possible paths and prefixes for mimeapps.list described in the specification.
See also
Association between MIME types and applications. Cross Desktop Group.
Describes in details location and format of mimeapps.list files.
Override the default registered application for all users and Override the default registered application for individual users in GNOME System Administration Guide provide examples of mimeapps.list entries and usage of gio(1) mime command to update them.
File type handlers for text tools (mailcap)
The mailcap(5) database is an older way to associate applications with MIME types. It was designed to help mail readers like mutt to open email attachments, but is supported by some other applications like emacs. The run-mailcap(1) helper lets you use the mailcap database to view, see, edit, compose, or print files with the default application. It can be used as open(1) via the DebianAlternatives mechanism.
The mailcap database can also specify that some applications are only suitable for use only inside Desktop sessions. Unlike the XDG specification described in the previous section there is no way to specify URI scheme handlers with mailcap.
The mailcap handlers may be set system-wide and may be overridden by a user. See mailcap(5) or RFC1524 for the format of /etc/mailcap and ~/.mailcap. Debian allows the priority to be set in /etc/mailcap.order and ~/.mailcap.order files, see mailcap.order(5).
After editing a mailcap configuration files, you need to regenerate the mailcap database using the Debian-specific update-mime(8) tool. This tool also adds to the mailcap database handlers specified in the MimeType fields of XDG .desktop files.
Debian Alternatives
Debian Alternatives lets you choose which of several similar programs should be designated as the default.
sensible-utils
sensible-utils provides wrapper scripts sensible-editor, sensible-browser and sensible-pager to launch an editor, browser or pager respectively. Each user can choose which editor to use by running select-editor. Using the wrappers means scripts do not need to hardcode program names.
Environment variables that select a program to launch
There are several environment variables that control the pager, browser or editor used by command line programs. This includes PAGER, EDITOR (or VISUAL), and BROWSER.
More information is available in: EnvironmentVariables, environ(7), and documentation of specific tools, e.g. "ENVIRONMENT" section in their man pages.
Application specific default applications
Firefox
Firefox uses the XDG specification (see #XDG, however associations of MIME types and URI protocols with specific handlers may be overridden). Go into following menu : Preferences > Applications (or type about:preferences#applications in address bar). These settings are saved in the =handlers.json= file inside the profile directory.
See the Manage file types and download actions in Firefox Mozilla Support page for details.
rox-filer
${HOME}/.config/rox.sourceforge.net/MIME-types
