Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 20 Dec 2014, 01:22
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
Intelligent script to start Thunderbird
Moderators: deshlab, Flash, GuestToo, Ian, JohnMurga, Lobster
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [1 Post]  
Author Message
disciple

Joined: 20 May 2006
Posts: 6464
Location: Auckland, New Zealand

PostPosted: 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
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [1 Post]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
Jump to:  

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
[ Time: 0.0510s ][ Queries: 12 (0.0090s) ][ GZIP on ]