nautilus-open-terminal鼠标右键打开终端


1.1
fedora安装
# yum -y install nautilus-open-terminal安装nautilus-open-terminal,注销下X桌面即可

ubuntu安装
#sudo apt-get install nautilus-open-terminal

1.2在用源码包安装时如果出现这个错误

checking for NAUTILUS... configure: error: Package requirements (lib nautilus-extension >= 2.17.2 glib-2.0 >= 2.4.0) were not met:

Package gio-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gio-2.0.pc' to the PKG_CONFIG_PATH environment variable Package 'gio-2.0', required by 'libnautilus-extension', not found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables NAUTILUS_CFLAGS and NAUTILUS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.

说明有相关安装包没有:
利用build-dep选项安装所有依赖包
sudo apt-get build-dep nautilus-open-terminal
(apt-get build-dep 自动下载并安装通过源码创建 时需要的包。 只有apt 0.5以上版本才支持这个功能)

1.3其他解决方案

利用nautilus脚本
1.在文件夹 ~/.gnome2/nautilus-scripts/  下新建脚本文件如open_nautilus_terminal名字

#!/bin/bash cd `dirname $NAUTILUS_SCRIPT_CURRENT_URI`
exec gnome-terminal

2.更改权限
chmod +x open_nautilus_terminal

3.这时就可以在右键菜单-》脚本-》open_nautilus_terminal,点击就可以在nautilus当前位置打开终端了

更高级的一个脚本

#!/bin/bash
base="`echo $NAUTILUS_SCRIPT_CURRENT_URI | cut -d'/' -f3- | sed 's/%20/ /g'`"

if [ -z "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" ]; then
dir=${base}
else
while [ ! -z "$1" -a ! -d "${base}/$1" ]; do
shift
done
dir="${base}/$1"
fi

gnome-terminal --working-directory="${dir}"

替换脚本1内容,这时我们可以在右键选中一个文件夹时,点击--》脚本--》open_nautilus_terminal就可以在选中的文件夹位置打开终端


你可能感兴趣的:(nautilus-open-terminal鼠标右键打开终端)