Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #first 2 scripts i personally use to set the cpu-frequency and which are used in the scripts
- #cpufreq and cpufreq-ondemand copy both to usr/bin/ and make them executable
- #cpufreq for quadcore
- #!/bin/bash
- cpufreq-selector -c 0 -g performance &
- cpufreq-selector -c 1 -g performance &
- cpufreq-selector -c 2 -g performance &
- cpufreq-selector -c 3 -g performance &
- #cpufreq-ondemand for quadcore
- #!/bin/bash
- cpufreq-selector -c 0 -g ondemand &
- cpufreq-selector -c 1 -g ondemand &
- cpufreq-selector -c 2 -g ondemand &
- cpufreq-selector -c 3 -g ondemand &
- #ps2task core-optimization copy to /usr/bin/ and make it executable
- #this script will run in the background and will change the used cores if planetside2 has started
- #!/bin/bash
- sleep 15
- OLDPID='a'
- while true; do
- PS2PID=`ps -A | grep -m 1 'PlanetSide2.exe' | awk '{print $1}'`
- WINESVRPID=`ps -A | grep -m 1 'wineserver' | awk '{print $1}'`
- WINEDEVPID=`ps -A | grep -m 1 'winedevice.exe' | awk '{print $1}'`
- if [ ! $PS2PID ]; then
- echo 'PlanetSide 2 is not running'
- echo 'Processor is downgrading'
- elif [ $OLDPID != $PS2PID ]; then
- echo 'PlanetSide 2 is getting tuned'
- OLDPID=$PS2PID
- taskset -pc 0-3 $WINESVRPID #0-3 will use cores 0,1,2 and 3 ( quad )
- taskset -pc 0-3 $WINEDEVPID
- taskset -pc 0-3 $PS2PID
- echo 'Processor is optimizing'
- cpufreq & #starts the cpufreq-script
- exit #terminates the script when the job is done
- else
- echo 'PlanetSide 2 is already tuned.'
- fi
- sleep 15
- done
- #my launcher-script with cpu-freq loop ( cause i just want to use performance when i play )
- #!/bin/sh
- export WINEPREFIX=$HOME/.wine-planetside2
- export WINEDEBUG=-all
- export LD_PRELOAD="libpthread.so.0 libGL.so.1"
- export __GL_THREADED_OPTIMIZATIONS=1
- cd "$HOME/.wine-planetside2/drive_c/Program Files/Sony Online Entertainment/Installed Games/PlanetSide 2"
- ps2task &
- wmctrl -o 1920,1056 #optional ,used to go to workspace 2 ( Ubuntu 12.10 64bit, cause
- #devilspie will move the game to workspace 2 )
- wine Launchpad.exe > $HOME/ps2.log 2>&1 #save log
- PID='a'
- while true; do #check if ps2 is running, if not quit ps2task if it's not terminated
- #and switch back to workspace 2
- PS2=`ps -A | grep -m 1 'PlanetSide2.exe' | awk '{print $1}'`
- if [ ! $PS2 ]; then
- echo 'Processor is downgrading'
- wmctrl -o 0,0
- cpufreq_ondemand & #reset cpufreq
- sleep 10
- xgamma -gamma 1 # resets gamma to default
- PS2T=`ps -A | grep -m 1 'ps2task' | awk '{print $1}'`
- kill -9 $PS2T
- exit
- elif [ -n $PS2 ]; then
- #echo 'PlanetSide 2 is running' #optional
- sleep 10
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement