The time now is Sat 18 May 2013, 20:30
All times are UTC - 4 |
| Author |
Message |
disciple
Joined: 20 May 2006 Posts: 6178 Location: Auckland, New Zealand
|
Posted: Sat 15 Mar 2008, 23:28 Post subject:
Intelligent script to start Thunderbird |
|
Intelligent script to start Thunderbird - assuming you have thunderbird.
Save as /usr/local/thunderbird or something, and make sure it is lauching Thunderbird from the place it actually is (e.g. you might have it installed in /usr/local/lib/thunderbird)
It has a splash screen.
If you send mailto: links to it, it deals with them correctly, if you send any of the -something arguments to it, then it deals with them, if you don't send any arguments, it just opens thunderbird, otherwise it composes a message, with everything you sent to it as attachments.
Intended for use with a plain roxapp like the one I am about to update here, although you don't NEED the roxapp.
Uncomment the gxmessage line if you prefer it to xmessage (I don't but I'm strange).
I tried playing around, trying to get the splash screen to run whenever:
-thunderbird isn't already running
-a compose window is already open but nothing else
-we are opening a compose window, regardless of what is already open
as it always takes a while to open in these situations, but I don't think it is possible to get the logic complete.
| Code: | #!/bin/sh
# Splash Screen Duration
DISPLAY_TIME=4
# Show Splash if Thunderbird is not already running
if [ "`ps | grep --extended-regexp 'thunderbird\-bin'`" = "" ]
then
#if which gxmessage > /dev/null
#then
# gxmessage -timeout $DISPLAY_TIME -buttons "" -bg "#d0ffd0" -center -title "Thunderbird" "
# Thunderbird is starting" &
#else
xmessage -timeout $DISPLAY_TIME -buttons "" -bg "#d0ffd0" -center -fn "10x20" -title "Thunderbird" " Thunderbird is starting " &
#fi
fi
# Compose with attachments
if [ "$1" != "" ]; then
if [ "$1" != "-mail" ]; then
if [ "$1" != "-compose" ]; then
if [ "$1" != "-news" ]; then
if [ "$1" != "-addressbook" ]; then
if [ "$1" != "-options" ]; then
if [ "`echo "$1" |head -c 7`" != "mailto:" ]; then
for i in "$@"
do attachments="$attachments,file:///$i"
done
exec /usr/lib/thunderbird/thunderbird -compose "attachment='$attachments'"
fi
fi
fi
fi
fi
fi
fi
# Start Thunderbird
exec /usr/lib/thunderbird/thunderbird "$@" |
I suspect it needs to be fixed for links to news channels or whatever they are too, but I don't use any, so complain if you want that fixed.
|
|
Back to top
|
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|