Skip to content

Instantly share code, notes, and snippets.

@klattimer
Created February 26, 2018 09:09
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/f5281358ee2b9b0481774334738badb8 to your computer and use it in GitHub Desktop.
Save klattimer/f5281358ee2b9b0481774334738badb8 to your computer and use it in GitHub Desktop.
Kill emulator
#!/bin/bash
# Kills whatever emulator was started with emurun
# Sets up audio volume and re-enables suspend.
DISPLAY=:0.0
if [ -f ~/emu.pid ]; then
PID=`cat ~/emu.pid`
if ps -p $PID > /dev/null; then
echo -n "Sending sigint to $PID..."
kill -SIGINT $PID
fi
sleep 2
if ps -p $PID > /dev/null; then
echo "FAILED"
echo -n "Sending sigkill to $PID..."
kill -9 $PID
sleep 1
if ps -p $PID > /dev/null; then
echo "FAILED"
echo "Sending terminate to $PID"
kill -15 $PID
else
echo
fi
else
echo
fi
rm -rf ~/emu.pid
fi
rm $HOME/.config/pulse/client.conf
/usr/bin/pulseaudio --start --log-target=syslog
~/bin/ksc enable
~/bin/lgtv setVolume 100
xrandr -s 1920x1080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment