Dialog boxes that tell you things
This commit is contained in:
parent
f07de3f7ed
commit
245db473f0
41
launch.sh
41
launch.sh
|
@ -1,4 +1,5 @@
|
|||
#!/bin/bash
|
||||
export TITLE="Worlds Linux Wrapper"
|
||||
export WORLDSDIR="$(dirname "$(readlink -f "$0")")"
|
||||
export WINEPREFIX=$WORLDSDIR/prefix
|
||||
export WORLDSINSTALL="$WINEPREFIX/drive_c/Program Files/Worlds/"
|
||||
|
@ -6,9 +7,11 @@ export WINEARCH=win32
|
|||
cd "$WORLDSINSTALL"
|
||||
mkdir -p $WORLDSDIR/backups $WORLDSDIR/themes
|
||||
|
||||
export WINE=$(which wine)
|
||||
|
||||
main() {
|
||||
sel=$(zenity \
|
||||
--title="Worlds" \
|
||||
--title="$TITLE" \
|
||||
--window-icon="$WORLDSDIR/icon.png" \
|
||||
--width=360 \
|
||||
--height=280 \
|
||||
|
@ -24,10 +27,11 @@ main() {
|
|||
FALSE 'Backup Worlds files' \
|
||||
FALSE 'Restore from backup' \
|
||||
FALSE 'Set theme' \
|
||||
FALSE 'Clear Cache' 2>/dev/null )
|
||||
FALSE 'Clear Cache' \
|
||||
FALSE 'FORCE KILL' 2>/dev/null )
|
||||
case $sel in
|
||||
'Start Worlds')
|
||||
$(which wine) "$WORLDSINSTALL/run.exe" ;;
|
||||
$WINE "$WORLDSINSTALL/run.exe" ;;
|
||||
'Open Worlds folder')
|
||||
gio open "$WORLDSINSTALL"
|
||||
main ;;
|
||||
|
@ -40,12 +44,14 @@ main() {
|
|||
if [[ $? -eq 1 ]]; then
|
||||
main
|
||||
else
|
||||
echo "$WORLDSINSTALL/worlds.ini >> $bkup/worlds.ini"
|
||||
cp -r "$WORLDSINSTALL/worlds.ini" "$bkup/worlds.ini"
|
||||
echo "$WORLDSINSTALL/gamma.avatars >> $bkup/gamma.avatars"
|
||||
cp -r "$WORLDSINSTALL/gamma.avatars" "$bkup/gamma.avatars"
|
||||
echo "$WORLDSINSTALL/gamma.worldsmarks >> $bkup/gamma.worldsmarks"
|
||||
cp -r "$WORLDSINSTALL/gamma.worldsmarks" "$bkup/gamma.worldsmarks"
|
||||
if [[ $? -eq 1 ]]; then
|
||||
zenity --error --text="Could not successfully backup files." --width=240 --height=40 --title="$TITLE - Backup"
|
||||
else
|
||||
zenity --info --text="Personal world files successfully backed up." --width=240 --height=40 --title="$TITLE - Backup"
|
||||
fi
|
||||
main
|
||||
fi ;;
|
||||
'Restore from backup')
|
||||
|
@ -54,12 +60,14 @@ main() {
|
|||
if [[ $? -eq 1 ]]; then
|
||||
main
|
||||
else
|
||||
echo "$rbkup/worlds.ini >> $WORLDSINSTALL/worlds.ini"
|
||||
cp -r "$rbkup/worlds.ini" "$WORLDSINSTALL/worlds.ini"
|
||||
echo "$rbkup/gamma.avatars >> $WORLDSINSTALL/gamma.avatars"
|
||||
cp -r "$rbkup/gamma.avatars" "$WORLDSINSTALL/gamma.avatars"
|
||||
echo "$rbkup/gamma.worldsmarks >> $WORLDSINSTALL/gamma.worldsmarks"
|
||||
cp -r "$rbkup/gamma.worldsmarks" "$WORLDSINSTALL/gamma.worldsmarks"
|
||||
if [[ $? -eq 1 ]]; then
|
||||
zenity --error --text="Could not successfully restore files." --width=240 --height=40 --title="$TITLE - Restore"
|
||||
else
|
||||
zenity --info --text="Personal world files successfully restored." --width=240 --height=40 --title="$TITLE - Restore"
|
||||
fi
|
||||
main
|
||||
fi ;;
|
||||
'Set theme' )
|
||||
|
@ -73,10 +81,25 @@ main() {
|
|||
echo "$seltheme/$FILENAME >> $WORLDSINSTALL/$FILENAME"
|
||||
ln -sf "$seltheme/$FILENAME" "$WORLDSINSTALL/$FILENAME"
|
||||
done
|
||||
zenity --info --text="Successfully set theme to $(basename $seltheme)." --width=240 --height=40 --title="$TITLE - Theme"
|
||||
main
|
||||
fi ;;
|
||||
'Clear Cache')
|
||||
CDSIZE=$(du -sh "$WORLDSINSTALL/cachedir" | cut -f1)
|
||||
if [ -d "$WORLDSINSTALL/cachedir" ]; then
|
||||
rm -rf "$WORLDSINSTALL/cachedir"
|
||||
if [ ! -d "$WORLDSINSTALL/cachedir" ]; then
|
||||
zenity --info --text="$CDSIZE were successfully cleared." --width=240 --height=40 --title="$TITLE - Cachedir"
|
||||
else
|
||||
zenity --error --text="Something went wrong." --width=240 --height=40 --title="$TITLE - Cachedir"
|
||||
fi
|
||||
else
|
||||
zenity --error --text="Cachedir doesn't exist! Was it already cleared?" --width=240 --height=40 --title="$TITLE - Cachedir"
|
||||
fi
|
||||
main ;;
|
||||
'FORCE KILL' )
|
||||
killall WorldsPlayer.exe run.exe javaw.exe jrew.exe
|
||||
zenity --error --text="Killed all possible running processes of Worlds." --width=240 --height=40 --title="$TITLE - Kill"
|
||||
main ;;
|
||||
esac
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user