nautilus如何自定义文件右键菜单(比如在GVim新标签页中打开)?
- redhatlinux10
- 帖子: 773
- 注册时间: 2008-01-22 23:24
- 来自: 三亚
- 联系:
nautilus如何自定义文件右键菜单(比如在GVim新标签页中打开)?
windows下可以通过修改注册表来实现,如下所示:
[reg]
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\Shell\在&GVim新标签页中打开]
[HKEY_CLASSES_ROOT\*\Shell\在&GVim新标签页中打开\command]
@="\"d:\\Program Files\\Vim\\vim73\\gvim.exe\" -p --remote-tab-silent \"%1\" \"%*\""
[/reg]
ubuntu的nautilus中如何实现?
[reg]
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\Shell\在&GVim新标签页中打开]
[HKEY_CLASSES_ROOT\*\Shell\在&GVim新标签页中打开\command]
@="\"d:\\Program Files\\Vim\\vim73\\gvim.exe\" -p --remote-tab-silent \"%1\" \"%*\""
[/reg]
ubuntu的nautilus中如何实现?
牛牛博客
linux 系统中 Chrome 地址栏输入卡顿的解决方法
Linux 下 MPV 和 VLC 播放器 VAAPI 显卡加速对比
---
using : openSUSE 13.2 ( 3.16.6-2 x86_64 ) , KDE 4.14.2
linux 系统中 Chrome 地址栏输入卡顿的解决方法
Linux 下 MPV 和 VLC 播放器 VAAPI 显卡加速对比
---
using : openSUSE 13.2 ( 3.16.6-2 x86_64 ) , KDE 4.14.2
- eexpress
- 帖子: 58428
- 注册时间: 2005-08-14 21:55
- 来自: 长沙
Re: nautilus如何自定义文件右键菜单(比如在GVim新标签页中打开)?
代码: 全选
● cat /home/eexp/.gnome2/nautilus-scripts/open-terminal-here.pl
#!/usr/bin/perl -w
# Open terminal here
#
# Nautilus script that opens a gnome-terminal at the current location, if it's
# a valid one. This could be done in shell script, but I love Perl!.
#
# 20020930 -- Javier Donaire <[email protected]>
# http://www.fraguel.org/~jyuyu/
# Licensed under the GPL v2+
#
# Modified by: Dexter Ang [[email protected]]
# 2003-12-08: Modified for Gnome 2.4
# - Added checking if executed on Desktop "x-nautilus-desktop:///"
# so that it opens in /home/{user}/Desktop
#use strict;
$outfile="$ENV{HOME}/env";
#$_=$ENV{'NAUTILUS_SCRIPT_NEXT_PANE_SELECTED_URIS'};
#`echo $_>~/env`;
#use Storable;
#store \%ENV, '/home/eexp/env';
use Data::Dumper;
#Save
$Data::Dumper::Purity = 1;
open FILE, ">$outfile" or die "Can't open '$outfile':$!";
print FILE Data::Dumper->Dump([\%ENV], ['*ENV']);
print FILE $ENV{'NAUTILUS_SCRIPT_SELECTED_FILE_PATHS'};
close FILE;
$_ = $ENV{'NAUTILUS_SCRIPT_CURRENT_URI'};
if ($_ and m#^file:///#) {
s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;
s#^file://##;
exec "gnome-terminal --working-directory='$_'";
}
# Added 2003-12-08 Dexter Ang
if ($_ eq "x-nautilus-desktop:///") {
$_ = $ENV{'HOME'};
$_ = $_.'/Desktop';
exec "gnome-terminal --working-directory='$_'";
}
● 鸣学
- lilydjwg
- 论坛版主
- 帖子: 4258
- 注册时间: 2009-04-11 23:46
- 系统: Arch Linux
- 联系:
Re: nautilus如何自定义文件右键菜单(比如在GVim新标签页中打开)?
Nautilus 支持脚本,不过是二级菜单(把脚本放到 ~/.gnome2/nautilus-scripts/),如果要自定义一级菜单的话得写成插件。
- eexpress
- 帖子: 58428
- 注册时间: 2005-08-14 21:55
- 来自: 长沙
- qy117121
- 论坛版主
- 帖子: 50587
- 注册时间: 2007-12-14 13:40
- 系统: Winbuntu
- 来自: 志虚国乌由市
- 联系:
- redhatlinux10
- 帖子: 773
- 注册时间: 2008-01-22 23:24
- 来自: 三亚
- 联系:
Re: nautilus如何自定义文件右键菜单(比如在GVim新标签页中打开)?
感谢eexpress的指引,我已经用nautilus-actions实现了我的要求。eexpress 写了:设置mime和nautilus-actions,都可以一级。lilydjwg 写了:如果要自定义一级菜单的话得写成插件。
viewtopic.php?f=86&t=317461
另外,有一个nautilus-actions的使用疑问:
icon不能使用自定义的图片吗?比如
代码: 全选
/usr/share/pixmaps/vim.svg
牛牛博客
linux 系统中 Chrome 地址栏输入卡顿的解决方法
Linux 下 MPV 和 VLC 播放器 VAAPI 显卡加速对比
---
using : openSUSE 13.2 ( 3.16.6-2 x86_64 ) , KDE 4.14.2
linux 系统中 Chrome 地址栏输入卡顿的解决方法
Linux 下 MPV 和 VLC 播放器 VAAPI 显卡加速对比
---
using : openSUSE 13.2 ( 3.16.6-2 x86_64 ) , KDE 4.14.2
- eexpress
- 帖子: 58428
- 注册时间: 2005-08-14 21:55
- 来自: 长沙
- redhatlinux10
- 帖子: 773
- 注册时间: 2008-01-22 23:24
- 来自: 三亚
- 联系:
Re: nautilus如何自定义文件右键菜单(比如在GVim新标签页中打开)?
就是这么选择的,只是没有任何效果而已。。。eexpress 写了:Icon边上,不是有Browse的按钮。你试试吧。
- eexpress
- 帖子: 58428
- 注册时间: 2005-08-14 21:55
- 来自: 长沙
-
- 帖子: 2
- 注册时间: 2010-02-24 19:21