Advertisement
Guest User

ps2optimize

a guest
Oct 30th, 2012
725
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.52 KB | None | 0 0
  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-ps2clean
  65. cd "$HOME/.wine-ps2clean/drive_c/PlanetSide 2 Beta"
  66. #winecfg
  67. ps2task &   #starts the above script
  68. WINEDEBUG=fixme-all wine Launchpad.exe > $HOME/ps2.log 2>&1
  69. PID='a'
  70. while true; do
  71.  
  72.         PS2=`ps -A | grep -m 1 'PlanetSide2.exe' | awk '{print $1}'`
  73.     if [ ! $PS2 ]; then
  74.         echo 'Processor is downgrading'
  75.         cpufreq_ondemand &  #standard cpu-freq-setting
  76.         sleep 10
  77.         xgamma -gamma 1     #resets gamma to default, cause i play wit higher  
  78.                     #brightness ingame
  79.         exit            #ends the script when planetside2 was closed
  80.     elif [ -n $PS2 ]; then
  81.                 echo 'PlanetSide 2 is running'
  82.         sleep 100
  83.     fi
  84. done
  85. sleep 10
  86. xgamma -gamma 1
  87. PS2T=`ps -A | grep -m 1 'ps2task' | awk '{print $1}'`
  88.     if [ -n $PS2T ]; then
  89.         kill -9 $PS2T
  90.     fi
  91. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement