golinux, try this. TheeMahn, hopefully you will test this out too as I tested on Ultimate 1.9 thru terminal as well as nautilus script.
TUM 1.04 Install Instructions:
1) apt-get install libusplash-dev libbogl-dev libc6-dev make gcc
2) Grab all of the tar files from the attachments in this post.
3) Untar the Make Usplash 1.04.tar.gz to /home/username/.gnome2/nautilus-scripts/
4) Create the directory /home/username/TUM and copy the TUM-DATA.tar.gz into that directory
TUM 1.04 Running Instructions:
Nautilus) Right click your image and select Scripts>Make Usplash 1.04
Terminal) Copy the Make Usplash 1.04 Bash Sheel Script to the directory that your image is in. Open a terminal in that directory. Type into the terminal:
- Code: Select all
/bin/bash "Make Usplash 1.04" /the/full/path/to/your/image.png
NOTE: No matter how you run TUM, ALWAYS select all resolutions! See changelog in bash script for reason.
TUM 1.04 Side Notes:
I have included a Konqueror Servicemenu file in this post for anyone interested. It is not required to run TUM. What it does, is it works similar to the Nautilus script. The catch is that it isn't completely finished(I.E. bug free). It seems to assume that you clicked yes to everything at this point since there is no Konqueror code in the actual Make Usplash 1.04 Script.
If you are logged in as KDE Session and GNOME is also installed(as in Ultimate 1.9) you may get some weird graphical errors if you tell it to test your usplash. I think this is due to it trying to use gksudo in KDE lol. No worries though if you are a KDE user, just grab the usplashmagick-test script from the TUM-DATA.tar.gz and run the script manually with standard sudo. I use KDE 99% of the time and can confirm doing it that way works wonders.
Tum 1.04 Testing Grounds:
I have tested this on:
Ultimate 1.9 under GNOME (Nautilus Script) - works great
Ultimate 1.9 under GNOME (From terminal) - works great
Kubuntu 8.04 (From Terminal) - works great
Kubuntu 8.04 (From Konqueror Servicemenu) - works but use at your own discretion
Tum 1.04 The Real Changelog:
Fixed updating code. It would try to downgrade 1.04 to 1.03, so I fixed that. Also the code is shorter now.
Stripped out lines of code that didn't do anything.
Did NOT fix resolution bug.
Optimized pallete code.
Used actual tabs instead of \t for Makefile as Nautilus didn't like it
Code structure: grouped Vars, Functions, and main code so it is easier to follow.
Added Usplash testing code, works thru termianl and Nautilus in GNOME.
Essentially, all the fixes that have been posted up until this post and or other code ideas that have been discussed.
How to run the usplashmagick-test script manually:
1) Install whatever Usplash you would like to test to /usr/lib/usplash/ . You can either do this with SUM or copy the file manually as root. If you just want to test your current Usplash, then skip this step.
2) Extract the TUM-DATA.tar.gz file into whatever directory you like.
3) Open a terminal and cd into the directory with the usplashmagick-test script.
4) Run this in the terminal:
- Code: Select all
sudo /bin/bash usplashmagick-test
5) You will see your Usplash pop up on the screen and report different amounts of progress. Eventually, it will report that it is sending a FAILED message. Don't flip out, this is normal, and part of the test script. After you see the FAILED message, you should notice that the progress bar starts pulsating. It will pulsate for a few seconds and you will be finally left at a black screen with white text most likely displaying (etc/rc.local). This is also normal. The text you are seeing is part of the bootup process that happened when you started your computer.
6) Press CTRL+ALT+F7 to return to your standard desktop.
7*) If you are running fiesty or earlier, the test script may appear to not work. I assure you that it is working as expected. You will have to open up the usplashmagick-test script and change the resolution to 800x600, resave and rerun the script. This is because in Gutsy and later, the ubuntu devs disabled framebuffer support by default.
Tum 1.04 Script Code: (DO NOT COPY/PASTE THIS INTO A FILE AND SAVE, AS THE FORUM HAS DE-TABIFIED THE MAKEFILE CODE AND WILL RESULT IN ERRORS IF YOU RUN IT. PLEASE DOWNLOAD THE SCRIPT INSTEAD. THE CODE IS POSTED HERE JUST FOR REFERENCE)
- Code: Select all
#!/bin/sh
# USplash Maker Via TheeMahn
# Copyright (c) 2007 Ubuntusoftware Team <http://ubuntusoftware.info>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ChangeLog:
# 1.04 -redteams rework
# trust me, a diff wouldn't do any good lol. The code flow is basically the same, but many portions
# of the code were rewritten to squash bugs or just replaced with optimized code.
# There are still bugs that I intentionally did not fix, such as resolution selection
# I.E. choosing only 640x480 Res does produce an .so library, although the library will crash if say etc/usplash.conf is set to 1024x768
# The user MUST select all resolutions or else a buggy usplash will result.
# Experimental Usplash testing removed for now...
# 1.03
# attempted to fix the update subroutine (downloads and checks properly until a new version is detected does not replace with the new version) - fixed
# 1.02 Started Changelog
# added pallete generated progress bars (throbbers) - thanks redteam_316
# added resolution selection
# makefile generation based on resolutions the user selects.
# 1.00 Initial release
# THE FUTURE
# ==========
# Progress bar positioning (only good with single resoultion selection
#VARIABLE DEFINITIONS
SCRIPT_VERSION=1.04
#Check if the script is being run through Nautilus or the command line so it works both ways and sets $FULLPATH correctly
if [ -n "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" ]; then
FULLPATH="$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" #Nautilus is being used
else
FULLPATH="$1" #Command line is being used
fi
FULLFILE=${FULLPATH%.*} # strip everything past the extension "." off
EXT=".so" # and replace it with .so
OUTFILE=${FULLFILE}${EXT}
IMAGE=`basename $FULLPATH`
#Use gksudo or kdesudo over sudo if possible
SUDO=`which gksudo` || SUDO=`which kdesudo` || SUDO=`which sudo` || exit 316
#FUNCTION DEFINITIONS
update() {
wget -O /tmp/MakeUsplash http://ubuntusoftware.info/scripts/MakeUsplash >/dev/null 2>&1
#Verify it did download it
RESULTS_SIZE=`stat -c %s /tmp/MakeUsplash`
if [ "$RESULTS_SIZE" == 0 ]; then
zenity --window-icon=/usr/share/ultimate/ubuntu_ico.png --info --text='It is suggested to re-run the script, the server may be under a heavy load. If the message persists, please verify you have an internet connection, the server is online & try again. Please refer to UbuntuSoftware Forum for further info.' --title="TUM - TheeMahns USplash Maker";
exit 1
fi
#Version check script
REMOTE_VERSION=`grep SCRIPT_VERSION /tmp/MakeUsplash |head -n1 |sed 's/.*=//'`
COMPARE_VERSION=`expr "$REMOTE_VERSION" \> "$SCRIPT_VERSION"`
if [ "$COMPARE_VERSION" -eq "1" ]; then
zenity --question --width=600 --height=100 --title "TUM - TheeMahns USplash Maker" --text "A newer version of TUM - TheeMahns USplash Maker script has been found\n\nDo you wish to install it?"
if [ $? == 1 ]; then
echo "Not upgrading script..."
else
cp /tmp/MakeUsplash ~/.gnome2/nautilus-scripts/
rm /tmp/MakeUsplash 2>/dev/null
echo "USplash Maker script has been updated to v $REMOTE_VERSION"
echo "Please re-run the script"
zenity --window-icon=/usr/share/ultimate/ubuntu_ico.png --info --text='Newer version of script detected '$REMOTE_VERSION'. It has been upgraded please re-run script.' --title="TUM - TheeMahns USplash Maker";
exit 0
fi
fi
}
Res1(){
/bin/bash usplashmagick-prepareimages 640x400 | zenity --width=600 --height=100 --progress --pulsate --auto-close --title "Processing @ 640 X 400..."
mv usplash/usplash_640x400.png WorkInProgress/usplash_640_400.png
mv usplash/usplash_throbber_fore.png WorkInProgress/throbber_fore_640_400.png
mv usplash/usplash_throbber_back.png WorkInProgress/throbber_back_640_400.png
# Palleting of progressbar - Thanks red_team316
}
Res2(){
/bin/bash usplashmagick-prepareimages 640x480 | zenity --width=600 --height=100 --progress --pulsate --auto-close --title "Processing @ 640 X 480..."
mv usplash/usplash_640x480.png WorkInProgress/usplash_640_480.png
mv usplash/usplash_throbber_fore.png WorkInProgress/throbber_fore_640_480.png
mv usplash/usplash_throbber_back.png WorkInProgress/throbber_back_640_480.png
}
Res3(){
/bin/bash usplashmagick-prepareimages 800x600 | zenity --width=600 --height=100 --progress --pulsate --auto-close --title "Processing @ 800 X 600..."
mv usplash/usplash_800x600.png WorkInProgress/usplash_800_600.png
mv usplash/usplash_throbber_fore.png WorkInProgress/throbber_fore_800_600.png
mv usplash/usplash_throbber_back.png WorkInProgress/throbber_back_800_600.png
}
Res4(){
/bin/bash usplashmagick-prepareimages 1024x768 | zenity --width=600 --height=100 --progress --pulsate --auto-close --title "Processing @ 1024 X 768..."
mv usplash/usplash_1024x768.png WorkInProgress/usplash_1024_768.png
mv usplash/usplash_throbber_fore.png WorkInProgress/throbber_fore_1024_768.png
mv usplash/usplash_throbber_back.png WorkInProgress/throbber_back_1024_768.png
}
Res5(){
/bin/bash usplashmagick-prepareimages 1280x1024 | zenity --width=600 --height=100 --progress --pulsate --auto-close --title "Processing @ 1280 X 1024..."
mv usplash/usplash_1280x1024.png WorkInProgress/usplash_1280_1024.png
mv usplash/usplash_throbber_fore.png WorkInProgress/throbber_fore_1280_1024.png
mv usplash/usplash_throbber_back.png WorkInProgress/throbber_back_1280_1024.png
}
##Check for zenity
if [ ! -e "/usr/bin/zenity" ]; then
"$SUDO" apt-get install -y --force-yes zenity
fi
update
#C Code Subroutines
GenerateMakefile(){
#Dynamically create the Makefile
echo 'CC=gcc
CFLAGS=-g -Wall -fPIC
LDFLAGS=
INCLUDES=
COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
LINK = $(CC) $(CFLAGS) $(LDFLAGS)
INSTALL = /usr/bin/install -c
INSTALL_DATA = $(INSTALL) -m 644
INSTALL_PROGRAM = $(INSTALL) -m 755
' > Makefile
printf 'usplash-theme-ubuntu.so: ' >> Makefile
#Throbber Back
#600X400 Selected?
if echo "$SIZE" | grep "600X400" ; then
printf 'throbber_back_640_400.png.c.o ' >> Makefile
fi
#600X480 Selected?
if echo "$SIZE" | grep "640X480" ; then
printf 'throbber_back_640_480.png.c.o ' >> Makefile
fi
#800X600 Selected?
if echo "$SIZE" | grep "800X600" ; then
printf 'throbber_back_800_600.png.c.o ' >> Makefile
fi
echo ' \' >> Makefile
printf ' ' >> Makefile
#1024X768 Selected?
if echo "$SIZE" | grep "1024X768" ; then
printf 'throbber_back_1024_768.png.c.o ' >> Makefile
fi
#1280X1024 Selected?
if echo "$SIZE" | grep "1280X1024" ; then
printf 'throbber_back_1280_1024.png.c.o ' >> Makefile
fi
echo ' \' >> Makefile
printf ' ' >> Makefile
#Throbber Fore
#600X400 Selected?
if echo "$SIZE" | grep "600X400" ; then
printf 'throbber_fore_640_400.png.c.o ' >> Makefile
fi
#600X480 Selected?
if echo "$SIZE" | grep "640X480" ; then
printf 'throbber_fore_640_480.png.c.o ' >> Makefile
fi
#800X600 Selected?
if echo "$SIZE" | grep "800X600" ; then
printf 'throbber_fore_800_600.png.c.o ' >> Makefile
fi
echo ' \' >> Makefile
printf ' ' >> Makefile
#1024X768 Selected?
if echo "$SIZE" | grep "1024X768" ; then
printf 'throbber_fore_1024_768.png.c.o ' >> Makefile
fi
#1024X768 Selected?
if echo "$SIZE" | grep "1280X1024" ; then
printf 'throbber_fore_1280_1024.png.c.o ' >> Makefile
fi
echo ' \' >> Makefile
printf ' ' >> Makefile
#MAIN
#600X400 Selected?
if echo "$SIZE" | grep "600X400" ; then
printf 'usplash_640_400.png.c.o ' >> Makefile
il=1
fi
#600X480 Selected?
if echo "$SIZE" | grep "640X480" ; then
printf 'usplash_640_480.png.c.o ' >> Makefile
il=1
fi
#800X600 Selected?
if echo "$SIZE" | grep "800X600" ; then
printf 'usplash_800_600.png.c.o ' >> Makefile
il=1
fi
#check if any
if echo "$il" | grep "1" ; then
echo ' \' >> Makefile
printf ' ' >> Makefile
fi
#1024X768 Selected?
if echo "$SIZE" | grep "1024X768" ; then
printf 'usplash_1024_768.png.c.o ' >> Makefile
fi
#1024X768 Selected?
if echo "$SIZE" | grep "1280X1024" ; then
printf 'usplash_1280_1024.png.c.o ' >> Makefile
fi
echo ' \' >> Makefile
printf ' ' >> Makefile
echo 'usplash-theme-ubuntu.c.o' >> Makefile
#ENDING
echo ' $(COMPILE) -shared -o $@ $^
%.png.c: %.png
pngtousplash $< > $@
%.bdf.c: %.bdf
bdftousplash $< > $@
%.c.o: %.c
$(COMPILE) -o $@ -c $<
install:
$(INSTALL) -d $(DESTDIR)/usr/lib/usplash
$(INSTALL_PROGRAM) usplash-theme-ubuntu.so $(DESTDIR)/usr/lib/usplash/usplash-theme-ubuntu.so
clean:
rm -f *.png.c *.bdf.c *.c.o' >> Makefile
}
# Dialog box to choose USplash's size(s)
# Begin interaction with end user
`zenity --window-icon=/usr/share/ultimate/ubuntu_ico.png --info --text="This will complie a USplash in current folder called $OUTFILE you can then load this file into Startup Manager (SUM). Enjoy, TheeMahn" --title="TUM - TheeMahns USplash Maker"`;
SIZE="";
SIZE="$(zenity --window-icon=/usr/share/ultimate/ubuntu_ico.png --width=500 --height=280 --title "TUM - TheeMahns USplash Maker" --text "Choose the Usplash resolutions to be compiled." --list --checklist --column "Select" --column "Resolution" true '600X400' true '640X480' true '800X600' true '1024X768' true '1280X1024')";
echo $SIZE
if [ "${SIZE}" == "" ]; then
zenity --error --text="Resolution not defined by user. Please choose a size to use. "
exit 0
fi
#Grab Throbbers, fonts & C code from local system...
if [ -e /home/$USER/TUM/TUM-DATA.tar.gz ]; then
cp /home/$USER/TUM/TUM-DATA.tar.gz $PWD
else #download it
wget http://ubuntusoftware.info/scripts/USplash/TUM-DATA.tar.gz
mkdir /home/$USER/TUM
cp TUM-DATA.tar.gz /home/$USER/TUM/TUM-DATA.tar.gz
fi
tar xfv TUM-DATA.tar.gz
convert -strip +dither -colors 256 -depth 8 "$IMAGE" usplash/usplash.png
if echo "$SIZE" | grep "600X400" ; then
Res1
fi
if echo "$SIZE" | grep "640X480" ; then
Res2
fi
if echo "$SIZE" | grep "800X600" ; then
Res3
fi
if echo "$SIZE" | grep "1024X768" ; then
Res4
fi
if echo "$SIZE" | grep "1280X1024" ; then
Res5
fi
cd WorkInProgress
GenerateMakefile
make | zenity --width=600 --height=100 --progress --pulsate --auto-close --title "Compiling USplash"
mv usplash-theme-ubuntu.so $OUTFILE
cd ..
#Clean up
rm -R usplash
rm -R usplashmagick-test
rm -R usplashmagick-prepareimages
rm -R TUM-DATA.tar.gz
rm -R WorkInProgress
exit 0
Tum 1.04 Experimental Script Code: (DO NOT COPY/PASTE THIS INTO A FILE AND SAVE, AS THE FORUM HAS DE-TABIFIED THE MAKEFILE CODE AND WILL RESULT IN ERRORS IF YOU RUN IT. PLEASE DOWNLOAD THE SCRIPT INSTEAD. THE CODE IS POSTED HERE JUST FOR REFERENCE)
- Code: Select all
#!/bin/sh
# USplash Maker Via TheeMahn
# Copyright (c) 2007 Ubuntusoftware Team <http://ubuntusoftware.info>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ChangeLog:
# 1.04 -redteams rework
# trust me, a diff wouldn't do any good lol. The code flow is basically the same, but many portions
# of the code were rewritten to squash bugs or just replaced with optimized code.
# There are still bugs that I intentionally did not fix, such as resolution selection
# I.E. choosing only 640x480 Res does produce an .so library, although the library will crash if say etc/usplash.conf is set to 1024x768
# The user MUST select all resolutions or else a buggy usplash will result.
# Experimental Usplash testing added. Works fine from terminal or Nautilus. Konqueror servicemenu seems to return true for all questions...needs work.
# 1.03
# attempted to fix the update subroutine (downloads and checks properly until a new version is detected does not replace with the new version) - fixed
# 1.02 Started Changelog
# added pallete generated progress bars (throbbers) - thanks redteam_316
# added resolution selection
# makefile generation based on resolutions the user selects.
# 1.00 Initial release
# THE FUTURE
# ==========
# Progress bar positioning (only good with single resoultion selection
#VARIABLE DEFINITIONS
SCRIPT_VERSION=1.04
#Check if the script is being run through Nautilus or the command line so it works both ways and sets $FULLPATH correctly
if [ -n "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" ]; then
FULLPATH="$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" #Nautilus is being used
else
FULLPATH="$1" #Command line is being used
fi
FULLFILE=${FULLPATH%.*} # strip everything past the extension "." off
EXT=".so" # and replace it with .so
OUTFILE=${FULLFILE}${EXT}
IMAGE=`basename $FULLPATH`
#Use gksudo or kdesudo over sudo if possible
SUDO=`which gksudo` || SUDO=`which kdesudo` || SUDO=`which sudo` || exit 316
#FUNCTION DEFINITIONS
update() {
wget -O /tmp/MakeUsplash http://ubuntusoftware.info/scripts/MakeUsplash >/dev/null 2>&1
#Verify it did download it
RESULTS_SIZE=`stat -c %s /tmp/MakeUsplash`
if [ "$RESULTS_SIZE" == 0 ]; then
zenity --window-icon=/usr/share/ultimate/ubuntu_ico.png --info --text='It is suggested to re-run the script, the server may be under a heavy load. If the message persists, please verify you have an internet connection, the server is online & try again. Please refer to UbuntuSoftware Forum for further info.' --title="TUM - TheeMahns USplash Maker";
exit 1
fi
#Version check script
REMOTE_VERSION=`grep SCRIPT_VERSION /tmp/MakeUsplash |head -n1 |sed 's/.*=//'`
COMPARE_VERSION=`expr "$REMOTE_VERSION" \> "$SCRIPT_VERSION"`
if [ "$COMPARE_VERSION" -eq "1" ]; then
zenity --question --width=600 --height=100 --title "TUM - TheeMahns USplash Maker" --text "A newer version of TUM - TheeMahns USplash Maker script has been found\n\nDo you wish to install it?"
if [ $? == 1 ]; then
echo "Not upgrading script..."
else
cp /tmp/MakeUsplash ~/.gnome2/nautilus-scripts/
rm /tmp/MakeUsplash 2>/dev/null
echo "USplash Maker script has been updated to v $REMOTE_VERSION"
echo "Please re-run the script"
zenity --window-icon=/usr/share/ultimate/ubuntu_ico.png --info --text='Newer version of script detected '$REMOTE_VERSION'. It has been upgraded please re-run script.' --title="TUM - TheeMahns USplash Maker";
exit 0
fi
fi
}
Res1(){
/bin/bash usplashmagick-prepareimages 640x400 | zenity --width=600 --height=100 --progress --pulsate --auto-close --title "Processing @ 640 X 400..."
mv usplash/usplash_640x400.png WorkInProgress/usplash_640_400.png
mv usplash/usplash_throbber_fore.png WorkInProgress/throbber_fore_640_400.png
mv usplash/usplash_throbber_back.png WorkInProgress/throbber_back_640_400.png
# Palleting of progressbar - Thanks red_team316
}
Res2(){
/bin/bash usplashmagick-prepareimages 640x480 | zenity --width=600 --height=100 --progress --pulsate --auto-close --title "Processing @ 640 X 480..."
mv usplash/usplash_640x480.png WorkInProgress/usplash_640_480.png
mv usplash/usplash_throbber_fore.png WorkInProgress/throbber_fore_640_480.png
mv usplash/usplash_throbber_back.png WorkInProgress/throbber_back_640_480.png
}
Res3(){
/bin/bash usplashmagick-prepareimages 800x600 | zenity --width=600 --height=100 --progress --pulsate --auto-close --title "Processing @ 800 X 600..."
mv usplash/usplash_800x600.png WorkInProgress/usplash_800_600.png
mv usplash/usplash_throbber_fore.png WorkInProgress/throbber_fore_800_600.png
mv usplash/usplash_throbber_back.png WorkInProgress/throbber_back_800_600.png
}
Res4(){
/bin/bash usplashmagick-prepareimages 1024x768 | zenity --width=600 --height=100 --progress --pulsate --auto-close --title "Processing @ 1024 X 768..."
mv usplash/usplash_1024x768.png WorkInProgress/usplash_1024_768.png
mv usplash/usplash_throbber_fore.png WorkInProgress/throbber_fore_1024_768.png
mv usplash/usplash_throbber_back.png WorkInProgress/throbber_back_1024_768.png
}
Res5(){
/bin/bash usplashmagick-prepareimages 1280x1024 | zenity --width=600 --height=100 --progress --pulsate --auto-close --title "Processing @ 1280 X 1024..."
mv usplash/usplash_1280x1024.png WorkInProgress/usplash_1280_1024.png
mv usplash/usplash_throbber_fore.png WorkInProgress/throbber_fore_1280_1024.png
mv usplash/usplash_throbber_back.png WorkInProgress/throbber_back_1280_1024.png
}
##Check for zenity
if [ ! -e "/usr/bin/zenity" ]; then
"$SUDO" apt-get install -y --force-yes zenity
fi
update
#C Code Subroutines
GenerateMakefile(){
#Dynamically create the Makefile
echo 'CC=gcc
CFLAGS=-g -Wall -fPIC
LDFLAGS=
INCLUDES=
COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
LINK = $(CC) $(CFLAGS) $(LDFLAGS)
INSTALL = /usr/bin/install -c
INSTALL_DATA = $(INSTALL) -m 644
INSTALL_PROGRAM = $(INSTALL) -m 755
' > Makefile
printf 'usplash-theme-ubuntu.so: ' >> Makefile
#Throbber Back
#600X400 Selected?
if echo "$SIZE" | grep "600X400" ; then
printf 'throbber_back_640_400.png.c.o ' >> Makefile
fi
#600X480 Selected?
if echo "$SIZE" | grep "640X480" ; then
printf 'throbber_back_640_480.png.c.o ' >> Makefile
fi
#800X600 Selected?
if echo "$SIZE" | grep "800X600" ; then
printf 'throbber_back_800_600.png.c.o ' >> Makefile
fi
echo ' \' >> Makefile
printf ' ' >> Makefile
#1024X768 Selected?
if echo "$SIZE" | grep "1024X768" ; then
printf 'throbber_back_1024_768.png.c.o ' >> Makefile
fi
#1280X1024 Selected?
if echo "$SIZE" | grep "1280X1024" ; then
printf 'throbber_back_1280_1024.png.c.o ' >> Makefile
fi
echo ' \' >> Makefile
printf ' ' >> Makefile
#Throbber Fore
#600X400 Selected?
if echo "$SIZE" | grep "600X400" ; then
printf 'throbber_fore_640_400.png.c.o ' >> Makefile
fi
#600X480 Selected?
if echo "$SIZE" | grep "640X480" ; then
printf 'throbber_fore_640_480.png.c.o ' >> Makefile
fi
#800X600 Selected?
if echo "$SIZE" | grep "800X600" ; then
printf 'throbber_fore_800_600.png.c.o ' >> Makefile
fi
echo ' \' >> Makefile
printf ' ' >> Makefile
#1024X768 Selected?
if echo "$SIZE" | grep "1024X768" ; then
printf 'throbber_fore_1024_768.png.c.o ' >> Makefile
fi
#1024X768 Selected?
if echo "$SIZE" | grep "1280X1024" ; then
printf 'throbber_fore_1280_1024.png.c.o ' >> Makefile
fi
echo ' \' >> Makefile
printf ' ' >> Makefile
#MAIN
#600X400 Selected?
if echo "$SIZE" | grep "600X400" ; then
printf 'usplash_640_400.png.c.o ' >> Makefile
il=1
fi
#600X480 Selected?
if echo "$SIZE" | grep "640X480" ; then
printf 'usplash_640_480.png.c.o ' >> Makefile
il=1
fi
#800X600 Selected?
if echo "$SIZE" | grep "800X600" ; then
printf 'usplash_800_600.png.c.o ' >> Makefile
il=1
fi
#check if any
if echo "$il" | grep "1" ; then
echo ' \' >> Makefile
printf ' ' >> Makefile
fi
#1024X768 Selected?
if echo "$SIZE" | grep "1024X768" ; then
printf 'usplash_1024_768.png.c.o ' >> Makefile
fi
#1024X768 Selected?
if echo "$SIZE" | grep "1280X1024" ; then
printf 'usplash_1280_1024.png.c.o ' >> Makefile
fi
echo ' \' >> Makefile
printf ' ' >> Makefile
echo 'usplash-theme-ubuntu.c.o' >> Makefile
#ENDING
echo ' $(COMPILE) -shared -o $@ $^
%.png.c: %.png
pngtousplash $< > $@
%.bdf.c: %.bdf
bdftousplash $< > $@
%.c.o: %.c
$(COMPILE) -o $@ -c $<
install:
$(INSTALL) -d $(DESTDIR)/usr/lib/usplash
$(INSTALL_PROGRAM) usplash-theme-ubuntu.so $(DESTDIR)/usr/lib/usplash/usplash-theme-ubuntu.so
clean:
rm -f *.png.c *.bdf.c *.c.o' >> Makefile
}
# Dialog box to choose USplash's size(s)
# Begin interaction with end user
`zenity --window-icon=/usr/share/ultimate/ubuntu_ico.png --info --text="This will complie a USplash in current folder called $OUTFILE you can then load this file into Startup Manager (SUM). Enjoy, TheeMahn" --title="TUM - TheeMahns USplash Maker"`;
SIZE="";
SIZE="$(zenity --window-icon=/usr/share/ultimate/ubuntu_ico.png --width=500 --height=280 --title "TUM - TheeMahns USplash Maker" --text "Choose the Usplash resolutions to be compiled." --list --checklist --column "Select" --column "Resolution" true '600X400' true '640X480' true '800X600' true '1024X768' true '1280X1024')";
echo $SIZE
if [ "${SIZE}" == "" ]; then
zenity --error --text="Resolution not defined by user. Please choose a size to use. "
exit 0
fi
#Grab Throbbers, fonts & C code from local system...
if [ -e /home/$USER/TUM/TUM-DATA.tar.gz ]; then
cp /home/$USER/TUM/TUM-DATA.tar.gz $PWD
else #download it
wget http://ubuntusoftware.info/scripts/USplash/TUM-DATA.tar.gz
mkdir /home/$USER/TUM
cp TUM-DATA.tar.gz /home/$USER/TUM/TUM-DATA.tar.gz
fi
tar xfv TUM-DATA.tar.gz
convert -strip +dither -colors 256 -depth 8 "$IMAGE" usplash/usplash.png
if echo "$SIZE" | grep "600X400" ; then
Res1
fi
if echo "$SIZE" | grep "640X480" ; then
Res2
fi
if echo "$SIZE" | grep "800X600" ; then
Res3
fi
if echo "$SIZE" | grep "1024X768" ; then
Res4
fi
if echo "$SIZE" | grep "1280X1024" ; then
Res5
fi
cd WorkInProgress
GenerateMakefile
make | zenity --width=600 --height=100 --progress --pulsate --auto-close --title "Compiling USplash"
mv usplash-theme-ubuntu.so $OUTFILE
cd ..
zenity --question --width=600 --height=100 --title "EXPERIMENTAL" --text "Would you like to install and test your newly created Usplash?"
if [ $? == 1 ]; then
echo "User chose not to install and test..."
else
`"$SUDO" cp $OUTFILE /usr/lib/usplash/usplash-theme-TUM.so`
`"$SUDO" update-alternatives --install /usr/lib/usplash/usplash-artwork.so usplash-artwork.so /usr/lib/usplash/usplash-theme-TUM.so 10`
`"$SUDO" update-alternatives --set usplash-artwork.so /usr/lib/usplash/usplash-theme-TUM.so`
`"$SUDO" update-initramfs -u | zenity --width=600 --height=100 --progress --pulsate --auto-close --title "Updating Initramfs..."`
zenity --info --text "Click OK to test the shutdown Usplash. Once the test has completed, press CTRL+ALT+F7 to return to this screen."
`"$SUDO" /bin/bash usplashmagick-test`
fi
#Clean up
rm -R usplash
rm -R usplashmagick-test
rm -R usplashmagick-prepareimages
rm -R TUM-DATA.tar.gz
rm -R WorkInProgress
exit 0