File: xfterm4

package info (click to toggle)
xfce4-utils 4.4.2-8
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 3,388 kB
  • ctags: 155
  • sloc: sh: 9,593; xml: 1,457; ansic: 1,312; makefile: 330
file content (39 lines) | stat: -rwxr-xr-x 820 bytes parent folder | download | duplicates (4)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh

if [ "$1" = "-e" ]; then
	if [ -n "$2" ]; then
		shift
		ESTRING="$@"
	else
		shift
	fi
fi	

if [ -d "$*" ]; then
	cd "$*"
elif [ -x "$*" ]; then
	cd `dirname "$*"`
	ESTRING="`which pauseme`"
	MSTRING="$*"
elif [ -f "$*" ]; then
	ESTRING="`which less`"
	MSTRING="$*"
elif [ "`echo $* | grep "http:/"`" -o "`echo $* | grep "ftp:"`" ]; then
	# This requires lynx or links. If you don't have it, don't drop URLs.
	if which lynx >/dev/null 2>&1; then
		ESTRING="`which lynx`"
	elif which links >/dev/null 2>&1; then
		ESTRING="`which links`"
	fi
	MSTRING="$*"
fi

if [ x"$ESTRING" = x"" ]; then
	exec exo-open --launch TerminalEmulator
elif [ x"$MSTRING" = x"" ]; then
	exec exo-open --launch TerminalEmulator $EXEC"$ESTRING"
else
	exec exo-open --launch TerminalEmulator $EXEC"$ESTRING" "$MSTRING"
fi

exit 0