File: xcinterm

package info (click to toggle)
xcin 2.5.2-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 3,732 kB
  • ctags: 2,972
  • sloc: ansic: 26,256; sh: 2,294; makefile: 864
file content (62 lines) | stat: -rw-r--r-- 1,296 bytes parent folder | download
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
#!/bin/sh
#
#  xcinterm 0.1 (2000-08-25), a sh script for starting the xcin+crxvt combo.
#
#  Copyright (C) 2000  Anthony Fok <foka@debian.org>
#  GNU General Public License, version 2 or later

progname=xcinterm
suffix=`/usr/bin/basename $0 | /bin/sed "s/^$progname-//"`
if [ "$suffix" = "xcinterm" ]; then suffix=big5; fi

# Determine the proper font size for the terminal.

dimensions=`/usr/bin/X11/xdpyinfo | /bin/grep '^  dimensions:' \
	| /bin/sed 's/^  dimensions: \+\([0-9]\+x[0-9]\+\) pixels.*/\1/'`
width=`echo $dimensions | sed 's/x[0-9]\+//'`
height=`echo $dimensions | sed s/'[0-9]\+x//'`

if [ "$width" -ge "1024" -a "$height" -ge "768" ]; then
	size=24
else
	size=16
fi
fn="-sony-*-$size-*-iso8859-1"

case $suffix in
	big5)
		locale=zh_TW.Big5
		fm=taipei$size
	;;
	big5hkscs)
		locale=zh_HK.Big5HKSCS
		fm="-*-$size-${size}0-*-big5hkscs-0"
	;;
	gb|gb2312)
		locale=zh_CN.GB2312
		case $size in
			16)  fm=hanzigb16fs ;;
			24)  fm=hanzigb24st ;;
		esac
	;;
	gbk)
		locale=zh_CN.GBK
		fm="-*-$size-${size}0-*-gbk-0"
	;;
esac

LANG=$locale
LC_CTYPE=$locale
if [ "$suffix" = "big5" ]; then
	im=xcin
else
	im=xcin-$locale
fi
XMODIFIERS="@im=$im"
export LANG LC_CTYPE XMODIFIERS


# Finally, run xcin and crxvt.

/usr/bin/xcin &
/usr/bin/X11/crxvt -ls -fm "$fm" -fn "$fn" -im "$im" &