Home Forums Wiki Doc Install Extras Screenshots Source Code Projects Blog Users Groups Register
Glx-Dock / Cairo-Dock List of forums Applets | Applets GoGmail: Simple mail applet.
The latest stable release is the *3.4.0* : How to install it here.
Note: We just switched from BZR to Git on Github! (only to host the code and your future pull requests)
Applets | Applets

Subjects Author Language Messages Last message
[Locked] GoGmail: Simple mail applet.
SQP English 16 fabounet [Read]
29 November 2012 à 16:52

SQP, Monday 05 November 2012 à 15:26


Subscription date : 03 July 2010
Messages : 1081
This is a rework of the Gmail applet in Golang. Currently only work with Gmail accounts (ATOM flux parsing), but others could be added. It's in "ready to evolve" state and waiting for tests and ideas.
The only thing it's yet missing from the original is the left click menu with mails list. Instead the simple mail dialog is provided atm.

The main idea around the applets I want to build, is to let the user decide what he want them to do, and always provide action selectors and if possible application monitoring, to be able to merge our needs in the minimum required number of icons.

Actions you can bind on clicks:
  • none
  • Open mail client
  • Check now
  • Show mail dialog

Mail count renderers: (emblems are the same SVG editor as python version)
  • none
  • small emblem
  • large emblem
  • quickinfo

Dialog type:
  • Internal dialog: using Cairo-Dock dialogs
  • Desktop notifications: using libnotify.


