Answers:
我发现使用xdg-mime程序更容易,而不是编辑defaults.list。查找pdf查看器,查看其Adobe并将其切换到KPDF:
$xdg-mime query default application/pdf
AdobeReader.desktop
$xdg-mime default kde-kpdf.desktop application/pdf
$xdg-mime query default application/pdf
kde-kpdf.desktop
您可以使用xdg-open使用首选应用程序打开文件:
$xdg-open file.pdf
正如Manni指出的那样,您可以使用文件上的“属性”选项卡来更改用于打开文件的程序。
编辑: 看看Chris089的答案。我希望直接按照下面的建议编辑文件。了解MIME类型是什么以及关联位于何处可能仍然有用,但是我会使用该工具来修改文件。
但是,如果您想要基于文本的解决方案,或者甚至希望了解如何针对不同类型配置文件关联,请执行以下操作:
$ cat〜/ .local / share / applications / defaults.list
[默认应用程序]
application / vnd.google-earth.kml + xml = Google-googleearth.desktop
application / keyhole = Google-googleearth.desktop
application / earthviewer = Google- googleearth.desktop
应用程序/vnd.google-earth.kmz=Google-googleearth.desktop
$ cat /usr/share/applications/defaults.list | grep ^ audio
音频/3gpp=totem.desktop
音频/ac3=totem.desktop
音频/AMR=totem.desktop
音频/AMR-WB=totem.desktop
音频/basic=totem.desktop
音频/midi=totem.desktop
音频/ mp4 = totem.desktop
音频/mpeg=totem.desktop
音频/mpegurl=totem.desktop
音频/ogg=totem.desktop
音频/prs.sid=totem.desktop
音频/vnd.rn-realaudio=totem.desktop
音频/ x-猿= totem.desktop
音频/x-flac=totem.desktop
音频/x-gsm=totem.desktop
音频/x-it=totem.desktop
音频/x-m4a=totem.desktop
音频/x-matroska=totem.desktop
音频/x-mod=totem.desktop
音频/x-mp3=totem.desktop
音频/x-mpeg=totem.desktop
音频/x-mpegurl=totem.desktop
音频/x-ms-asf=totem.desktop
音频/ x -ms-asx = totem.desktop
音频/x-ms-wax=totem.desktop
音频/x-ms-wma=totem.desktop
音频/x-musepack=totem.desktop
音频/x-pn-aiff=totem.desktop
音频/x-pn-au=totem.desktop
音频/x-pn-realaudio=totem.desktop
音频/x-pn-realaudio-plugin=totem.desktop
音频/x-pn-wav=totem.desktop
音频/ x- pn-windows-acm = totem.desktop
音频/x-realaudio=totem.desktop
音频/x-real-audio=totem.desktop
音频/x-sbc=totem.desktop
音频/x-scpls=totem.desktop
音频/x-speex=totem.desktop
音频/x-tta=totem.desktop
音频/x-wav=totem.desktop
音频/x-wavpack=totem.desktop
音频/ x-vorbis = totem.desktop
音频/x-vorbis+ogg=totem.desktop
音频/x-xm=totem.desktop
这是Desktop Entry Specification文档,其中详细说明了对.desktop文件的需求和使用(而不是使用可执行文件的路径)。