After 'upgrading' my system from an old Mandrake 6.x to RedHat 6.1, the
fwin command/script stopped working. It should find and empty display
and launch windows there, but it just tries display :1. If its occupied,
X quits, of course.
I have found that the problem lies on the lines:
# Look for a display that X is not running on.
for XX in 0 1 2 3 4 5
do
ps ax | grep Xwrapper | grep :$XX > /dev/null
[ $? -ne 0 ] && break
echo X running on $XX
done
echo Trying display $XX.
More specifically, the 'grep Xwrapper' command.
I usually have 3 empty terminals reserved for X. xdm is on vt5. vt6 and
vt7 are reserverd if I need to use X while logged as another user. Have
have seen no 'Xwrapper' in 'ps' when 2 X's are running, and that's why
the script fails. It it finds no Xwrapper, so it just launches X on :1.
If I check for the X lock file, like /tmp/.X0-lock, things work
correctly for me. So by substitution of the 3 lines in the 'for' loop
with
if [ -e /tmp/.X$XX-lock ]; then
echo X running on $XX
else
break
fi
the 'fwin' script detects correctly an empty display to launch windows.
I am not an experienced programmer, and my bash skills a very limited,
so I might have overlooked some pitfalls. Just correct me and point me
int the right direction. My correction works on my RedHat 6.1 system.
Paulo
_______________________________________________
Win4Lin-users mailing list
[EMAIL PROTECTED]
http://lists.netraverse.com/mailman/listinfo/win4lin-users