great stability with X :1, scripted

Questions about Wine on Linux
Locked
Henry
Newbie
Newbie
Posts: 3
Joined: Mon Jun 25, 2012 12:42 pm

great stability with X :1, scripted

Post by Henry »

hi!!

in the past few days, I have been experiencing great wine stability by using another instance of X, here is the script:

Code: Select all

if [[ $1 = "run" ]]; then
    wine Game.exe
elif [[ $1 = "X1" ]]; then
    function FUNCisX1running {
      ps -A -o command |grep -v "grep" |grep -q -x "X :1"
    }
    
    if ! FUNCisX1running; then
      xterm -e "sudo X :1"&
    fi
    
    # wait for X to start
    while ! FUNCisX1running; do
      sleep 1
    done

    # run in a thread, prevents I from ctrl+c at xterm here 
    # what breaks THIS X :0 instace and locks the keyboard! :/
    xterm -display :1 -e "cd $HOME/Wine; $0 run; bash"&
fi
(you will have to adapt the "run" part to your game)

therefore, my guess is there is some conflict with ubuntu 12.04 unity + compiz plugins, that caused my machine to freeze each half to 1 hour of wine game play...

now, I can play how long I want, the game will only crash because of its own bugs, not anymore because of linux window manager etc..

so, I would like to ppl to try this, and report;

but to ask even more, if there could have an option in winecfg, to let we opt to instantiate another X session and manage it,

because right now, after exiting the game or if it crashes by its own bugs, I have to go on the terminal I issued "sudo X :1" and hit ctrl+c, and run the script again;

so wine could create a popup to terminate the other X session;

you still have to ctrl+alt+f7 or f8 or f9 to access it and get back to your normal X session;

Obs.: I couldnt keep my keyboard layout values I dont know why, even if I try to setup them there with xmodmap.. so if someone find a workaround for this, I would like to know also! (what I did was to change the keys at the game configuration but couldnt yet for the new X :1 session as a whole)

thx!
Henry
Newbie
Newbie
Posts: 3
Joined: Mon Jun 25, 2012 12:42 pm

Post by Henry »

(I cant edit my post???)

well, I forgot to explain better this line:

xterm -display :1 -e "cd $HOME/Wine; $0 run; bash"&

"cd $HOME/Wine" is the root of all my wine prefixes, I have one for each game, you can adapt it safely.

the endind "bash" is to leave the terminal at "X :1" opened after executing the game, tho, it is not exactly usefull as I cant focus such window anymore after I end the game, having to terminate X :1 session and restart it; later I will try with xdotool to see if it can get the focus again; but that is not that important I think...
Locked