在Ubuntu的右键菜单中添加“使用gedit打开”

The file browser in Ubuntu provides the ability to run scripts on a selected file. These scripts can be used to do anything from opening a file to zipping or uploading, or anything that you can do from the command line.

Ubuntu中的文件浏览器提供了在选定文件上运行脚本的功能。 这些脚本可用于执行从打开文件到压缩或上载的任何操作,或者可从命令行执行的任何操作。

To start off, we will need to open a terminal window and type in the following command, which will create a new script file in our nautilus scripts directory

首先,我们需要打开一个终端窗口并键入以下命令,这将在我们的nautilus脚本目录中创建一个新的脚本文件。

gedit ~/.gnome2/nautilus-scripts/Open\ with\ gedit

gedit〜/ .gnome2 / nautilus-scripts / Open \ with \ gedit

Paste in the following script, found on the G-Scripts site, which is a great resource for finding scripts.

粘贴以下脚本,该脚本位于G-Scripts网站上 ,这是查找脚本的绝佳资源。

#!/bin/bash## Nautilus script -> open gedit## Owner : Largey Patrick from Switzerland#     patrick.largey@nazeman.org# www.nazeman.org## Licence : GNU GPL ## Copyright (C) Nazeman## Ver. 0.9-1 Date: 16.02.2002# Add multiple file open in the same windows## Ver: 0.9  Date: 27.10.2001# Initial release## Dependence : Nautilus (of course)#   Gnome-utils (gdialog)#filesall=””while [ $# -gt 0 ]dofiles=`echo “$1” | sed ‘s/ /\?/g’`filesall=”$files $filesall”shiftdonegedit $filesall&

#!/ bin / bash ## Nautilus脚本-> open gedit ##所有者:来自瑞士的Largey Patrick#patrick.largey@nazeman.org# www.nazeman.org ##许可证:GNU GPL ##版权所有(C)Nazeman# #版本 0.9-1日期:2002年2月16日#添加在同一窗口中打开的多个文件##版本:0.9日期:27.10.2001#初始版本##依赖关系:Nautilus(当然)#Gnome-utils(gdialog)#filesall =” ”而[[$#-gt 0] dofiles =`echo“ $ 1” | sed's / / \?/ g'`filesall =” $ files $ filesall” shiftdonegedit $ filesall&

Save and close the gedit window, and then execute the following command to make the script executable:

保存并关闭gedit窗口,然后执行以下命令以使脚本可执行:

chmod u+x ~/.gnome2/nautilus-scripts/Open\ with\ gedit

chmod u + x〜/ .gnome2 / nautilus-scripts / Open \ with \ gedit

Note that tab completion really helps here =)

请注意,制表符补全确实​​对这里有帮助=)

Now when you right click a file, you should see this:

现在,当您右键单击文件时,应该看到以下内容:

Tested on: Ubuntu Dapper, Ubuntu Edgy Eft

经过测试:Ubuntu Dapper,Ubuntu Edgy Eft

翻译自: https://www.howtogeek.com/howto/ubuntu/add-open-with-gedit-to-the-right-click-menu-in-ubuntu/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值