Are you a spammer

Please note, that the first 3 posts you make, will need to be approved by a forum Administrator or Moderator before they are publicly viewable.
Each application to join this forum is checked at the Stop Forum Spam website. If the email or IP address appears there when checked, you will not be allowed to join this forum.
If you get past this check and post spam on this forum, your posts will be immediately deleted and your account inactivated.You will then be banned and your IP will be submitted to your ISP, notifying them of your spamming. So your spam links will only be seen for an hour or two at most. In other words, don't waste your time and ours.

This forum is for the use and enjoyment of the members and visitors looking to learn about and share information regarding the topics listed. It is not a free-for-all advertising venue. Your time would be better spent pursuing legitimate avenues of promoting your websites.

Usplash Maker 1.04

Source code I have written openly published for your viewing pleasure.


Usplash Maker 1.04

Postby red_team316 » Sat Sep 13, 2008 11:31 pm

Okay, here's the fix. It turned into a rewrite instead of just a minor fix as I had forgot how many bugs there were. So pretty much I called it 1.04 since it really isn't a hack.

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 :P
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 &amp; 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 &amp; 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

Attachments
Make Usplash 1.04.desktop.tar.gz
Konqueror Service Menu - Use at your own discretion
(420 Bytes) Downloaded 956 times
TUM-DATA.tar.gz
TUM-DATA.tar.gz This is the same as the old USplash.tar.gz but replaces it.
(10.83 KiB) Downloaded 2244 times
Make Usplash 1.04.tar.gz
Standard Make Usplash 1.04 Script
(3.53 KiB) Downloaded 2295 times
Make Usplash 1.04 Experimental.tar.gz
Make Usplash 1.04 Script w/Experimental testing dialog
(3.81 KiB) Downloaded 969 times
Last edited by red_team316 on Thu Sep 18, 2008 9:49 pm, edited 2 times in total.
Core i7 920(working on a decent OC), x58 ASUS P6T Deluxe V2, 6GB DDR3 1600, EVGA 8800GTS512, Silencer 750W PSU, CoolerMaster V8, Red Antec900
Image
User avatar
red_team316
U.E. College Professor
U.E. College Professor
 
Posts: 288
Joined: Mon Jan 07, 2008 12:37 am
Age: 39
Operating System: Ultimate Edition 3.2 64 BIT



Re: Usplash Maker

Postby DaddyX3 » Sun Sep 14, 2008 12:14 am

I'm really glad that you have hopped on board here red_team. I for one appreciate the help that you given TheeMahn - so he can continue his work with making distro's. I'm sure your well aware the impact that his distro's have had on the public. This is really where he needs to be IMO. The Linux community needs to grow and to gather as many brains as possible to help with the world wide movement to free people from their dependence on M$ winblows ;)
Lets all say it together now ..... "We will break our dependence on M$ products, We will break our dependence on M$ products" LOL!
Honestly, thanks for the good work and support you've given ;)
Intel Core 2 Quad Q9300 2.5GHz 45nm/Gigabyte EP35C-DS3R M.B. w/ddr3 1333
G.Skill 2X1GB DDR3 1333MHz/Gigabyte 8800GT PCIe 2.0 512MB GDDR3 OC'd to 700Mhz/ WD160 gig, 2- WD250 gig in RAID-0 (500GB), WD640 gig e-SATA external

AMD 64 X2 3800+/ASUS A8N32-SLI Deluxe/G.Skill 2X1GB Matched Pair ddr400
/EVGA 6800GS Nvidia Graphics 256MB/WD160gig drive

HTPC Box:AMD 64 X2 4400+/ BIOSTAR TF7050PV HDMI MicroATX/G.Skill 2X1GB /Matched Pair DDR800/Integrated video and audio/WD160gig drive
User avatar
DaddyX3
U.E. God
U.E. God
 
Posts: 2407
Joined: Wed Oct 17, 2007 9:22 am
Location: Central Coast - California
Age: 49
Operating System: Ultimate Edition 2.3 32 BIT



Re: Usplash Maker

Postby golinux » Sun Sep 14, 2008 1:25 am

red_team316 wrote:Okay, here's the fix. It turned into a rewrite instead of just a minor fix as I had forgot how many bugs there were. So pretty much I called it 1.04 since it really isn't a hack.

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.

