I am putting this update at the top of my original post because it
makes installation even easier than before - much easier. The .pet
does everything in the instructions for you. My instructions serve
only historical purposes now.
First - test the current behavior. Find an md5 or md5.txt file and click
on it. It opens as text - right, not too useful. Close the text window.
Five mouse clicks to install the new behavior:
1. Click on the link below
2. Select "Open it with the default application (petget)"
3. Click "OK"
4. Click "Install Package"
5. Click "OKAY"
http://puppylinux.ca/tpp/bugs/geow_md5_checker-1.5.pet
Now, the next time you reboot or restart the X server, you will have
the new behavior - click on an md5 or md5.txt file and it will check the iso.
If you have followed the preceding instructions and installed the .pet you are done.
-----------------------------------------------------------------------------------------------------
My original post follows. It has been updated each time changes
have been made. You do not need to read it.
However, feel free to read it. I suggest the following purposes:
A) To see how this behavior is implemented
B) As an example of scripting ( good ? / bad ? )
C) To see what a stubborn amateur scripter can accomplish ( it took
me days to get this running ).
Enjoy!
I have weak typing skills so I am very dependent
on Puppy's GUI.
I download and test every new version of Puppy
that comes out. I always download the MD5 file
and check that the iso download was successful.
I really do not like typing the long filenames like:
puppy-4.1alpha6-uniproc-ide-conservative-seamonkey.iso.md5.txt
The following set of fairly minor additions allow
me to do the md5 check with a single mouse click.
First, one or more of the following lines needs to
be added to the end of
/usr/share/mime/globs
Code: Select all
application/gwbckmd5:*.md5
application/gwbckmd5:*.md5.txt
application/gwbckmd5:*.md5sum
these file types without affecting text files in general.
Second, these two small scripts need to be in the PATH
Code: Select all
#!/bin/sh
# gwbckmd5 GWB 15 Sep 2008
rxvt -bg black -fg green -T "GWB Checking MD5 Sum" -g 100x10 -e gwbckmd5-2 "$1"
# end gwbckmd5
Code: Select all
# gwbckmd5-2 GWB 15 Sep 2008
# echo $1
# echo
dir1=`dirname "$1"`
# echo $dir1
cd "$dir1"
# echo
# echo working dir is now `pwd`
# echo
echo
echo md5sum -c "$1"
echo
md5sum -c "$1"
if [ $? = 0 ]; then
echo
echo -e '\033[1;32mSUCCESS\033[0m'
else
echo
echo -e '\033[1;31mERROR\033[0m'
fi
echo
echo -n Press "<Enter>" to close this window.
read ch1
# end gwbckmd5-2
Third and final, find an md5 or md5.txt file,
right click on it, Set run action, and in the
box labeled "Enter a shell command:"
add gwbckmd5 to the front
the result should be: gwbckmd5 "$@"
Select the second radio button at the top:
Only for the type `application/
gwbckmd5'(application/gwbckmd5)
Click: Use Command
That's it, now you should be able to click
on md5 or md5.txt files and have the iso checked.
Hope this is useful,
GeoW