Created
February 26, 2018 09:09
-
-
Save klattimer/f5281358ee2b9b0481774334738badb8 to your computer and use it in GitHub Desktop.
Kill emulator
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 | |
# 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