Amazing that you pumped this out so quickly. KUDOS! <BREW> Here's my report . . . sorry to tell you there were some problems.

I tested in Virtual Box on Ubuntu 7.10 and 8.04. All seems to work smoothly until the experimental Usplash testing. There isn't a NO option - either CANCEL or YES to proceed. So no choice but to click yes. Usplash displayed at this time is not the one that was just created and the splash text says FAILED, then hangs when trying to continue at "running local boot scripts (/etc/rc.local)". Ctrl + Alt + F7 does nothing and I had to abort every time I tried it from either right click or terminal.

Could you please post a version without the test (or provide a NO option) so I can at least see if an .so file appears in the directory? I'd muck around in the script myself but that would probably make things much worse. ;)

To late to do any more tonight . . .

PS. Not sure that there would be conflicts but you might want to add instructions to remove previous versions before installing the new one. I used:

Code: Select all
cd ~/.gnome2/nautilus-scripts/
    rm MakeUsplash
User avatar
golinux
U.E. Knowledgable
U.E. Knowledgable
 
Posts: 28
Joined: Sun May 25, 2008 9:12 pm
Location: Linuxland
Operating System: Ultimate Edition KDE4



Re: Usplash Maker

Postby red_team316 » Sun Sep 14, 2008 4:34 pm

Daddy: LOL, somehow I'm stuck with Windows in the lightscribe department :P

golinux:
Try hitting Cancel, it should be the same as a NO option. Clicking the X in the corner of the window also should result in a NO option. I wouldn't have added it if there wasn't a way to cancel/NO. If there is a way to get zenity to label that button as NO, then maybe he can enlighten me, as he is much more familiar with zenity than I am.

I'm pretty sure that there is no way to CTRL+ALT+F7 inside Virtualbox. I've tried it myself with the test script in question. I'm guessing you are using Virtualbox so you don't hose your install. The .so file is created before it asks you to test it, and is not removed by the script. So regardless of if you test it or not, the .so file should be there.

There is nothing to worry about seeing the splash say FAILED and it's not hanging. Thats part of the test script. And yes it will go to a black screen with (/etc/rc.local) etc... This is all normal. It appears that the only part that didn't work was the part that was supposed to copy the new .so and install it. If you were testing outside of VirtualBox, you would be able to CTRL+ALT+F7 to go back to your normal Desktop. Just to show you, try hitting CTRL+ALT+F6 right now and it will bring you to tty6. Press CTRL+ALT+F7 again to come back to this screen :) Now try CTRL+ALT+F8, that will bring you to the black (/etc/rc.local) screen, which is tty8, the display that the usplash is run on.


At your request, I stripped out the usplash testing code:

Make Usplash 1.04 w/o Usplash Testing Code
Code: Select all
Sorry, I removed the code, as apparently the forum code block de-tabified the tabs in the makefile generation. Thus why originally my idea was to use \t but Nautilus didnt like it. I cant win no matter which way I go lol. Just download the tar.gz again. I can assure you it's fixed in there now :)

EDIT: I removed the attachment from here and put it in the first post.
Last edited by red_team316 on Thu Sep 18, 2008 9:23 pm, edited 4 times in total.
Core i7 920(working on a decent OC), x58 ASUS P6T Deluxe V2, 6GB DDR3 1600, EVGA 8800GTS512, Silencer 750W PSU, CoolerMaster V8, Red Antec900
Image
User avatar
red_team316
U.E. College Professor
U.E. College Professor
 
Posts: 288
Joined: Mon Jan 07, 2008 12:37 am
Age: 39
Operating System: Ultimate Edition 3.2 64 BIT



Re: Usplash Maker

Postby golinux » Sun Sep 14, 2008 6:01 pm

red_team316 wrote:golinux:
Try hitting Cancel, it should be the same as a NO option. Clicking the X in the corner of the window also should result in a NO option. I wouldn't have added it if there wasn't a way to cancel/NO.

Before trying the stripped version I tried X in the corner. It didn't stop the process. I don't have a Cancel key on my kb. Maybe Esc or Delete?

I'm pretty sure that there is no way to CTRL+ALT+F7 inside Virtualbox. I've tried it myself with the test script in question. I'm guessing you are using Virtualbox so you don't hose your install. The .so file is created before it asks you to test it, and is not removed by the script. So regardless of if you test it or not, the .so file should be there.

