Debian configure default applications

From campisano.org
Jump to navigation Jump to search

default applications

utilities

as root

  • update alternatives
update-alternatives --get-selections
update-alternatives --list editor
update-alternatives --config editor
update-alternatives --config x-www-browser
update-alternatives --install /usr/bin/firefox x-www-browser /home/shared/opt/software/firefox/firefox 1
update-alternatives --remove x-www-browser /home/shared/opt/software/firefox/firefox
  • update all defaults
# WARN! do not do the follow, but if you need, set a readable umask!
# umask 022
# update-mime-database /usr/share/mime
# update-desktop-database /usr/share/applications

as common user

  • update all defaults
update-mime-database $HOME/.local/share/mime
update-desktop-database $HOME/.local/share/applications
  • update specific mime - new xdg-mime system
xdg-mime query default inode/directory
xdg-mime default file-manager.desktop inode/directory
xdg-mime query default text/plain
xdg-mime default text-editor.desktop text/plain
xdg-mime query default text/html
xdg-mime default browser.desktop text/html
xdg-mime query default x-scheme-handler/http
xdg-mime default browser.desktop x-scheme-handler/http
xdg-mime query default x-scheme-handler/https
xdg-mime default browser.desktop x-scheme-handler/https
xdg-mime query default application/pdf
xdg-mime default pdf.desktop application/pdf
xdg-mime query default image/bmp image/gif image/jpeg image/jpg image/png image/tiff
xdg-mime default image-viewer.desktop image/bmp image/gif image/jpeg image/jpg image/png image/tiff
  1. as alternative, you can use `mimeopen -d file.mp4`
  • update specific mime - old legacy mailcap
echo 'inode/directory; file-manager.sh "%s"' >> ~/.mailcap
echo 'text/plain; text-editor.sh "%s"' >> ~/.mailcap
echo 'text/html; browser.sh "%s"; test=test -n "$DISPLAY"' >> ~/.mailcap
echo 'x-scheme-handler/http; browser.sh "%s"; test=test -n "$DISPLAY"' >> ~/.mailcap
echo 'x-scheme-handler/https; browser.sh "%s"; test=test -n "$DISPLAY"' >> ~/.mailcap
echo 'application/pdf; pdf.sh "%s"; test=test -n "$DISPLAY"' >> ~/.mailcap
echo 'image/bmp; image-viewer.sh "%s"; test=test -n "$DISPLAY"' >> ~/.mailcap
echo 'image/gif; image-viewer.sh "%s"; test=test -n "$DISPLAY"' >> ~/.mailcap
echo 'image/jpeg; image-viewer.sh "%s"; test=test -n "$DISPLAY"' >> ~/.mailcap
echo 'image/jpg; image-viewer.sh "%s"; test=test -n "$DISPLAY"' >> ~/.mailcap
echo 'image/png; image-viewer.sh "%s"; test=test -n "$DISPLAY"' >> ~/.mailcap
echo 'image/tiff; image-viewer.sh "%s"; test=test -n "$DISPLAY"' >> ~/.mailcap

config files

  • /usr/share/mime
  • /etc/mime.types
  • /etc/mailcap
  • ~/.config/mimeapps.list
  • ~/.mailcap

References