Created
April 20, 2012 16:54
-
-
Save that4chanwolf/2430266 to your computer and use it in GitHub Desktop.
Shimeji script
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 | |
# A bash script meant to be used along with linux-shimeji | |
# Requires linux-shimeji (obviously) and either xcompmgr or compton (for compositing) | |
shimejijar="/opt/linux-shimeji/Shimeji.jar" | |
if [ -n `which java` ]; then | |
echo 'ERROR: No Java install found! Please install a JRE.' | |
exit | |
fi | |
if [ -n `which compton` ]; then | |
compcommand=`which compton` | |
elif [ -n `which xcompmgr` ]; then | |
compcommand=`which xcompmgr` | |
else | |
echo 'ERROR: No compositor found! Exiting.' | |
exit | |
fi | |
case $1 in | |
start) | |
bash -c " | |
${compcommand} & | |
`which java` -jar ${shimejijar} & | |
exit & | |
" > /dev/null | |
echo 'Starting Shimeji...' | |
;; | |
stop) | |
bash -c " | |
kill $(ps aux | grep 'Shimeji.jar' | awk '{ print $2 }' | grep `pidof java`) & | |
killall ${compcommand} & | |
" > /dev/null | |
echo 'Shutting down Shimeji...' | |
;; | |
restart) | |
bash -c " | |
kill $(ps aux | grep 'Shimeji.jar' | awk '{ print $2 }' | grep `pidof java`) && | |
`which java` -jar ${shimejijar} & | |
exit & | |
" > /dev/null | |
echo 'Restarting Shimeji...' | |
;; | |
*) | |
echo 'Usage: shimeji.sh (start|stop|restart)' | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment