环境:
uname -a
Linux debian 5.10.0-8-amd64 #1 SMP Debian 5.10.46-4 (2021-08-03) x86_64 GNU/Linux
dpkg -s lxde
Maintainer: Debian LXDE Maintainers
Architecture: all
Source: lxde-metapackages
Version: 11右键单击txt文件上的鼠标:

我如何将Libreoffice替换为Mousepad,或者说,删除Libreoffice,并将Mousepad放在第二位,就在菜单中的Open下面?
file -i test.txt
test.txt: text/plain; charset=utf-8我在text/plain上修复了D4:
sudo vim /usr/share/applications/mimeinfo.cache
text/plain=mousepad.desktop;vim.desktop;点击test.txt,Libreoffice-Calc仍然在菜单的顶部。

也许操作系统将txt视为csv文件。
text/plain=mousepad.desktop;vim.desktop;
text/rtf=libreoffice-writer.desktop;
text/spreadsheet=libreoffice-calc.desktop;
text/tab-separated-values=libreoffice-calc.desktop;发布于 2021-09-19 03:25:49
这与MIME类型关联有关。可能有一种图形化的方式,就像我在KDE中一样,首先检查你的LXDE设置/单击Open with,您可能会找到一个改变这个设置的选项。以下是在任何DE/WM下都应该工作的一般文本方式。编辑/usr/share/application/mimeinfo.cache
text/plain=libreoffice-calc.desktop;gvim.desktop;libreoffice-writer.desktop;mousepad.desktop;vim.desktop;(就像这样)
text/plain=mousepad.desktop;gvim.desktop;libreoffice-writer.desktop;vim.desktop;(从列表中删除LO Calc桌面文件名,并将其删除,并将其放在开头)
此设置可能被~/.local/share/applications/mimeinfo.cache和/usr/local/share/applications/mimeinfo.cache重写。因此,如果第一种方法不起作用,请从这两个文件中删除text/plain行,或者将相同的值从第一个文件粘贴到这些文件的text/plain。
编辑:如果文件是CSV,那么您应该将更改应用到application/csv行。
https://unix.stackexchange.com/questions/669044
复制相似问题