Evolutions:
As you saw on the other thread, I have GTK3 bindings working, and could make an enhanced version with a small mail listing GUI. The only thing needed is to decide what to do with it.. (won't be something big, no need to rewrite a mail client)

Download v0.0.2-3
Unpack the archive in $HOME/.config/cairo-dock/third-party


ARM version: could be provided if anyone need, feel free to ask. I'd just like to know if it is usefull, and will work.

Sources are available here, but would need a few tweaks in the DBus API to work.

This DBus API has just been taken in charge by a new maintainer, and should be in better state really soon (15 commits yesterday)
Let me know if you wanna try it from sources faster, changes are minor on the branch I currently use: just pull a specific branch and change 1 ou 2 lines.

http://uppix.net/5/1/1/0c137f06b60170a05c0e5cfc657fd.png

matttbe, Tuesday 06 November 2012 à 15:10


Subscription date : 24 January 2009
Messages : 12573
It's great to see all these options, thank you

Go produces a big file but I guess it's easier to avoid dependences problems.

About the evolution, I think we just need an applet to be quickly notified when a new mail is received. It can be interesting to add options to have a preview and to quickly mark as read a new mail (e.g. like the old CheckGmail) but it's maybe a bit useless.

I'm using Ubuntu Raring 13.04 and I have a crash:
panic: runtime error: index out of range

goroutine 6 [running]:
main.(*AppletGmail).sendAlert(0xf8400010a0, 0x202a202000000005)
    /home/sqp/Bureau/go/src/github.com/sqp/godock/applets/GoGmail/src/GoGmail.go:327 +0x113
main.(*AppletGmail).updateDisplay(0xf8400010a0, 0x5, 0x0, 0x0, 0xf8400791a2, ...)
    /home/sqp/Bureau/go/src/github.com/sqp/godock/applets/GoGmail/src/GoGmail.go:296 +0x570
main._func_002(0xf84008b210, 0x4037c4, 0xf800000005, 0x0, 0x0, ...)
    /home/sqp/Bureau/go/src/github.com/sqp/godock/applets/GoGmail/src/GoGmail.go:55 +0x46
main.(*Feed).Check(0xf84007abd0, 0xf840001af0)
    /home/sqp/Bureau/go/src/github.com/sqp/godock/applets/GoGmail/src/mail.go:131 +0x184
main._func_001(0xf84008b210, 0x4233b3)
    /home/sqp/Bureau/go/src/github.com/sqp/godock/applets/GoGmail/src/GoGmail.go:59 +0x4a
github.com/sqp/godock/libs/poller.(*Poller).checkRoutine(0xf840079800, 0x0)
    /home/sqp/Bureau/go/src/github.com/sqp/godock/libs/poller/poller.go:118 +0x34
created by github.com/sqp/godock/libs/poller.(*Poller).Start
    /home/sqp/Bureau/go/src/github.com/sqp/godock/libs/poller/poller.go:95 +0x2c

goroutine 1 [select]:
github.com/sqp/godock/libs/dock.StartApplet(0xf8400c1200, 0xf840079900, 0xf8400010a0, 0x7f5dd2d42f78, 0x100000001, ...)
    /home/sqp/Bureau/go/src/github.com/sqp/godock/libs/dock/dock.go:70 +0x296
main.main()
    /home/sqp/Bureau/go/src/github.com/sqp/godock/applets/GoGmail/src/GoGmail.go:27 +0xad

goroutine 2 [syscall]:
created by runtime.main
    /tmp/bindist927634324/go/src/pkg/runtime/proc.c:221

goroutine 3 [syscall]:
syscall.Syscall6()
    /tmp/bindist927634324/go/src/pkg/syscall/asm_linux_amd64.s:40 +0x5
syscall.EpollWait(0xf800000006, 0xf8400d3010, 0xa0000000a, 0xffffffff, 0xc, ...)
    /usr/local/go/src/pkg/syscall/zerrors_linux_amd64.go:1781 +0xa1
net.(*pollster).WaitFD(0xf8400d3000, 0xf840079b00, 0x0, 0x0, 0x0, ...)
    /usr/local/go/src/pkg/net/fd_linux.go:146 +0x110
net.(*pollServer).Run(0xf840079b00, 0x0)
    /usr/local/go/src/pkg/net/fd.go:236 +0xe4
created by net.newPollServer
    /usr/local/go/src/pkg/net/newpollserver.go:35 +0x382

goroutine 4 [chan receive]:
github.com/norisatir/go-dbus.(*Connection)._RunLoop(0xf84007ab60, 0x0)
    /home/sqp/Bureau/go/src/github.com/norisatir/go-dbus/dbus.go:235 +0x7f
created by github.com/norisatir/go-dbus.(*Connection).Authenticate
    /home/sqp/Bureau/go/src/github.com/norisatir/go-dbus/dbus.go:215 +0xb2

goroutine 5 [chan receive]:
net.(*pollServer).WaitRead(0xf840079b00, 0xf8400b8360, 0xf8400769f0, 0xb, 0x1, ...)
    /usr/local/go/src/pkg/net/fd.go:268 +0x73
net.(*netFD).Read(0xf8400b8360, 0xf8400e9260, 0x1000000010, 0xffffffff, 0xf840076450, ...)
    /usr/local/go/src/pkg/net/fd.go:428 +0x1ec
net.(*UnixConn).Read(0xf84008b268, 0xf8400e9260, 0x1000000010, 0xf8400ff8c0, 0x0, ...)
    /usr/local/go/src/pkg/net/unixsock_posix.go:128 +0xce
github.com/norisatir/go-dbus.(*Connection)._GetInData(0xf84007ab60, 0xf8400efa00, 0xf8400ff8c0, 0x0)
    /home/sqp/Bureau/go/src/github.com/norisatir/go-dbus/dbus.go:283 +0x62
github.com/norisatir/go-dbus.(*Connection)._MessageReceiver(0xf84007ab60, 0xf8400efa00, 0x0, 0x0)
    /home/sqp/Bureau/go/src/github.com/norisatir/go-dbus/dbus.go:222 +0x25
created by github.com/norisatir/go-dbus.(*Connection)._RunLoop
    /home/sqp/Bureau/go/src/github.com/norisatir/go-dbus/dbus.go:232 +0x54

goroutine 7 [syscall]:
created by addtimer
    /tmp/bindist927634324/go/src/pkg/runtime/ztime_amd64.c:72

goroutine 8 [chan receive]:
net.(*pollServer).WaitRead(0xf840079b00, 0xf84011a120, 0xf8400769f0, 0xb, 0x1, ...)
    /usr/local/go/src/pkg/net/fd.go:268 +0x73
net.(*netFD).Read(0xf84011a120, 0xf840217800, 0x80000000800, 0x102ffffffff, 0xf840076450, ...)
    /usr/local/go/src/pkg/net/fd.go:428 +0x1ec
net.(*TCPConn).Read(0xf8400dea20, 0xf840217800, 0x80000000800, 0x62bf90, 0x0, ...)
    /usr/local/go/src/pkg/net/tcpsock_posix.go:87 +0xce
crypto/tls.(*block).readFromUntil(0xf8401348a0, 0xf840109a50, 0xf8400dea20, 0xf800000005, 0xf8400dea20, ...)
    /usr/local/go/src/pkg/crypto/tls/conn.go:397 +0xa5
crypto/tls.(*Conn).readRecord(0xf8400a2d80, 0x17, 0x0, 0x4105b1, 0xf84019c680, ...)
    /usr/local/go/src/pkg/crypto/tls/conn.go:477 +0xf2
crypto/tls.(*Conn).Read(0xf8400a2d80, 0xf840211000, 0x100000001000, 0xfd100000000, 0x0, ...)
    /usr/local/go/src/pkg/crypto/tls/conn.go:762 +0xe3
bufio.(*Reader).fill(0xf8400e8280, 0xf84019c640)
    /usr/local/go/src/pkg/bufio/bufio.go:77 +0xf0
bufio.(*Reader).Peek(0xf8400e8280, 0xf800000001, 0xf8400fdd01, 0x0, 0x0, ...)
    /usr/local/go/src/pkg/bufio/bufio.go:102 +0xbc
net/http.(*persistConn).readLoop(0xf8400e0cc0, 0x0)
    /usr/local/go/src/pkg/net/http/transport.go:525 +0xab
created by net/http.(*Transport).getConn
    /usr/local/go/src/pkg/net/http/transport.go:382 +0x5df


PS: feel free to directly commit on lp:cairo-dock-plug-ins-extras

SQP, Tuesday 06 November 2012 à 23:24


Subscription date : 03 July 2010
Messages : 1081
panic: runtime error: index out of range
Nice one. Forgot one default. Thanks for the report.

I secured it, even if it shouldn't be empty (user would have to blank both fields from his file)
+ improved absolute path detection with a new func I found.
https://github.com/sqp/godock/commit/e737997b3251f9e492bd647bc4410336fa089be5

at least my sendAlert worked somehow

And I'll really have to shorten my source path to improve crash messages

It can be interesting to add options to have a preview

I had the same thought, a really basic gui showing the detail of a message with back/next and a few options, like mark read and delete for mails.
With open/close on click and wheel to change message on the icon, it should be enough for most webmail users.

But I'd like someting similar for xchat and my, now no more secret, forum message parser so I'll have to check my needs first and try to factorise.

matttbe, Wednesday 07 November 2012 à 01:55


Subscription date : 24 January 2009
Messages : 12573
Thank you for this quick fix

fabounet, Thursday 08 November 2012 à 17:15


Subscription date : 30 November 2007
Messages : 17118
when can we add the Go interface to the trunk ?

SQP, Thursday 08 November 2012 à 20:43


Subscription date : 03 July 2010
Messages : 1081
New version 0.0.2-2

GoGmail: Use template and actions system provided by the API.
-Templates gives better and flexible output for popups.
-Actions gives an easy way to have different menus. Now 'Open client' option will be hidden if the application is monitored and already opened. This option is nicely provided by the dock, and at the same menu position.

Dock:
-Actions handling improved: grouped all methods in Actions struct and provide a new *CDApplet.BuildMenu(actionIds []int) method to help build menu using it.
-Templates can now be managed by the CDApplet instance as most applets should use them. Template files will be loaded from templates subdir of applet dir with *CDApplet.LoadTemplate(names...) and parsed with *CDApplet.ExecuteTemplate(name string, data interface{}) (string, error)

New package : Download GoGmail - amd64 v0.0.2-2

Commit

when can we add the Go interface to the trunk ?

I can now say my API code is almost as I wanted it (GoGmail is looking good too), and the doc start growing, and is finally visible here. The remaining issues would be :
  • I'm still missing 3 methods with complex arguments (special popup and menu on the 2 DBus versions)
  • DBus lib still not perfect. I haven't any problems with anything activated, but the old version was really ugly to debug, and was also missing the RenderValues. With the version reworked, I already managed to find 2 bugs, one of which is the RenderValues, opening many options, but it isn't finished, and the 3rd missing option with it is the Xid, preventing me from having application monitoring.
  • Golang code must be located in a dir referenced in $GOPATH (works exactly as $HOME), so I guess it might be better to put it where it could get installed with the go command like other libs.

current command to get the code is :

go get github.com/sqp/godock


I think launchpad is handled by the go tool, so it would just be a matter of deciding where to put it to have an import path that makes sense. (even if all my libs are on github)

fabounet, Saturday 10 November 2012 à 23:02


Subscription date : 30 November 2007
Messages : 17118
thanks ! so I guess we can import it into the trunk on LP ? and to build it we would just set the GOPATH in the CMakeLists.txt ?
by the way, the links in the dock seem to be not working. Or are they supposed to be accessed through git only (not from the browser) ?

SQP, Sunday 11 November 2012 à 13:19


Subscription date : 03 July 2010
Messages : 1081
go get github.com/sqp/godock # download all sources in $GOPATH/src/github.com/sqp/godock

if there was no problem with import (libs are pulled too), the next step is directly the build. That's something I want users to be able to do too (using that path or another that make sense). The only thing needed is the go compiler that takes care of everything.

go build github.com/sqp/godock/applets/GoGmail/src # build in package dir (here src)
go install github.com/sqp/godock/applets/GoGmail/src # build in $GOBIN dir. Default: $GOPATH/bin

Both will build it with output = dir name. Option -o allow to set a different name.

Last thing to do for a user, is to link the dir somewhere the dock can find it.
ln -s $GOPATH/github.com/sqp/godock/applets/GoGmail $HOME/.config/cairo-dock/third-party/


Currently, the code is in src subdir of the applet, but I could arrange and have data and sources splitted it if we have package distributon working.
I have added a Makefile in applets/GoGmail that just build it as GoGmail as expected, so it should be easy to do it this way:
cd $GOPATH/github.com/sqp/godock/applets/GoGmail
make
pack the dir the way you want.
(make archive will create $GOPATH/github.com/sqp/godock/applets/GoGmail.tar.xz)


I still haven't work on providing a pullable DBus API, so it's not in easy release state yet. The cli program may be better packed first

SQP, Tuesday 13 November 2012 à 16:59


Subscription date : 03 July 2010
Messages : 1081
New version of GoGmail, 0.0.2-3. Not a lot of visible changes on user side except the new version for 32 bits.
  • Use new LoadConfig API method to get an automatic parsing.
  • Fix: Now close http connection.
  • Use new version of DBus API.

Download links:

A version for ARM could be provided if anyone need, feel free to ask. ARM package isn't provided yet, as I'd like to know if it is usefull, and will work.

Remaining problems:
Emblem display: This is done the same way as the other Gmail applet. Which means that the current value is changed inside the svg and written to disk (at least I extracted the svg from the python code and removed prints scattered inside). As I can only send icon location, strings.Replace on a svg string and write to disk doesn't sound like a bad thing, so I'll stick with that, and want to improve the svg part it a little as it actually can only display correctly a 2 digits number (same for other applet but it cheat by adding a 0 in front of the 1 digit case).

I'd like to have the emblem and the background splitted, and only have to update the emblem. Problem is, it seem I can't set a full size emblem. and this is mandatory with the icon size I use: 30px.
I can only see advantages to a new option full size to emblems.
  • Create different emblems for different info size easier. It would allow me to make other emblems for 1 and 3 digits numbers which would cover a better range.
  • Better emblems on small icons.
  • Background isn't tied to emblem, both could be changed easily without affecting the other (would allow to reactivate the "icon image" option)

Don't tell me about quickinfo, they'll never be able to reach these custom emblems in terms of ability to tweak and display quality.

Playing sound: wether using play, aplay or paplay, I got strange results. The first call can't be heard, and others only if called shortly after, but at low level.
If I call it twice in a row really fast, the 2nd if played with full volume. This behaviour is the same if launched from a console, and I seem to use very different applications for all these calls:
    -rwxr-xr-x 1 root root 60688 avril 4 2012 /usr/bin/aplay
    lrwxrwxrwx 1 root root 5 juin 1 01:42 /usr/bin/paplay -> pacat
    lrwxrwxrwx 1 root root 3 déc. 27 2011 /usr/bin/play -> sox


TODO:
  • use a file in /tmp for the icon.
  • change small emblem so it updates only an emblem and not the full icon.

fabounet, Wednesday 14 November 2012 à 17:41


Subscription date : 30 November 2007
Messages : 17118
a full size emblem would completely cover the icon though
so, this is equivalent to build an image and just set it onto the icon
what about an option to write it on the icon label ?

emblems can be improved, but how ?

SQP, Wednesday 14 November 2012 à 18:02


Subscription date : 03 July 2010
Messages : 1081
a full size emblem would completely cover the icon though

will cover the area I'll tell it to cover, plus an emblem isn't always a square without transparency.

so, this is equivalent to build an image and just set it onto the icon

your idea is exactly what is done and need to be changed. I need to set different emblems for different text size, but won't edit full svg icons, nor have the code paint it in the background image itself. I also need the ability to change the background, a pretty basic option...
I just need a bigger emblem size for my small icon size.

emblems can be improved, but how ?

by rereading my previous post

what about an option to write it on the icon label

I'll come back later with the bug on labels (when I choose no labels, I'd prefer not have to hide an ugly black area)

fabounet, Tuesday 20 November 2012 à 18:03


Subscription date : 30 November 2007
Messages : 17118
I need to set different emblems for different text size

I think that emblems are for adding an image on the icon, and quick-info are for text.
we shouldn't mix both (mainly because text doesn't scale very well)
and the user of the quick-info API really shouldn't care how it will be rendered.
even the size should automatically adapt (so that the textis readable) but with such small icons, I'm afraid it will anyway cover the whole icon.

matttbe, Thursday 22 November 2012 à 18:35


Subscription date : 24 January 2009
Messages : 12573
But it can be nice to have the possibility to place a number on the middle (or on the top right/left) with a custom background

fabounet, Monday 26 November 2012 à 17:05


Subscription date : 30 November 2007
Messages : 17118
why not all quick-info then ?
I don't think each applet should decide where it writes such info
(and "a number" can be 1 or 3 digits, in the case of a mail applet it can even be 4 digits)

matttbe, Tuesday 27 November 2012 à 00:23


Subscription date : 24 January 2009
Messages : 12573
why not all quick-info then ?
Yes of course it can be interesting to use global settings (with maybe the possibility to change the default setting for each applet )

SQP, Tuesday 27 November 2012 à 10:50


Subscription date : 03 July 2010
Messages : 1081
My main problems with quickinfo:
-use zoom => text is blurry
-don't adapt to multi graphs or gauges

