-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTerminal_here
More file actions
executable file
·26 lines (24 loc) · 1006 Bytes
/
Terminal_here
File metadata and controls
executable file
·26 lines (24 loc) · 1006 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
#Open a terminal with the currentdir of nautilus as workdir.
#Don't need to select any file in the currentdir.
##########################################################################
# Nautilus "Terminal Here" Script #
##########################################################################
# #
# Created by Xinyu Du #
# Emails: glacier_05@yahoo.com.cn #
##########################################################################
if [ "$1" = "" ];then
wdir=${NAUTILUS_SCRIPT_CURRENT_URI#file://}
wdir=${wdir//%20/ }
else
filetype=$(file "$1")
filetype=${filetype##*: }
if [ "$filetype" = "directory" ];then
wdir=${NAUTILUS_SCRIPT_SELECTED_FILE_PATHS%%$1*}
wdir=$wdir/$1
else
wdir=${NAUTILUS_SCRIPT_SELECTED_FILE_PATHS%%$1*}
fi
fi
gnome-terminal --working-directory="$wdir"