daily pastebin goal
64%
SHARE
TWEET

ps2 script

a guest Nov 26th, 2012 947 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #first 2 scripts i personally use to set the cpu-frequency and which are used in the scripts
  2. #cpufreq and cpufreq-ondemand copy both to usr/bin/ and make them executable
  3.  
  4. #cpufreq for quadcore
  5.  
  6. #!/bin/bash
  7.  
  8. cpufreq-selector -c 0 -g performance &
  9. cpufreq-selector -c 1 -g performance &
  10. cpufreq-selector -c 2 -g performance &
  11. cpufreq-selector -c 3 -g performance &
  12.  
  13.  
  14. #cpufreq-ondemand for quadcore
  15.  
  16. #!/bin/bash
  17.  
  18. cpufreq-selector -c 0 -g ondemand &
  19. cpufreq-selector -c 1 -g ondemand &
  20. cpufreq-selector -c 2 -g ondemand &
  21. cpufreq-selector -c 3 -g ondemand &
  22.  
  23.  
  24.  
  25. #ps2task core-optimization copy to /usr/bin/ and make it executable
  26. #this script will run in the background and will change the used cores if planetside2 has started
  27.  
  28. #!/bin/bash
  29.  
  30. sleep 15
  31.  
  32. OLDPID='a'
  33.  
  34. while true; do
  35.  
  36.         PS2PID=`ps -A | grep -m 1 'PlanetSide2.exe' | awk '{print $1}'`
  37.         WINESVRPID=`ps -A | grep -m 1 'wineserver' | awk '{print $1}'`
  38.         WINEDEVPID=`ps -A | grep -m 1 'winedevice.exe' | awk '{print $1}'`
  39.  
  40.         if [ ! $PS2PID ]; then
  41.                 echo 'PlanetSide 2 is not running'
  42.                 echo 'Processor is downgrading'
  43.         elif [ $OLDPID != $PS2PID ]; then
  44.                         echo 'PlanetSide 2 is getting tuned'
  45.                         OLDPID=$PS2PID
  46.                         taskset -pc 0-3 $WINESVRPID     #0-3 will use cores 0,1,2 and 3 ( quad )
  47.                         taskset -pc 0-3 $WINEDEVPID
  48.                         taskset -pc 0-3 $PS2PID
  49.                         echo 'Processor is optimizing'
  50.                         cpufreq &                       #starts the cpufreq-script
  51.                         exit    #terminates the script when the job is done
  52.                 else
  53.                         echo 'PlanetSide 2 is already tuned.'
  54.         fi
  55.         sleep 15
  56. done
  57.  
  58.  
  59.  
  60. #my launcher-script with cpu-freq loop ( cause i just want to use performance when i play )
  61.  
  62. #!/bin/sh
  63.  
  64. export WINEPREFIX=$HOME/.wine-planetside2
  65. export WINEDEBUG=-all
  66. export LD_PRELOAD="libpthread.so.0 libGL.so.1"
  67. export __GL_THREADED_OPTIMIZATIONS=1
  68. cd "$HOME/.wine-planetside2/drive_c/Program Files/Sony Online Entertainment/Installed Games/PlanetSide 2"
  69. ps2task &
  70. wmctrl -o 1920,1056     #optional ,used to go to workspace 2 ( Ubuntu 12.10 64bit, cause
  71.                         #devilspie will move the game to workspace 2 )
  72. wine Launchpad.exe > $HOME/ps2.log 2>&1         #save log
  73. PID='a'
  74. while true; do          #check if ps2 is running, if not quit ps2task if it's not terminated
  75.                         #and switch back to workspace 2
  76.  
  77.         PS2=`ps -A | grep -m 1 'PlanetSide2.exe' | awk '{print $1}'`
  78.         if [ ! $PS2 ]; then
  79.                 echo 'Processor is downgrading'
  80.                 wmctrl -o 0,0
  81.                 cpufreq_ondemand &              #reset cpufreq
  82.                 sleep 10
  83.                 xgamma -gamma 1         # resets gamma to default
  84.                 PS2T=`ps -A | grep -m 1 'ps2task' | awk '{print $1}'`
  85.                 kill -9 $PS2T
  86.                 exit
  87.         elif [ -n $PS2 ]; then
  88.                 #echo 'PlanetSide 2 is running'         #optional
  89.                 sleep 10
  90.         fi
  91. done
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top