Yes, CTRL+ALT+F7 seems to control the primary OS not VirtualBox. I'm going to give this a go on the old Dell in a bit. Yes, I don't want to mess with TUM that is functional on my working box. I have yet to see an .so file generated by either of the revised scripts.

There is nothing to worry about seeing the splash say FAILED and it's not hanging. Thats part of the test script. And yes it will go to a black screen with (/etc/rc.local) etc... This is all normal.

That's good to know.

It appears that the only part that didn't work was the part that was supposed to copy the new .so and install it.

When I ran the NoExperimental version from terminal in a folder, these were the last two lines:

Code: Select all
Makefile:20: *** missing separator.   Stop.
mv: cannot stat 'usplash-theme-ubuntu.so': No such file or directory

Everything else looked OK. Is there a typo in there somewhere?

If you were testing outside of VirtualBox, you would be able to CTRL+ALT+F7 to go back to your normal Desktop. Just to show you, try hitting CTRL+ALT+F6 right now and it will bring you to tty6. Press CTRL+ALT+F7 again to come back to this screen :) Now try CTRL+ALT+F8, that will bring you to the black (/etc/rc.local) screen, which is tty8, the display that the usplash is run on.

I am very familiar with CTRL+ALT+F1 and CTRL+ALT+F7 as a way to reset my misbehaving display after hibernation. ;)

At your request, I stripped out the usplash testing code:

I really, REALLY appreciate the work you're putting into this. It's very close, I think . . .
User avatar
golinux
U.E. Knowledgable
U.E. Knowledgable
 
Posts: 28
Joined: Sun May 25, 2008 9:12 pm
Location: Linuxland
Operating System: Ultimate Edition KDE4



Re: Usplash Maker

Postby red_team316 » Sun Sep 14, 2008 6:24 pm

My bad, I copied the text from the forum post, slapped it into a file deleted the lines and tarred it up. Apparently it de-tabified the makefile tabs :(
Anyways, I reuploaded the file to my previous post. Discard the old script and download it again.


EDIT: When I said try Cancel, I meant hit the cancel button instead of the OK button. Are you not seeing the button or does it not act as NO either? Somethings fishy with zenity lol, I still think I prefer GTK.
Core i7 920(working on a decent OC), x58 ASUS P6T Deluxe V2, 6GB DDR3 1600, EVGA 8800GTS512, Silencer 750W PSU, CoolerMaster V8, Red Antec900
Image
User avatar
red_team316
U.E. College Professor
U.E. College Professor
 
Posts: 288
Joined: Mon Jan 07, 2008 12:37 am
Age: 39
Operating System: Ultimate Edition 3.2 64 BIT



Re: Usplash Maker

Postby golinux » Sun Sep 14, 2008 7:47 pm

red_team316 wrote:My bad, I copied the text from the forum post, slapped it into a file deleted the lines and tarred it up. Apparently it de-tabified the makefile tabs :(

Anyways, I reuploaded the file to my previous post. Discard the old script and download it again.

Mystery solved. I'll give it a try in a minute. Many thanks.

FWIW, I looked at the script and interestingly, the section you deleted was exactly what I would removed. But better safe than sorry . . .

EDIT: When I said try Cancel, I meant hit the cancel button instead of the OK button. Are you not seeing the button or does it not act as NO either? Somethings fishy with zenity lol, I still think I prefer GTK.

Ah, of course. I tried the cancel option the very first time I ran the script and it kept right on going, going, going to a deadend . . .
User avatar
golinux
U.E. Knowledgable
U.E. Knowledgable
 
Posts: 28
Joined: Sun May 25, 2008 9:12 pm
Location: Linuxland
Operating System: Ultimate Edition KDE4



Re: Usplash Maker

Postby golinux » Sun Sep 14, 2008 8:09 pm

Just ran the corrected script from terminal on Ubuntu Hardy in Virtual Box. Different errors this time. Looks like some dependencies are missing?

Code: Select all
600X400|640X480|800X600|1024X768|1280X1024
usplash/
usplash/throbber_fore.png
usplash/throbber_back.png
WorkInProgress/
WorkInProgress/usplash-theme-ubuntu.c
WorkInProgress/16X16.fnt
WorkInProgress/helvB10.bdf
usplashmagick-test
usplashmagick-prepareimages
600X400|640X480|800X600|1024X768|1280X1024
600X400|640X480|800X600|1024X768|1280X1024
600X400|640X480|800X600|1024X768|1280X1024
600X400|640X480|800X600|1024X768|1280X1024
600X400|640X480|800X600|1024X768|1280X1024
600X400|640X480|800X600|1024X768|1280X1024
600X400|640X480|800X600|1024X768|1280X1024
600X400|640X480|800X600|1024X768|1280X1024
600X400|640X480|800X600|1024X768|1280X1024
600X400|640X480|800X600|1024X768|1280X1024
600X400|640X480|800X600|1024X768|1280X1024
600X400|640X480|800X600|1024X768|1280X1024
600X400|640X480|800X600|1024X768|1280X1024
600X400|640X480|800X600|1024X768|1280X1024
600X400|640X480|800X600|1024X768|1280X1024
600X400|640X480|800X600|1024X768|1280X1024
600X400|640X480|800X600|1024X768|1280X1024
600X400|640X480|800X600|1024X768|1280X1024
1
600X400|640X480|800X600|1024X768|1280X1024
600X400|640X480|800X600|1024X768|1280X1024
make: Circular throbber_back_640_400.png <- throbber_back_640_400.png.c dependency dropped.
In file included from throbber_back_640_400.png.c:2:
/usr/include/usplash-theme.h:24:23: error: sys/types.h: No such file or directory
/usr/include/usplash-theme.h:25:20: error: stdlib.h: No such file or directory
In file included from throbber_back_640_400.png.c:2:
/usr/include/usplash-theme.h:77: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/usplash-theme.h:79: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/usplash-theme.h:93: error: expected specifier-qualifier-list before ‘u_int32_t’
make: *** [throbber_back_640_400.png.c.o] Error 1
mv: cannot stat `usplash-theme-ubuntu.so': No such file or directory
User avatar
golinux
U.E. Knowledgable
U.E. Knowledgable
 
Posts: 28
Joined: Sun May 25, 2008 9:12 pm
Location: Linuxland
Operating System: Ultimate Edition KDE4



Re: Usplash Maker

Postby red_team316 » Sun Sep 14, 2008 8:29 pm

What is up with you and Virtualbox lol.

Yes, there are dependancies missing. Not because it is saying dependancy dropped though(that means it's working as expected.) The problem is that you dont have libusplash-dev installed.

Do:
Code: Select all
sudo apt-get install libusplash-dev build-essentials imagemagick



...hmm I suppose that would be something to add to the code, but since gksudo vs kdesudo vs sudo is different depending on how the script is run, maybe just check for the packages, and if they are not installed, then inform the user to install them and rerun the script.
Core i7 920(working on a decent OC), x58 ASUS P6T Deluxe V2, 6GB DDR3 1600, EVGA 8800GTS512, Silencer 750W PSU, CoolerMaster V8, Red Antec900
Image
User avatar
red_team316
U.E. College Professor
U.E. College Professor
 
Posts: 288
Joined: Mon Jan 07, 2008 12:37 am
Age: 39
Operating System: Ultimate Edition 3.2 64 BIT



Re: Usplash Maker

Postby golinux » Sun Sep 14, 2008 9:43 pm

red_team316 wrote:What is up with you and Virtualbox lol.

Yes, there are dependancies missing. Not because it is saying dependancy dropped though(that means it's working as expected.) The problem is that you dont have libusplash-dev installed.

Oh but I do!

libusplash-dev 0.5.19
imagemagick Version: 7:6.3.7.9.dsfg1-2ubuntu1

Code: Select all
sudo apt-get install libusplash-dev build-essentials imagemagick
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libusplash-dev is already the newest version.
E: Couldn't find package build-essentials


What am I missing here?
Last edited by golinux on Sun Sep 14, 2008 10:06 pm, edited 1 time in total.
User avatar
golinux
U.E. Knowledgable
U.E. Knowledgable
 
Posts: 28
Joined: Sun May 25, 2008 9:12 pm
Location: Linuxland
Operating System: Ultimate Edition KDE4

Next

Return to Programming

Who is online

Users browsing this forum: No registered users and 14 guests