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.将批处理移动到 ...
随机推荐
- Spring事务管理—aop:pointcut expression解析(转)
本文转载自: http://hane00.blog.163.com/blog/static/160061522011427473965/ 先来看看这个spring的配置文件的配置: <!-- 事 ...
- Tomcat优化内存以及连接数
公司的一个服务器使用Tomcat6默认配置,在后台一阵全点击服务器就报废了,查了一下就要是PERMSIZE默认值过小造成(16-64) TOMCAT_HOME/bin/catalina.sh 添加一行 ...
- python 函数 装饰器的使用方法
一.装饰器 首先,我们要了解到什么是开放封闭式原则? 软件一旦上线后,对修改源代码是封闭的,对功能的扩张是开放的,所以我们应该遵循开放封闭的原则. 也就是说:我们必须找到一种解决方案,能够在不修改一 ...
- LeetCode-4. 两个排序数组的中位数(详解)
链接:https://leetcode-cn.com/problems/median-of-two-sorted-arrays/description/ 有两个大小为 m 和 n 的排序数组 nums ...
- [BZOJ 1040][ZJOI2008]骑士
1040: [ZJOI2008]骑士 Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 5403 Solved: 2060[Submit][Status ...
- Redux----Regular的Redux实现整理
Regular的Redux实现整理 什么问题? 组件的树形结构决定了数据的流向,导致的数据传递黑洞 怎么解决? 所有组件都通过中介者传递共享数据 方案: 中介者: (function create ...
- beta冲刺7
前言:最后一篇惹.明天就是正式交差了.有点慌-- 昨天的未完成: 用户试用+测评 输入部分的正则式判定 今天的工作: 登陆界面修改 我的社团显示效果优化 部分信息注册后锁定无法修改 其他部分功能优化 ...
- C语言第七次作业
一.PTA实验作业 题目1:求整数序列中出现次数最多的数 1.本题PTA提交列表 2.设计思路 定义一个整型数组a[1001],i,j 为循环变量,N,定义数组b[1001]={0} 输入N for( ...
- Alpha冲刺集合
Alpha冲刺集合 Day1 http://www.cnblogs.com/bugLoser/p/7901016.html Day2 http://www.cnblogs.com/bugLoser/p ...
- 和为S的连续正数序列——牛客网(剑指offer)
题目描述 小明很喜欢数学,有一天他在做数学作业时,要求计算出9~16的和,他马上就写出了正确答案是100.但是他并不满足于此,他在想究竟有多少种连续的正数序列的和为100(至少包括两个数).没多久,他 ...