Some quick and dirty utilities that do not deserve a dedicated repository

root / term

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
40
41
#!/bin/sh

set -e

XTERMS_LIST="/usr/bin/x-terminal-emulator /usr/bin/urxvtcd /usr/bin/urxvt /usr/bin/uxterm"

if test -n "$XTERM"
then
    p=$(printf $XTERM)
    if type "$XTERM" >/dev/null 2>&1
    then
        "$XTERM" "$@"
        exit $?
    elif type "$p" >/dev/null 2>&1
    then
        $XTERM "$@"
        exit $?
    fi
fi

if test -n "$GNOME_DESKTOP_SESSION_ID"
then
    if test -x /usr/bin/gnome-terminal
    then
        exec /usr/bin/gnome-terminal "$@"
    fi
fi

for xterm in $XTERMS_LIST
do
    if test -x "$xterm"
    then
        exec "$xterm" "$@"
    fi
done

cat <<EOM >&2
Couldn't find a suitable terminal emulator!
Set the XTERM environment variable to your desired terminal emulator.
EOM
exit 1