So when you say all icons should display text the same way, in my case I have :
-quickinfo as expected (ugly) : Weather
-quickinfo badly displayed : disk speed graph, net speed graph
-this mail counter.

note a difference already exist for gauges that can IIRC display it the way they want.

Gauges are different ? no, gauges just got some love in a distant past.

fabounet, Thursday 29 November 2012 à 16:52


Subscription date : 30 November 2007
Messages : 17118
about gauges, the truth is that it's often hardly readable if the applet is not in a desklet.
so I'm not really convinced with that.

now, you're right that the text zooms badly, and I've tried to not zoom them without success. Yet I think this is the good way.
(and yes we can add some options like position, background image, etc, but I'm not sure about the "per-applet")

by the way, emblems are also zoomed, so I guess we have the same problem of blur.

Applets | Applets

Subjects Author Language Messages Last message
[Locked] GoGmail: Simple mail applet.
SQP English 16 fabounet [Read]
29 November 2012 à 16:52


Glx-Dock / Cairo-Dock List of forums Applets | Applets GoGmail: Simple mail applet. Top

Online users :

Powered by ElementSpeak © 2007 Adrien Pilleboue, 2009-2013 Matthieu Baerts.
Dock based on CSS Dock Menu (Ndesign) with jQuery. Icons by zgegball
Cairo-Dock is a free software under GNU-GPL3 licence. First stable version created by Fabounet.
Many thanks to TuxFamily for the web Hosting and Mav for the domain name.