Hello,
I've implemented a short dtksh script, appended below, which allows me to
move certain windows on the CDE desktop to other workspaces automatically.
This works without problems under Solaris 2.6 and Solaris 7.
However I just can't get it to work under Tru64 4.0e,f and 5.0.
It get all sorts of weird error messages which lead me to the conclusion
that the script is somehow just cut off internally. The error messages
depend, for instance on how many comment lines I've put at the beginning
of the file.
Here's what I get with the unmodified file below:
$ cdesetws.sh xterm 2
cdesetws.sh: line 34: syntax error at line 39: ``' unmatched
Any ideas anyone? I've tried for more than 2 hours now without any
success. Is dtksh broken under Tru64?
Thanks // Tom
P.S: Here's the script. Under Solaris, it can be tested by starting
an xterm with "xterm &". The xterm window can then be moved to,
say, workspace #2 with "cdesetws.sh xterm 2"
-------------- cdesetws.sh -----------
#!/usr/dt/bin/dtksh
# $Id: cdesetws.sh,v 1.1 2000/02/29 11:28:10 tom Exp $
# ---------------------------------------------------------------------------
#
# File: cdesetws.sh
# Desc: Move an existing window by name to a specified CDE workspace.
# Usage: cdesetws.sh <window-name> <workspace-number>
#
# $Log: cdesetws.sh,v $
# Revision 1.1 2000/02/29 11:28:10 tom
# Initial revision
#
# ---------------------------------------------------------------------------
#
if [ $# -ne 2 ]; then
echo 'Usage: cdesetws.sh <window-name> <workspace-number>'
exit 1
fi
wname=$1
wsn=$2
#
# get the window number
#
XWI=`which xwininfo`
echo $XWI | grep found >/dev/null 2>/dev/null
if [ $? -ne 0 ]; then
XWI=
if [ -x /usr/bin/X11/xwininfo ]; then
XWI=/usr/bin/X11/xwininfo
fi
if [ -x /usr/openwin/bin/xwininfo ]; then
XWI=/usr/openwin/bin/xwininfo
fi
if [ "$XWI" = "" ]; then
echo "** ERROR: cdesetws.sh cannot find xwininfo !!"
exit 1
fi
fi
WIN=`$XWI -name $wname 2>/dev/null | grep "Window id:" | awk '{ print $4 }'`
if [ "$WIN" = "" ]; then
echo "** ERROR: cdesetws.sh cannot find window name $wname !!"
exit 1
fi
#
# init X and move the window.
#
XtInitialize TOPLEVEL cdesetws Dtksh $0 2>/dev/null
XtDisplay DISP $TOPLEVEL
XtScreen SCREEN $TOPLEVEL
XRootWindowOfScreen RWIN $SCREEN
DtWsmGetWorkspaceList $DISP $RWIN WSALL
if [ "$WSALL" != "" ]; then
WS=`echo $WSALL | tr , "\\n" | head -$wsn | tail -1`
DtWsmSetWorkspacesOccupied $DISP $WIN $WS
fi
XFlush $DISP
XSync $DISP false
exit 0
#
# end of file
--
--------------------------------------------------------------------------
Dr. Tom Leitner Dept. of Communications
Graz University of Technology,
e-mail : tom_at_radar.tu-graz.ac.at Inffeldgasse 12
Phone : +43-316-873-7455 A-8010 Graz / Austria / Europe
Fax : +43-316-463-697
Home page : http://wiis.tu-graz.ac.at/people/tom.html
PGP public key on : ftp://wiis.tu-graz.ac.at/pgp-keys/tom.asc or send
mail with subject "get Thomas Leitner" to pgp-public-keys_at_keys.pgp.net
--------------------------------------------------------------------------
Before we have the paperless office, we have the paperless toilet!
Received on Tue Feb 29 2000 - 11:36:46 NZDT