ubuntu 添加右键打开方式,无法添加程序打开方式
最近把工作环境迁移到ubuntu,装了WPS for Linux ,说实话确实是十分良心啊!运行效率奇高,绿色无广告,并且和windows版本无异,感觉就可以抛弃自带的libreoffice了。
但是有个问题就是没有办法使用双击打开(由于我安装的是免安装版),最主要的问题还是无法在右键-》打开方式-》其它方式里面找到。
这修改两个路径文件是修改默认打开方式的方法之一,但是感觉治标不治本,还是想办法把程序添加到右键菜单吧。
/etc/gnome/defaults.list
~/.local/share/applications/mimeinfo.cache
于是在国外的网站找到了,原来我的/usr/share/applications/*.desktop文件需要添加一个参数变量。成功加入程序到右键菜单!
我的wps.desktop现在改成这样了,注意Exec的写法,增加%F参数即可,%F是文件名称参数,能够使用前面路径的程序,一次打开一个或多个文件。
[Desktop Entry]
Encoding=UTF-
Name=WPS
Comment=kingsoftwps
Exec=/ubt1/softs/wps/wps-office_10.1.0.~a21_x86_64/wps %F
Icon=/ubt1/softs/wps/wps-office_10.1.0.~a21_x86_64/resource/icons/hicolor/48x48/apps/wps-office-wpsmain.png
Terminal=false
Type=Application
MimeType=application/msword;application/vnd.openxmlformats-officedocument.wordprocessingml.document;
Categories=Application;IDE;Development;
其它的desktop参数配置方法看这个吧:desktop-entry-specification
https://developer.gnome.org/desktop-entry-spec/#exec-variables
方便查看,参数配置单独列出来了:
Code
| Description | |
|---|---|
%f |
A single file name, even if multiple files are selected. The system reading the desktop entry should recognize that the program in question cannot handle multiple file arguments, and it should should probably spawn and execute multiple copies of a program for each selected file if the program is not able to handle additional file arguments. If files are not on the local file system (i.e. are on HTTP or FTP locations), the files will be copied to the local file system and %f will be expanded to point at the temporary file. Used for programs that do not understand the URL syntax. |
%F |
A list of files. Use for apps that can open several local files at once. Each file is passed as a separate argument to the executable program. |
%u |
A single URL. Local files may either be passed as file: URLs or as file path. |
%U |
A list of URLs. Each URL is passed as a separate argument to the executable program. Local files may either be passed as file: URLs or as file path. |
%d |
Deprecated. |
%D |
Deprecated. |
%n |
Deprecated. |
%N |
Deprecated. |
%i |
The Icon key of the desktop entry expanded as two arguments, first --icon and then the value of the Icon key. Should not expand to any arguments if the Icon key is empty or missing. |
%c |
The translated name of the application as listed in the appropriate Name key in the desktop entry. |
%k |
The location of the desktop file as either a URI (if for example gotten from the vfolder system) or a local filename or empty if no location is known. |
%v |
Deprecated. |
%m |
Deprecated. |
ubuntu 添加右键打开方式,无法添加程序打开方式的更多相关文章
- Ubuntu 在右键快捷菜单中添加“Open in Terminal”
操作步骤翻译如下: 1.打开一个Terminal(ctrl+alt+t),输入如下指令 sudo apt-get install nautilus-open-terminal 2.使用以下指令来重启N ...
- XP下,文件夹添加右键命令行
原文:XP下,文件夹添加右键命令行 总共有3种方式: --------------------1---------------------------------------------------- ...
- windows右键打开方式里面添加新的应用程序
1.打开注册表编辑器.打开运行窗口,快捷键,开始+R.输入“regedit”,回车确定. 2.进入注册表编辑器的HKEY_CLASSES_ROOT文件夹下的*子文件夹下的shell文件夹. 3.右键s ...
- VSCode 绿色版(zip压缩包) 添加右键菜单 使用VSCode 打开文件或文件夹
微软官方下载VSCode 可以下载exe安装外还可以下载zip 压缩包 下载地址: https://code.visualstudio.com/Download 但是zip压缩包却没有了 右键使用VS ...
- 添加右键使用 SublimeText 打开
最近修改了系统,重新安装 SublimeText 但是在安装的时候忘记设置右键使用 SublimeText 打开,所以就需要写注册表. 可以复制下面的代码到一个记事本,然后保存为 sublime_ad ...
- 给IDEA添加右键打开功能
添加文件夹右键程序打开 开始运行regedit 找到 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell 1.右键shell目录新建项Idea 2. ...
- 添加右键菜单命令 在此处打开命令窗口(E)(带图标)
@color 0A @title 添加右键菜单命令 在此处打开命令窗口(^&E)(带图标) by wjshan0808 @echo off reg add HKCR\Directory\Bac ...
- Wix打包系列(七) 添加系统必备组件的安装程序
原文:Wix打包系列(七) 添加系统必备组件的安装程序 我们知道在vs的打包工程中添加系统必备组件是一件很容易的事情,那么在wix中如何检测系统必备组件并在安装过程中安装这些组件.这里以.Net Fr ...
- 怎样在Windows资源管理器中添加右键菜单以及修改右键菜单顺序
有时,我们需要在Windows资源管理器的右键菜单中添加一些项,以方便使用某些功能或程序. 比如我的电脑上有一个免安装版的Notepad++,我想在所有文件的右键菜单中添加一项用Notepad++打开 ...
- Beyond Compare 3添加右键菜单
目前是在Beyond Compare 3.1.9版本上试验可行,其他版本上尚未测试. 添加右键菜单步骤: 1.新建为.bat后缀的文本,将下面“添加右键菜单批处理”复制到此文本中. 2.将批处理移动到 ...
随机推荐
- java基础学习系列二
循环语句 1,for(){} 2,while(){} 3,do{}while() continue和break用法 break是结束循环 continue结束本次循环
- 排序算法Java实现(希尔排序)
算法描述:先将待排序序列的数组元素分成多个子序列,使得每个子序列的元素个数相对较少,然后对各个子序列分别进行直接插入排序,待整个待排序序列“基本有序”后,再对所有元素进行一次直接插入排序. packa ...
- Loadrunner初学
1.创建脚本 启动Vvitrual User Generator 创建脚本 因为我们选择录制页面相关的操作,则选择web(HTTP/HTML) application type 选择是录制浏览器网页还 ...
- opencv配置
1.安装opecv库 从官网http://opencv.org/下载OpenCV windows版 运行之后 2.配置环境变量 64位系统,可以将32位和64位两个都添加上,免得以后编译不同程序再来配 ...
- Vue 知识复习(上)
Vue Vue实例 创建实例: var vm = new Vue({ //code }) 数据与方法: 只有当实例被创建时 data 中存在的属性才是响应式的; Vm.b = 'h1' 是不会触发视图 ...
- pip安装selenium报错:Read timed out
今天打算把selenium降级重新安装,发现安装时总是失败,报如下错误: raise ReadTimeoutError(self._pool, None, 'Read timed out.') pip ...
- C语言--总结报告
1.当初你是如何做出选择计算机专业的决定的? 经过一个学期,你的看法改变了么,为什么? 你觉得计算机是你喜欢的领域吗,它是你擅长的领域吗? 为什么? 当初填报志愿我是有很明确的专业方向的,就是IT类的 ...
- org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be res
解决:web项目出现如上问题,据查是版本问题: JSTL 1.0 的声明是: <%@ taglib prefix="c" uri="http://java.sun. ...
- Scala 集合入门
1. 数组 1.1 定长数组 scala.Array 是定长的可变的索引型集合, JVM 中, Scala 的 Array 是以 Java 数组方式实现. String 对应 java.lang.St ...
- js前端对后台数据的获取,如果是汉字则需要添上引号
js前端对后台数据的获取,如果是汉字则需要添上引号