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.
This script could very
easily be modified to work with about any game or application on your
system if need be.
If you're unfamiliar with dealing with
scripts, heres how to make it work.
1. copy the entire script
to a new text file on your desktop and save it as what ever you want.
It doesn't have to have a .sh extension, this is Linux, right?!
2.
right click on the file and select Properties from the context menu
that pops up. Click on the Permissions tab and make sure the 'allow
executing file as a program' box is checked. click ok. As an
alternative you can open a terminal in the folder where the file
resides and type 'chmod +x {filename}' without the ' or {} and
accomplish the same thing.
3. right click the file again and
open it with the text editor of your choice but avoid using "word
processors" like open office writer because of the encoding they
use on the text. For Ubuntu, gEdit is perfect. For Mint 13 try Pluma.
Use a simple "Notepad" style editor.
4. Read all the
comments, theres a lot of them to make it very self explanatory and
adjust the script according to your system specifics.
Make sure to keep a backup of the original script in case your edits cause a malfunction.
5.
Profit!
I'll put the entire script in the second post so
theres no doubt what to copy and paste. Grab everything folks and
enjoy!
Please remember that I am WAY NEW to bash scripts so if
it's sloppy or could be done in 1 line of code instead of 5, send me
an email and share your wisdom, don't flame in the thread. :) My
email is in the script in the next post.