]> git.rmz.io Git - dotfiles.git/blob - bin/grimfandango
bin: add cmk
[dotfiles.git] / bin / grimfandango
1 #!/bin/bash
2 WINEPREFIX=/mnt/sdd5/ramsi/wineprefixes/grim-fandango wine "C:\GRIM\GRIMFANDANGO.EXE" &
3
4 # Get list of Grim Fandango threads. And don't forget to remove the grep ID from the list!
5 GRIM_THREADS=`ps -LFfea | grep GRIMFANDANGO.EXE | grep -Ev 'grep' | awk '{printf($4); printf(" ")}'`
6
7 # Wait until the 5 threads are created
8 THREAD_COUNT=`echo $GRIM_THREADS | wc -w`
9 while [ $THREAD_COUNT -lt 5 ]
10 do
11 echo "Waiting for threads to be ready. Hit Ctrl-C if it hangs here after closing the game."
12 sleep 1
13 GRIM_THREADS=`ps -LFfea | grep GRIMFANDANGO.EXE | grep -Ev 'grep' | awk '{printf($4); printf(" ")}'`
14 THREAD_COUNT=`echo $GRIM_THREADS | wc -w`
15 done
16
17 # The 5 Grim Fandango threads are ready. Set affinity!!!
18 for CURRENT_THREAD in $GRIM_THREADS
19 do
20 # Set affinity to the first system processor
21 echo "Setting thread " $CURRENT_THREAD " affinity!"
22 taskset -pc 0 $CURRENT_THREAD
23 done
24
25 echo "READY!!!"