ubuntuに右クリックを追加してメニューを開く



1つ目の方法:
パッケージをインストールすると、右クリックで「端末を開く」メニューを追加できます.
sudo apt-get install nautilus-open-terminal
 
2つ目の方法:
メインディレクトリの.gnome 2/nautilus-scriptsディレクトリに入ります.新しいファイルを作成します.ファイル名は任意です(このファイル名は右クリックメニューに表示されますが、「端末を開く」や「open-terminal」など、分かりやすいものが望ましいです).ファイルの内容は以下の通りです.
参照
#!/bin/bash
#
# This script opens a gnome-terminal in the directory you select.
#
# Distributed under the terms of GNU GPL version 2 or later
#
# Install in ~/.gnome2/nautilus-scripts or ~/Nautilus/scripts
# You need to be running Nautilus 1.0.3+ to use scripts.
# When a directory is selected, go there. Otherwise go to current
# directory. If more than one directory is selected, show error.
if [ -n "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" ]; then
set $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
if [ $# -eq 1 ]; then
destination="$1"
# Go to file's directory if it's a file
if [ ! -d "$destination" ]; then
destination="`dirname "$destination"`"
fi
else
zenity --error --title="Error - Open terminal here" /
--text="You can only select one directory."
exit 1
fi
else
destination="`echo "$NAUTILUS_SCRIPT_CURRENT_URI" | sed 's/^file://////'`"
fi
# It's only possible to go to local directories
if [ -n "`echo "$destination" | grep '^[a-zA-Z0-9]/+:'`" ]; then
zenity --error --title="Error - Open terminal here" /
--text="Only local directories can be used."
exit 1
fi
cd "$destination"
exec x-terminal-emulator

あるいは以下のように、この2つのCOPYのどちらが便利かはCOPYのどちらかです.内容は同じです...
#!/bin/bash # # This script opens a gnome-terminal in the directory you select. # # Distributed under the terms of GNU GPL version 2 or later # # Install in ~/.gnome2/nautilus-scripts or ~/Nautilus/scripts # You need to be running Nautilus 1.0.3+ to use scripts. # When a directory is selected, go there. Otherwise go to current # directory. If more than one directory is selected, show error. if [ -n "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS"]; then set $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS if [ $# -eq 1 ]; then destination="$1"# Go to file's directory if it's a file if [ ! -d "$destination"]; then destination="`dirname "$destination"`"fi else zenity --error --title="Error - Open terminal here"/--text="You can only select one directory."exit 1 fi else destination="`echo "$NAUTILUS_SCRIPT_CURRENT_URI"| sed 's/^file://////'`"fi # It's only possible to go to local directories if [ -n "`echo "$destination"| grep '^[a-zA-Z0-9]/+:'`"]; then zenity --error --title="Error - Open terminal here"/--text="Only local directories can be used."exit 1 fi cd "$destination"exec x-terminal-emulator 
 
追加が完了したら、このファイルに実行可能な権限を追加します.
 
chmod+xファイル
 
2つの方法の優劣を説明します.
 
1.2つ目の方法は、右クリックメニューにscriptsというメニューを追加する2級メニューです.このメニューの下に必要な「端末を開く」または「open-terminal」(この場所の名前は新しいスクリプトのファイル名)があるので、少し不便に見えます.1つ目の方法は、右クリックメニューに直接メニューを追加することです.
 
2.どちらの方法もnautilusに基づいており、どのnautilusのインタフェースでもこの機能を有効にすることができます.特に2つ目の方法は、現在のディレクトリを識別し、開いている端末のデフォルトが現在のディレクトリであることを人間的に認識します.1つ目の方法は、どのディレクトリにいても、開いてからデフォルトのディレクトリがメインディレクトリです.