aboutsummaryrefslogtreecommitdiff
path: root/terminal
blob: f5aa6757128ef67382945f421149a7c6e91f7dfa (plain)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
#
# Terminal emulator wrapper
#

source ~/.geometry || exit 1

if [ -z "$TITLE" ]; then
  if [ ! -z "$1" ]; then
    TITLE="$1"
  else
    TITLE="terminal"
  fi
fi

if [ ! -z "$GEOMETRY" ]; then
  DIMENSIONS="-g $GEOMETRY"
fi

if [ ! -z "$FONT" ]; then
  F_FONT="-F $FONT"
  FN_FONT="-fn $FONT"
  f_FONT="-f $FONT"
fi

if [ "$TERM" == "stterm" ]; then
  if [ ! -z "$1" ]; then
    stterm $f_FONT -T $TITLE -e bash -rcfile $HOME/.terminal -c "$*"
  else
    stterm $f_FONT -T $TITLE -e bash -rcfile $HOME/.terminal
  fi
elif [ "$TERM" == "rxvt" ]; then
  if [ ! -z "$1" ]; then
    rxvt-unicode -bg black +sb -fg white $FN_FONT $DIMENSIONS -title $TITLE \
                 -e bash -rcfile $HOME/.terminal -c "$*"
  else
    rxvt-unicode -bg black +sb -fg white $FN_FONT $DIMENSIONS -title $TITLE \
                 -e bash -rcfile $HOME/.terminal
  fi
elif [ "$TERM" == "Eterm" ]; then
  if [ ! -z "$1" ]; then
    Eterm  --background-pixmap 0 --scrollbar 0 +sb -b black -f white $F_FONT --borderless no \
           --buttonbar 0 $DIMENSIONS -n$TITLE -e bash -rcfile $HOME/.terminal -c "$*"
  else
    Eterm  --background-pixmap 0 --scrollbar 0 +sb -b black -f white $F_FONT --borderless no \
           --buttonbar 0 $DIMENSIONS -n$TITLE -e bash -rcfile $HOME/.terminal
  fi
elif [ "$TERM" == "xterm" ]; then
  if [ ! -z "$1" ]; then
    xterm -u8 $FN_FONT -geometry $GEOMETRY -title $TITLE -e bash -c "$*"
  else
    xterm -u8 $FN_FONT -geometry $GEOMETRY -title $TITLE -e bash
  fi
fi