| Author |
Message |
neurino

Joined: 15 Oct 2009 Posts: 360
|
Posted: Thu 19 Aug 2010, 19:23 Post subject:
tinygmc - tiny Gmail checker - v.0.0.3 Subject description: Another Gmail tray icon checker... just smaller |
|
This is a little bash script I wrote to learn some shell scripting.
It's main merit is it's small, around 5.5KB, and it could be less if I'd remove script comments, xml indentations etc...
I wanted to use only stock Puppy tools such as gtkdialog3, Glade to design interfaces and gtrayicon. I live tested it only on Wary 030, Quirky 1.2 and Puppeee RC 7 at the moment.
Usage is pretty staightforward, on first run:
- Fill settings dialog that comes up with your username and password (they will be saved unencrypted in ~/.tinygmc file)
- Set time interval (0 = checks only when you deactivate then reactivate tray icon)
- Set max number of messages to preview (to avoid huge dialogs)
- Set if you want it to run at Startup (will place a symlink in ~/Startup)
Periodically a gtkdialog appears with unread mail notifications, clicking on a preview opens the mail in default browser.
Red icon in tray = periodic check is activated
Grayed icon in tray = periodic check is deactivated
All the sed part that parses the xml feed belongs to potong (thanks for all the tips)
If anyone wants to give a look at the code and suggest improvements I'll be glad, please consider I'm a noob in bash/linux.
---------------------
For older versions of puppy like 3.01 the good vovchik has made a retro version of tinygmc 0.0.3, you can download it here
Changelog:
version 0.0.3 (bugfixes):creating correct symlink to gtrayicon added -k (insecure) option to connect to SSL site without certificates to avoid problems with some, maybe buggy, versions of curl
version 0.0.2:Waits for internet connection before checking (v.0.0.1 failed first check on Startup) Added "last message time" tooltip hovering on each notification dialog entry No more notifications if no new messages since last dialog: if you closed it you already read it! When you want to see what's unread simply deactivate / reactivate tray icon (a.k.a. double click). I find working this way is way less annoying than seeing the same headings every xx minutes.
 |
| Description |
tiny Gmail checker md5sum: e63763d9ccd7fdbd832528f45d54b32d
|

Download |
| Filename |
tinygmc-0.0.3.pet |
| Filesize |
5.72 KB |
| Downloaded |
340 Time(s) |
| Description |
settings dialog |
| Filesize |
15 KB |
| Viewed |
1346 Time(s) |

|
| Description |
notification popup |
| Filesize |
17.05 KB |
| Viewed |
1353 Time(s) |

|
| Description |
|
| Filesize |
2.25 KB |
| Viewed |
1350 Time(s) |

|
Last edited by neurino on Sat 04 Sep 2010, 09:17; edited 13 times in total
|
|
Back to top
|
|
 |
neurino

Joined: 15 Oct 2009 Posts: 360
|
Posted: Tue 31 Aug 2010, 10:36 Post subject:
|
|
version 0.0.2
|
|
Back to top
|
|
 |
seaside
Joined: 11 Apr 2007 Posts: 834
|
Posted: Thu 02 Sep 2010, 17:04 Post subject:
|
|
neurino,
Nicely done.
I tried it in Puppy431 and Lupu510 and unfortunately it doesn't run. I then thought I'd install Wary to check it out, but then the code looks generic enough to run on other puppies.
I'll take a look later and see how it could be modified.
Regards,
s
|
|
Back to top
|
|
 |
dejan555

Joined: 30 Nov 2008 Posts: 2407 Location: Montenegro
|
Posted: Thu 02 Sep 2010, 17:15 Post subject:
|
|
| Code: | # tinygmc
/usr/local/bin/tinygmc: line 10: /usr/local/tinygmc/traygmc: No such file or directory
|
I checked the file /usr/local/bin/tinygmc and it's a symlink to /usr/bin/gtrayicon which doesn't exist in package.
_________________

|
|
Back to top
|
|
 |
seaside
Joined: 11 Apr 2007 Posts: 834
|
Posted: Thu 02 Sep 2010, 22:48 Post subject:
|
|
| dejan555 wrote: | | Code: | # tinygmc
/usr/local/bin/tinygmc: line 10: /usr/local/tinygmc/traygmc: No such file or directory
|
I checked the file /usr/local/bin/tinygmc and it's a symlink to /usr/bin/gtrayicon which doesn't exist in package. |
Yep, that's it. "gtrayicon" isn't included in Pup431 and probably below.
Also, I got this curl error- | Code: | curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed |
I got it to work by specifying curl -k option (no certificate checking).
Attached below is the missing file.
Cheers,
s
| Description |
|

Download |
| Filename |
gtrayicon.tar.gz |
| Filesize |
4.72 KB |
| Downloaded |
302 Time(s) |
|
|
Back to top
|
|
 |
neurino

