blob: 091016915907e9e73bf9ce8d9df629b31b817f01 (
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
55
56
57
58
59
60
61
62
63
64
65
66
|
#!/bin/bash
prog=$(basename $0)
thisfile=$(readlink -f "$0")
thisdir=$(dirname "$thisfile")
HALFILE="$thisdir"/help.hal
cd ;# so user can use halcmd 'save' to create a file
function popup () {
msg="$*"
wish <<EOF &
wm withdraw .
tk_messageBox \
-title "$prog" \
-message "$msg" \
-icon error \
-type ok
destroy .
EOF
} ;# popup
[ X"$TERM" = Xdumb ] && TERM=xterm
[ -x "$(which $COLORTERM)" ] && TERM=$COLORTERM
[ -z $TERM ] && TERM=xterm
# wip: xterm is well-behaved, some other terminals are not
# for now: force to xterm
TERM=xterm
REALTIME=$(linuxcnc_var REALTIME)
# make sure TERM uses the expected halrun (rip or install)
HALRUN=$(which halrun)
if [ ! -z "$debug" ] ; then
echo COLORTERM=$COLORTERM
echo TERM=$TERM
echo HALRUN=$HALRUN
echo REALTIME=$REALTIME
fi
if $REALTIME status >/dev/null ; then
msg="$prog: LinuxCNC is active"
echo "$msg"
popup "$msg"
exit 1
fi
# terminate any other halrun instance:
$HALRUN -U >/dev/null 2>&1
if [ X"$TERM" = Xxterm ] ; then
$TERM -geometry 80x40 \
-sb \
-fg black -bg ivory2 \
-title "halrun (Use Ctrl-L-button, Ctrl_R-button for xterm options)" \
-e "echo Working_Directory=$(pwd);echo; $HALRUN -I $HALFILE"
else
$TERM -e "$HALRUN -I $HALFILE"
fi
# cleanup
halrun -U >/dev/null 2>&1
exit 0
|