Tray icon not showing up if wine was run previously with DISPLAY unset?

Dan Kegel dank at
Fri Feb 4 13:57:21 CST 2011

So, I've got this shell script that does something like
  h=`wine winepath -w $HOME`
  wine autohotkey run-setup.ahk
Works great.  However, if the user has selected to run
wine in a virtual desktop, running winepath will start up
and then shut down the virtual desktop, which is visually annoying.

Second try: unset DISPLAY when running winepath, e.g.
  h=`DISPLAY= wine winepath -w $HOME`
  wine autohotkey run-setup.ahk
Works great; now winepath doesn't pop up the desktop.
Except now autohotkey's tray icon doesn't show up at all,
which makes it hard to debug the autohotkey script.
(The setup that autohotkey runs can access X just fine,
so the problem seems confined to the tray icon.)
Is the lack of tray icon a wine bug, or a user error?

Third try: wait for wineserver to exit before starting autohotkey
  h=`DISPLAY= wine winepath -w $HOME`
  wineserver -w
  wine autohotkey run-setup.ahk
but that's slower, and will hang if the user is running a wine app.

I guess I could do "sleep 5" but that's an awful kludge.
Probably I'll go back to letting the ugly virtual desktop pop up.
So, what's the proper way to run one app under wine *without* X
while letting other apps run wine *with* X?
- Dan

More information about the wine-devel mailing list