Joined: 15 Oct 2009 Posts: 360
|
Posted: Fri 03 Sep 2010, 03:32 Post subject:
|
|
Ok, the grtayicon symlink does not work since I found it's not in the same place in all Puppy derivatives...
I added a postinstall script that creates the symlink dynamically, you can run in terminal:
| Code: |
#remove not working symlink
rm /usr/local/tinygmc/traygmc
#create a working one
ln -s `which gtrayicon` /usr/local/tinygmc/traygmc
|
about the curl error I alreay noticed the error in Puppeee but thougt it's a curl bug, not of the script and maybe it should be fixed in curl.
Anyway if it's not a security problem for anyone I can add the -k option by default...
Il posted version 0.0.3 with these fixes.
|
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1230 Location: Ukraine
|
Posted: Fri 03 Sep 2010, 04:24 Post subject:
|
|
Dear neurino,
Could you kindly tar.gz the glade file for gtrayicon and post it here? I don't have it and want to try your app.
Many thanks in advance,
vovchik
|
|
Back to top
|
|
 |
neurino

Joined: 15 Oct 2009 Posts: 360
|
Posted: Fri 03 Sep 2010, 04:33 Post subject:
|
|
gtrayicon is not a glade file and should be in almost any Puppy derivative...
http://gtrayicon.sourceforge.net/
try to call it from commandline, if you really don't have it seaside posted it above, just rename it.
|
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1230 Location: Ukraine
|
Posted: Fri 03 Sep 2010, 06:13 Post subject:
|
|
Dear neurino,
The reason I mentioned the glade file is because I get this when running from a terminal:
| Quote: | root$ [/usr/local/tinygmc]-> tinygmc
(traygmc:26120): libglade-WARNING **: could not find glade file '/usr/share/gtrayicon/gtrayicon.glade'
gtrayicon: error loading glade file.: No such file or directory
|
With kind regards,
vovchik
PS. The source contains all the necessary files, include the glade file! So, thanks for the link.
|
|
Back to top
|
|
 |
neurino

Joined: 15 Oct 2009 Posts: 360
|
Posted: Fri 03 Sep 2010, 06:27 Post subject:
|
|
Dear vovchik,
here attached the contents of /usr/share/gtrayicon/
I don't know which other files, more than gtrayicon binary and these, are required.
Anyway I guess the better solution, if you don't have gtrayicon on your puplet, is to compile it from source.
Best regards
neurino
| Description |
md5sum: 79373260a87627b20c0532b5f017b445
|

Download |
| Filename |
gtrayicon.tar.gz |
| Filesize |
6.98 KB |
| Downloaded |
268 Time(s) |
|
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1230 Location: Ukraine
|
Posted: Fri 03 Sep 2010, 06:55 Post subject:
|
|
Dear neurino,
Thanks again. I recompiled it under Puppy 3.01 and had to change g_strcmp0 to strcmp in the source (a usual thing for old GTK 2.10). There was only one instance that required changing. As for the span stuff (text attributes) in your generated glade files, they don't show up properly in GTK 2.10 - I see the metalabels in the inbox list, e.g. <b></b>. Must be something with PANGO and I am investigating.
With kind regards,
vovchik
PS. If and when I figure out the span business, I will post a "retro" version with the modded gtrayicon and tweaked glade-generating code. It could be something as simple as single or double quotes, but I don't know yet.
|
|
Back to top
|
|
 |
neurino

Joined: 15 Oct 2009 Posts: 360
|
Posted: Fri 03 Sep 2010, 07:09 Post subject:
|
|
If you don't care about bigger texts in dialogs you can just strip <span>s (or maybe strip and cut down some of the atom texts to make dialogs smaller)
Bye
|
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1230 Location: Ukraine
|
Posted: Fri 03 Sep 2010, 09:08 Post subject:
Span stuff |
|
Dear neurino,
Thanks for all of the replies. I am interested in the span stuff and glade because I wrote this little editor for "span" stuff and, like you, obviously, like minimalist solutions.
http://www.murga-linux.com/puppy/viewtopic.php?mode=attach&id=30359 (page 5 I think)
What I would do is to get rid of curl dependencies. Luigi has written a little prog (with source) that does most of what wget and curl do, and does not have ugly dependencies. I posted that somewhere (search for Luigi and vovchik). Long ago, I also posted the source and binary for "email", which can query POP3 servers and knows SSL, if I remember correctly. It is also small and not too dependent on many extraneous libs.
Your use of glade generation, on the fly, is brilliant, so hats off. Nice solution, and efficient.
With kind regards,
vovchik
|
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1230 Location: Ukraine
|
Posted: Sat 04 Sep 2010, 05:55 Post subject:
|
|
Dear neurino,
I did as you suggested and removed the metatags from "check" (that's the easy way out). It works perfectly in 3.01. However, I still want to understand how to get the tags working, since they do work in regular gtkdialog and in all other apps that make use of glade. So, some head-scratching is in order on my part.
With thanks and kind regards,
vovchik
PS. What about scrambling the password in the rc file?
|
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1230 Location: Ukraine
|
Posted: Sat 04 Sep 2010, 06:41 Post subject:
Retro version for old Puppies |
|
Dear nuerino,
Here is a pet containing my modded gtrayicon and modded check so that your prog will work OK in older puppies - e.g. 3.01. I hope I didn't forget anything when making the pet.
With kind regards,
vovchik
| Description |
|

Download |
| Filename |
tinygmc-0.03-retro.pet |
| Filesize |
28.13 KB |
| Downloaded |
272 Time(s) |
|
|
Back to top
|
|
 |
|