原文链接:统信UOS桌面操作系统1060上配置鼠标右键打开方式
hello,大家好啊,今天给大家带来一篇在统信UOS桌面操作系统1060上配置鼠标右键打开方式的内容,有时候我们会发现鼠标右键选择一个文件,在打开方式中会有很多的软件供我们选择,比如要打开一个TXT文件,里面却有wps等选项,这些有时候看起来并不友好,下面就给大家介绍一种方法,能够设置里面的软件是否显示。
1、查看系统信息
uos@uos-PC:~/Desktop$ uname -a
Linux uos-PC 4.19.0-arm64-desktop #6030 SMP Tue Jun 27 15:28:10 CST 2023 aarch64 GNU/Linux
uos@uos-PC:~/Desktop$ cat /etc/os-version
[Version]
SystemName=UOS Desktop
SystemName[zh_CN]=统信桌面操作系统
ProductType=Desktop
ProductType[zh_CN]=桌面
EditionName=Professional
EditionName[zh_CN]=专业版
MajorVersion=20
MinorVersion=1060
OsBuild=11014.100.100
uos@uos-PC:~/Desktop$
2、系统目前已经安装了LibreOffice
3、右键点击txt文件,点击打开方式会发现有LibreOffice Writer的软件,需要将它取消掉
4、使用root用户进入到/usr/share/applications/
uos@uos-PC:~/Desktop$ sudo -i
请输入密码:
验证成功
root@uos-PC:~# cd /usr/share/applications/
root@uos-PC:/usr/share/applications# ls -ltr |grep lib
-rw-r--r-- 1 root root 4660 4月 10 2021 libreoffice-xsltfilter.desktop
-rw-r--r-- 1 root root 21151 4月 10 2021 libreoffice-writer.desktop
-rw-r--r-- 1 root root 21166 4月 10 2021 libreoffice-startcenter.desktop
-rw-r--r-- 1 root root 18380 4月 10 2021 libreoffice-math.desktop
-rw-r--r-- 1 root root 22560 4月 10 2021 libreoffice-impress.desktop
-rw-r--r-- 1 root root 19487 4月 10 2021 libreoffice-draw.desktop
-rw-r--r-- 1 root root 22461 4月 10 2021 libreoffice-calc.desktop
-rw-r--r-- 1 root root 24731 4月 10 2021 libreoffice-base.desktop
root@uos-PC:/usr/share/applications#
5、编辑
libreoffice-writer.desktop
root@uos-PC:/usr/share/applications# vi libreoffice-writer.desktop
root@uos-PC:/usr/share/applications# cat libreoffice-writer.desktop |grep MimeType
MimeType=application/vnd.oasis.opendocument.text;application/vnd.oasis.opendocument.text-template;application/vnd.oasis.opendocument.text-web;application/vnd.oasis.opendocument.text-master;application/vnd.oasis.opendocument.text-master-template;application/vnd.sun.xml.writer;application/vnd.sun.xml.writer.template;application/vnd.sun.xml.writer.global;application/msword;application/vnd.ms-word;application/x-doc;application/x-hwp;application/rtf;text/rtf;application/vnd.wordperfect;application/wordperfect;application/vnd.lotus-wordpro;application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/vnd.ms-word.document.macroEnabled.12;application/vnd.openxmlformats-officedocument.wordprocessingml.template;application/vnd.ms-word.template.macroEnabled.12;application/vnd.ms-works;application/vnd.stardivision.writer-global;application/x-extension-txt;application/x-t602;application/vnd.oasis.opendocument.text-flat-xml;application/x-fictionbook+xml;application/macwriteii;application/x-aportisdoc;application/prs.plucker;application/vnd.palm;application/clarisworks;application/x-sony-bbeb;application/x-abiword;application/x-iwork-pages-sffpages;application/x-mswrite;application/x-starwriter;
root@uos-PC:/usr/share/applications#
6、将MimeType一行中的text/plain取消掉,保存退出
7、注销登录
8、重新登录系统
9、鼠标右键选择打开方式会发现已经没有了LibreOffice Writer
10、同样的,如果需要在打开方式中添加一种软件,可以使用同样的方法,在
libreoffice-writer.desktop添加text/plain
uos@uos-PC:~/Desktop$ sudo -i
请输入密码:
验证成功
root@uos-PC:~# cd /usr/share/applications/
root@uos-PC:/usr/share/applications# vi libreoffice-writer.desktop
root@uos-PC:/usr/share/applications# cat libreoffice-writer.desktop | grep MimeType
MimeType=application/vnd.oasis.opendocument.text;application/vnd.oasis.opendocument.text-template;application/vnd.oasis.opendocument.text-web;application/vnd.oasis.opendocument.text-master;application/vnd.oasis.opendocument.text-master-template;application/vnd.sun.xml.writer;application/vnd.sun.xml.writer.template;application/vnd.sun.xml.writer.global;application/msword;application/vnd.ms-word;application/x-doc;application/x-hwp;application/rtf;text/rtf;application/vnd.wordperfect;application/wordperfect;application/vnd.lotus-wordpro;application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/vnd.ms-word.document.macroEnabled.12;application/vnd.openxmlformats-officedocument.wordprocessingml.template;application/vnd.ms-word.template.macroEnabled.12;application/vnd.ms-works;application/vnd.stardivision.writer-global;application/x-extension-txt;application/x-t602;text/plain;application/vnd.oasis.opendocument.text-flat-xml;application/x-fictionbook+xml;application/macwriteii;application/x-aportisdoc;application/prs.plucker;application/vnd.palm;application/clarisworks;application/x-sony-bbeb;application/x-abiword;application/x-iwork-pages-sffpages;application/x-mswrite;application/x-starwriter;
root@uos-PC:/usr/share/applications#
11、将MimeType一行中的text/plain添加,保存退出
12、注销登录
13、重新登录系统
14、在打开方式中会显示LibreOffice Writer
15、使用浏览器进行测试
root@uos-PC:/usr/share/applications# vi org.deepin.browser.desktop
root@uos-PC:/usr/share/applications# cat org.deepin.browser.desktop |grep MimeType
MimeType=text/plain;text/html;text/xml;application/xhtml_xml;application/x-mimearchive;x-scheme-handler/http;x-scheme-handler/https;
root@uos-PC:/usr/share/applications#
16、将MimeType一行中的text/plain添加,保存退出
17、注销登录
18、重新登录系统
19、在打开方式中会显示浏览器
20、当然,如果你使用如下方式添加了一个程序,应该采用下列的方法取消
20.1、当你创建了一个shell脚本,并且赋予了可执行权限
20.2、鼠标右键一个文件,打开方式选择默认程序
20.3、选择添加其他程序
20.4、选择刚刚编写的shell脚本
20.5、点击确定
20.6、打开方式中已经存在刚才的shell脚本
20.7、那么该如何取消掉呢?进入到
~/.local/share/applications,删除掉
dde-desktop-custom-open-application-msword.desktop
uos@uos-PC:~/Desktop$ cd ~/.local/share/applications/
uos@uos-PC:~/.local/share/applications$ pwd
/home/uos/.local/share/applications
uos@uos-PC:~/.local/share/applications$ ls -ltr
总用量 4
-rw-r--r-- 1 uos uos 184 8月 14 11:30 dde-desktop-custom-open-application-msword.desktop
uos@uos-PC:~/.local/share/applications$ cat dde-desktop-custom-open-application-msword.desktop
[Desktop Entry]
Exec=/home/uos/Desktop/nihao.sh
Icnotallow=application-x-desktop
MimeType=*/*
Name=nihao.sh
NoDisplay=true
Type=Application
X-DDE-File-Manager-Custom-Open=application/msword
uos@uos-PC:~/.local/share/applications$ rm -rf dde-desktop-custom-open-application-msword.desktop
uos@uos-PC:~/.local/share/applications$
20.8、打开方式中已经不存在shell脚本了