Last active
February 26, 2018 09:10
-
-
Save klattimer/e9fc28c72cdaa419129bc26a2e9f7185 to your computer and use it in GitHub Desktop.
Run emulator with easy hacks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Execute an emulator which is linked to this script, e.g. ln -s ~/bin/emurun ~/bin/dolphin-emu-nogui | |
# Then execute ~/bin/dolphin-emu-nogui to wrap it in this, disables suspend timers sets the TV volume and moves the cursor | |
# out of the way. Importantly it kills pulseaudio which does horrible things to audio. | |
# | |
export DISPLAY=:0.0 | |
export PATH=/usr/games:$PATH | |
EX=`basename $0` | |
echo autospawn = no > $HOME/.config/pulse/client.conf | |
/bin/kill -9 `/bin/pidof pulseaudio` | |
/usr/bin/killall pulseaudio | |
pulseaudio --kill | |
/bin/sleep 1 | |
# Custom stuff to prepare for specific emulators | |
# if [ $EX == "zsnes" ]; then | |
# fi | |
if [ $EX == "dolphin-emu-nogui" ]; then | |
xrandr -s 640x480 | |
fi | |
~/bin/ksc disable | |
~/bin/lgtv setVolume 10 | |
echo "Executing $EX $*" | |
EX=`which $EX` | |
$EX "$*" & | |
echo $! | |
/bin/echo $! > ~/emu.pid | |
/bin/echo $EX > ~/emu.run | |
/usr/bin/xdotool mousemove 1920 1080 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment