-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbigsh
executable file
·191 lines (177 loc) · 4.31 KB
/
bigsh
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
#!/bin/sh
#==============================================================================
# bigsh
# File ID: b834114a-fa6f-11dd-bf5e-000475e441b9
#
# Fyrer opp en stor xterm i X
#
# Det ender som oftest i
#
# --small:
# xterm -u8 -fn -misc-fixed-medium-r-semicondensed-*-*-120-*-*-c-*-iso10646-1 \
# -fb -misc-fixed-medium-r-semicondensed-*-*-120-*-*-c-*-iso10646-1 -bg black \
# -fg white -bc -geometry 211x67+0+0
#
# --big:
# xterm -u8 -fn -Misc-Fixed-Medium-R-Normal--18-120-100-100-C-90-ISO10646-1 \
# -bg black -fg white -bc -geometry 140x48+0-8
#
# Author: Øyvind A. Holm <[email protected]>
# License: GNU General Public License version 2 or later.
#==============================================================================
progname=bigsh
VERSION=0.2.0
opt_all=0
opt_big=0
opt_gdb=0
opt_help=0
opt_quiet=0
opt_small=1
opt_title=''
opt_verbose=0
while test -n "$1"; do
case "$1" in
-a|--all) opt_all=1; shift ;;
-b|--big) opt_big=1; opt_small=0; shift ;;
-g|--gdb) opt_gdb=1; shift ;;
-h|--help) opt_help=1; shift ;;
-q|--quiet) opt_quiet=$(($opt_quiet + 1)); shift ;;
-s|--small) opt_small=1; opt_big=0; shift ;;
-T|--title) opt_title="$2"; shift 2 ;;
-v|--verbose) opt_verbose=$(($opt_verbose + 1)); shift ;;
--version) echo $progname $VERSION; exit 0 ;;
--) shift; break ;;
*)
if printf '%s\n' "$1" | grep -q ^-; then
echo "$progname: $1: Unknown option" >&2
exit 1
else
break
fi
break ;;
esac
done
opt_verbose=$(($opt_verbose - $opt_quiet))
if test "$opt_help" = "1"; then
test $opt_verbose -gt 0 && { echo; echo $progname $VERSION; }
cat <<END
Usage: $progname [options] [COMMAND]
Create xterm windows and execute optional COMMAND in it.
Options:
-a, --all
Create all windows.
-b, --big
Use big fonts.
-g, --gdb
Create window for gdb(1).
-h, --help
Show this help.
-q, --quiet
Be more quiet. Can be repeated to increase silence.
-s, --small
Use small fonts. This is the default.
-T TITLE, --title TITLE
Use TITLE as xterm title.
-v, --verbose
Increase level of verbosity. Can be repeated.
--version
Print version information.
END
exit 0
fi
winc=''
wintitle="$opt_title"
[ -z "$wintitle" ] && wintitle=$(hostname)
start_xterm() {
local geom=$1
shift
if [ "$opt_big" = "1" ]; then
sess -d $progname.$wintitle -t c_$progname -- xterm \
-u8 \
-fn -Misc-Fixed-Medium-R-Normal--18-120-100-100-C-90-ISO10646-1 \
-bg black \
-fg white \
-bc \
-T "$wintitle" \
-geometry $geom "$@" &
else
sess -d $progname.$wintitle -t c_$progname -- xterm \
-u8 \
-fn -misc-fixed-medium-r-semicondensed-*-*-120-*-*-c-*-iso10646-1 \
-fb -misc-fixed-medium-r-semicondensed-*-*-120-*-*-c-*-iso10646-1 \
-bg black \
-fg white \
-bc \
-T "$wintitle" \
-geometry $geom "$@" &
fi
winc="$winc $wintitle"
}
if [ -e /carmbb.mrk ]; then
if [ "$opt_small" = "1" ]; then
start_xterm 131x40+0+0 "$@"
else
start_xterm 87x29+0+0 "$@"
fi
elif [ -e /bellmann ]; then
start_xterm 180x56+0+0 "$@"
elif [ -e /hpelite1 ]; then
if [ "$opt_gdb" = "1" -o "$opt_all" = "1" ]; then
[ -z "$opt_title" ] && wintitle=gdb
if [ "$opt_big" = "1" ]; then
start_xterm 39x39+1002+0 "$@"
else
start_xterm 59x54+1002+0 "$@"
fi
fi
if [ "$opt_all" = "1" ]; then
wintitle=sunbase
if [ "$opt_big" = "1" ]; then
start_xterm 110x39+0+0 "$@"
else
start_xterm 165x54+0+0 "$@"
fi
fi
if [ "$opt_all" = "1" -o -z "$winc" ]; then
[ -z "$opt_title" ] && wintitle=hpelite1
if [ "$opt_big" = "1" ]; then
start_xterm 110x39+0+0 "$@"
else
start_xterm 165x54+0+0 "$@"
fi
fi
elif [ -e /sunbase ]; then
if [ "$opt_gdb" = "1" -o "$opt_all" = "1" ]; then
[ -z "$opt_title" ] && wintitle=gdb
if [ "$opt_big" = "1" ]; then
start_xterm 29x36+996+0 "$@"
else
start_xterm 43x50+996+0 "$@"
fi
fi
if [ "$opt_all" = "1" ]; then
wintitle=sunbase
if [ "$opt_big" = "1" ]; then
start_xterm 110x36+0+0 "$@"
else
start_xterm 165x50+0+0 "$@"
fi
fi
if [ "$opt_all" = "1" -o -z "$winc" ]; then
[ -z "$opt_title" ] && wintitle=xterm
if [ "$opt_big" = "1" ]; then
start_xterm 110x36+0+0 "$@"
else
start_xterm 165x50+0+0 "$@"
fi
fi
elif [ -e /dundre.mrk ]; then
if [ "$opt_small" = "1" ]; then
start_xterm 211x55+0+0 "$@"
else
start_xterm 87x29+0+0 "$@"
fi
else
start_xterm 165x25+0+0 "$@"
fi
# vim: set ts=8 sw=8 sts=8 noet fo+=w tw=79 fenc=UTF-8 :