You are here > Forums > PlayOnLinux > Diablo 3 - Script for Multi-Monitors
| New topic - Reply |
| Author | Replies |
| tnt533 | Friday 10 August 2012 at 4:31 - [Quote] |
| Rank: Member |
Heres a script I wrote today to disable
my secondary monitor, start the game and then automatically re-enable
it after the main Diablo II.exe process exits. Without the script you
have to manually reconfigure your monitors every time you're done
playing and it's a pain in the arse. Make sure to keep a backup of the original script in case your edits cause a malfunction. |
| tnt533 | Friday 10 August 2012 at 4:32 - [Quote] |
| Rank: Member |
#############################################
# Diablo III Multi-Monitor Script # by: Jay Moore # Email: crackmonkey24@gmail.com # I can not respond to all emails # # This script was specifically # designed to work with Daiblo 3 # installed on a Debian based disto # with PlayOnLinux. It will disable # your secondary monitor, launch the game # and then re-enable your secondary monitor # automatically when the main game process # terminates. Please feel free to use, edit # and redistibute this script all you want # but I retain the rights to this code. # Please do not redistribute this script # without this section. ############################################ #!/bin/bash ## Turn off left display # Use 'xrandr -q' at a terminal to find # the proper names of your displays # and subsitute in the first and last line # of this script. My secondary display is CRT1. # Yours likely will be different. xrandr --output CRT1 --off ## Start Diablo 3 # This command was obtained through the # properties dialog box of the shortcut # created on the desktop by PlayOnLinux /usr/share/playonlinux/playonlinux --run "Diablo III" %F # Allow a few seconds for the process to get # up and running before entering PID check sleep 5 # <- Probably not needed ## Wait until launcher/game closes # Do a 'whereis pidof' at a terminal # to determine the location of the pidof # executable on your system and change the # script accordingly. Also, make sure that # your PlayOnLinux wine prefix directory is # located within your path or you will possibly # have to use absolute path statements in the # code below. # # Blizzard Launcher check u=`/bin/pidof Blizzard\ Launcher.exe` while [ -n "$u" ] do u=`/bin/pidof Blizzard\ Launcher.exe` done ## Diablo III main process check t=`/bin/pidof Diablo\ III.exe` while [ -n "$t" ] do t=`/bin/pidof Diablo\ III.exe` done # Reenable left display after game # process ends. xrandr --output CRT1 --auto --right-of DFP9 ################################################### # Final Thoughts. # You can also modify and incorporate the code # below which I obtained from this forum post; # https://bbs.archlinux.org/viewtopic.php?id=99550 # to automatically check if compiz is running # and switch to the window manager of your choice # and then back again at the end of the script. # I had issues with compiz flaking out after the # script terminated. Your mileage may vary. If you # do manage to come up with something that works # well please email the code and results to # crackmonkey24@gmail.com. Scripting is new to me # and I can use all the help I can get! ################################################## # if [ $(dbus-send --print-reply --type=method_call --dest=org.freedesktop.compiz /org/freedesktop/compiz/dbus/screen0 org.freedesktop.compiz.list 2>/dev/null | wc -l) -eq 0 ]; then # metacity --replace & #else # compiz --loose-binding --replace ccp & #fi |
174 people online
