Skip to content

Instantly share code, notes, and snippets.

@klattimer
Last active February 26, 2018 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save klattimer/e9fc28c72cdaa419129bc26a2e9f7185 to your computer and use it in GitHub Desktop.
Save klattimer/e9fc28c72cdaa419129bc26a2e9f7185 to your computer and use it in GitHub Desktop.
Run emulator with easy hacks
#!/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