One-Liner to kill all WINEPREFIX instances

Every now and then a casual game run with wine crashes on my girlfriend’s rig. She’s just a regular Ubuntu user and cannot be bothered with WINEPREFIX=~/.wine/game wineserver -k and probably some xrandr voodoo to correct screen resolution.

Hence putting the following in her .bashrc as an alias or a script helps a lot:

for i in ~/.wine/*; do WINEPREFIX=$i wineserver -k && xrandr -s 1366x768; done

One Response to “One-Liner to kill all WINEPREFIX instances”

  1. Since that doesn’t scale well if you have tons and tons of wineprefixes, I wrote something which works the other way and I thought you might want it.

    https://gist.github.com/ssokolow/9833321

    (It grabs a list of all running wineserver instances, then retrieves their environment variables using /proc//environ, and only calls wineserver -k for prefixes which actually have running processes.)

Leave a Reply