User:Byte/Wine tricks

From Worms Knowledge Base

< User:Byte
Revision as of 13:35, 9 September 2007 by Byte (Talk | contribs) (New page: (My screen resolution is 1024x768 and the available space after title bar/gnome panels is 1024x675.) Set your wine desktop resolution to the maximum available space (you'll need to experi...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

(My screen resolution is 1024x768 and the available space after title bar/gnome panels is 1024x675.)

Set your wine desktop resolution to the maximum available space (you'll need to experiment - WA handles variable height but is picky about width).

Get xlayout and run this script just before running WA:

#!/bin/bash
FULL_WIDTH=1024
FULL_HEIGHT=675
FULL_POS_X=-1
FULL_POS_Y=+0
NORMAL_WIDTH=640
NORMAL_HEIGHT=480
NORMAL_POS_X=+144
NORMAL_POS_Y=+112
LAST=0
LOST=0
while true; do
	DATA="`xlayout --show --name "Wine desktop"`"
	if [ $? -eq 0 ]; then
		WIDTH="`echo "$DATA"|grep "Window Width:"|awk '{print $3}'`"
		if [ "$WIDTH" != "$LAST" ]; then
			if [ "$WIDTH" = "$FULL_WIDTH" ]; then
				echo Moving window to full size position
				xlayout --set --name "Wine desktop" --geometry "${FULL_WIDTH}x${FULL_HEIGHT}${FULL_POS_X}${FULL_POS_Y}"
			elif [ "$WIDTH" = "$NORMAL_WIDTH" ]; then
				echo Moving window to normal size position
				xlayout --set --name "Wine desktop" --geometry "${NORMAL_WIDTH}x${NORMAL_HEIGHT}${NORMAL_POS_X}${NORMAL_POS_Y}"
			fi
		fi
		LAST="$WIDTH"
		LOST=10
	else
		LOST=$(($LOST + 1))
		if [ $LOST -ge 10 ]; then
			exit 0
		fi
	fi
	sleep 2
done

This will move the WA window to the top left in the exact position needed to see everything, and then move it back again when the game is over! You'll need to modify the normal/full size and position values yourself.

Personal tools