Home Forums Wiki Doc Install Extras Screenshots Source Code Projects Blog Users Groups Register
Glx-Dock / Cairo-Dock List of forums Ideas | Propositions [Patch] New gauge themes and effect
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)
Ideas | Propositions

Subjects Author Language Messages Last message
[Locked] [Patch] New gauge themes and effect
Page : 1 2
SQP English 25 matttbe [Read]
30 September 2011 à 16:28

SQP, Saturday 16 July 2011 à 15:28


Subscription date : 03 July 2010
Messages : 1081
Here is an update from my last year patches to add some effects to gauges in order to get a nice bar view.

I created 2 dedicated branches to make that clean :
https://code.launchpad.net/~meuarrr/cairo-dock-core/gauge-effect-new
https://code.launchpad.net/~meuarrr/cairo-dock-plug-ins/gauge-effect-new

And the test theme : Fluid Reggae

http://uppix.net/3/4/b/0b13455882b11cfccfd35d0d05ee1.png

A video that show how it work : http://videobin.org/+1m7/1ve.html

More examples can be seen on the old thread.

I'm open for any comment, especially on code, or implementation (I guess textual options might be better).

Only work in OpenGL atm. I'll work on cairo implementation and more documentation when I'll have positive feedback on that first part.

Example theme file :
<gauge>
    <name>Fluid Reggae</name>
    <author>SQP</author>
    <file key="foreground">foreground.svg</file>
    <file key="background">background.svg</file>
    <multi_display>1</multi_display>
    <indicator>
        <effect>1</effect>
        <file key="image">bar0.svg</file>
        <file key="image">bar0.svg</file>
        <file key="image">bar0.svg</file>
        <file key="image">bar1.svg</file>
        <file key="image">bar2.svg</file>
        <text_zone>
            <x_center>-0</x_center>
            <y_center>-0,1</y_center>
            <width>0,8</width>
            <height>0,8</height>
            <red>0</red>
            <green>0</green>
            <blue>0</blue>
        </text_zone>
    </indicator>
</gauge>


Patches details:

Core : 802
Gauge image theme : Add theme effects to indicator image.
Theme file : enable new indicator key 'effect' with value :
0 : no effect (default)
1 : crop
2 : stretch
3 : zoom
4 : fade
Crop and stretch effect are applied from bottom to top. Zoom is centered


Core : 803
Gauge theme : Add an option to choose how multi gauges are displayed (for themes with only 1 indicator).
Theme file : enable new key 'multi_display' with value :
0 : scattered (default) - 2/3 size main gauge on top left for first one. 1/3 size for the next three, with position in that order : bottom right, top right, bottom left. Fith and higher are dropped.
1 : shared - space will be evenly shared between gauges. So if you have 3, each one will have 33.3% width allocated.

Option 0 is unchanged from current rendering (so the divert will only appear if key is found in theme XML)
Works only in OpenGL


Core : 804
Gauge theme : Enable theme rotation option.
Using new renderer option, activated for gauges only (opengl only atm) with user settings.
0 : no (default) - don't do anything.
1 : with dock oritentation - rotate only if the dock is in vertical position. Allow easy swapping.
2 : yes - applet is always rotated. This give more orientation option when enabling multi gauges and resizing. Usefull for docklet too.


Plug-Ins : 2020
Enable gauge theme rotate : System-Monitor + netspeed
Add option to rotate gauge theme : No / With dock orientation / Yes


[Edit] Moved back to Propositions (revert DB bug)

lylambda, Saturday 16 July 2011 à 22:01


Subscription date : 06 September 2009
Messages : 1635
Interesting, that can be really useful

taiebot65, Sunday 17 July 2011 à 14:04


Subscription date : 26 October 2008
Messages : 1904
COuld you integrate this to mattbes plugin? Impulse applet in the background of the dock?

SQP, Sunday 17 July 2011 à 18:48


Subscription date : 03 July 2010
Messages : 1081
Hum, I never tried the Impulse plug-in before, and couldn't have it working (I activated animations and some music, but nothing moved, even when clicking. Maybe because my 1st sound card is disabled (hdmi output))

But even if I could'nt see exactly what it do, I could figure out that it moves the dock applets and icons. This patch only add a few options for gauges displays.

But it could be used as an output for direct display in the impulse applet icon (just need to fill the data in a gauge render).

My next step is to (re)enable it in alsaMixer (need activate a gauge renderer) and finish the Disks applet so it can monitor partitions size (it's almost done but with specific questions that could delay the merge)

nochka85, Sunday 17 July 2011 à 20:59


Subscription date : 29 November 2007
Messages : 7408
@SQP: just try to decrease the sensitivity to a VERY low value for Impulse

matttbe, Tuesday 19 July 2011 à 18:24


Subscription date : 24 January 2009
Messages : 12573
@ SQP: many thanks for these (re)commits!

@ fabounet: can I merge these two branches into the trunk? even if we are in beta2? (it's not a RC ). But I see that it doesn't affect too much other parts of the code.

SQP, Tuesday 19 July 2011 à 22:55


Subscription date : 03 July 2010
Messages : 1081
I'm happy to propose them again, as I find them really usefull, I guess some others would also use a themed bar display.
And I'm sure that some themers could have better ideas than me on how to get the best out of that.

First 2 patches are really minor and localized : an enum, an XML key, a data key and a switch to apply the new option.
The third one seem a little harder because some calcs requires to swap width and height when rotated, like text display (which also require unrotate).

did you tried it ?
what's the best option to help test it with the dedicated theme ? as everything depends on it I wonder if I should push the theme in the core to help tests (even if we remove it after)

Here's a screen of my new config. I reactivated all options I really missed from gkrellm, so now I'm happy with it, I'll try to clean the display problems on it (graphs and icon text could really benefit some tweaking).
http://meuarrr.free.fr/images/temp/cairo-dock-mymonitoring.png
ram gauge display is 20 px height for 2 bars (10 px each)
disks gauge display is 24 px height for 3 bars (8 px each)
which is really efficient and space saving.

matttbe, Wednesday 27 July 2011 à 15:27


Subscription date : 24 January 2009
Messages : 12573
@fabounet: may I merge it? or should I waiting for something?

fabounet, Wednesday 27 July 2011 à 15:51


Subscription date : 30 November 2007
Messages : 17118
Ideally I'd like to review it before

matttbe, Wednesday 27 July 2011 à 15:54


Subscription date : 24 January 2009
Messages : 12573
No problem

SQP, Monday 15 August 2011 à 14:28


Subscription date : 03 July 2010
Messages : 1081
Patches have been merged in Core:826. Many thanks to both of you

Every BZR users (and PPA soon too) could try it using one of the themes. Just extract it to your ~/.config/cairo-dock/extras/gauges/ directory
    • Fluid Reggae : Using 3 images, base color will change from green to yellow or red to better show higher values.
    • Fluid Reggae Simple : The same theme using only one image. Base color will remain green even on higher values.


Rotate option still need a Plug-Ins change to be used, but the new gauges already works fine in OpenGL.

@Fabounet : I know you would have prefered an automatic orientation, but I guess a simple select option is better to cover most user needs (that could really vary from one applet to another in term of size and number of displayed data)

Using a refactoring function like the graph one :
static CairoGaugeAttribute cairo_dock_create_gauge_attribute (gchar *cGThemePath, RendererRotateTheme iRotateTheme)
{
    CairoGaugeAttribute attr; // les attributs de la jauge.
    memset (&attr, 0, sizeof (CairoGaugeAttribute));
    attr.cThemePath = cGThemePath;
    pRenderAttr = CAIRO_DATA_RENDERER_ATTRIBUTE (&attr);
    pRenderAttr->cModelName = "gauge";
    pRenderAttr->iRotateTheme = myConfig.iRotateTheme;
    return attr;
}


applet creation becomes a simple call to this function, easy to deploy :
    if (myConfig.iDisplayType == CD_SYSMONITOR_GAUGE)
    {
        CairoGaugeAttribute attr = cairo_dock_create_gauge_attribute (myConfig.cGThemePath, myConfig.iRotateTheme);
        pRenderAttr = CAIRO_DATA_RENDERER_ATTRIBUTE (&attr);
    }


Applets concerned (7) : Dbus, Disks, netspeed, Network-Monitor, powermanager, System-Monitor, wifi (+ alsaMixer soon)

fabounet, Tuesday 16 August 2011 à 16:04


Subscription date : 30 November 2007
Messages : 17118
I guess a simple select option is better to cover most user needs (that could really vary from one applet to another in term of size and number of displayed data)

that's what I'm wondering, apart from progressbar-like gauges, what kind of renderer could be either turned or not turned ?
I think all renderers will naturally follow the width/height ratio if they can turn.

ok for the graph function (and the graph improvements patch ? )

SQP, Tuesday 16 August 2011 à 18:22


Subscription date : 03 July 2010
Messages : 1081
I guess some standard gauges could use that option, like battery's or wifi if oriented from bottom to top, but I agree that wouldn't be common. At least, it is sure it isn't atm, because there is no option for that.
But I hope that those patches would bring our gauges choice further.

Height/width ratio isn't a good answer for that one : increase gauges number, and you will want to increase applet size. But you will have THE limit where the applet auto rotate and fucks your attempt to get more space.

I may add that some settings that try to cover automatically all user needs sometimes ends up in something hard to configure. I had the case with graph text color. When I saw how it was coded, I understood I had no chance to imagine how it was working, or get a nice display.

There's so many settings to configure desklets (rotation 3 axis, decorations, margins), but nothing for applets in dock. I just need a simple rotate option and tried not to make it too confusing.
I know you're the dock gatekeeper, and that serious analyse before merge benefit to the project, but now, I don't know how I could better support my idea.

I guess that the (atm most of the time useless) option requires some time playing with to see what we can get from it, but I'm sure that lot of users could enjoy that rotate option with flexible gauges.

I can just add that I'll try to play with the idea I opened about a dynamic renderer config tab for applets that would allow us to increase renderer number easier. (and split back that option only to some usefull gauge types)

fabounet, Wednesday 17 August 2011 à 12:49


Subscription date : 30 November 2007
Messages : 17118
ok, well we can add this option, and see where it leads us
@Matttbe: if you have the opportunity of merging the gauges-plug-ins branch that would be nice, because I have some modifs on my side, and bzr doesn't allow to do files-commit after a merge.

I'm going to implement a "hint" parameter in the Package class, so that we'll be able to filter the various themes on a simple keyword (like "wifi" or "sound").
also I'm definitely positive for something that helps making the themes I don't know if a GUI can be made easily, but at least a clear documentation on each fields of the xml, with some concrete exemple, in a page on the wiki could help a lot.

matttbe, Monday 22 August 2011 à 23:27


Subscription date : 24 January 2009
Messages : 12573
if you have the opportunity of merging the gauges-plug-ins branch that would be nice
Done! But not this one: lp:~meuarrr/cairo-dock-core/graph-fix-display because of that: bg_topic.php?t=5541&pos=20#mess_68962

PS: sorry to be late... Also, what about the new themes (ragga...), can I upload it on the server? Or is it plan to change the .xml?

fabounet, Wednesday 24 August 2011 à 12:33


Subscription date : 30 November 2007
Messages : 17118
I haven't tested them yet, so someone should do it before uploading
but it would be nice to have a few progress-bar available (with the "name" set to "progress-bar: theme-name", like for the other gauges), and maybe some gauge for sound too (with a hint, like for the battery or wifi)
although we can upload them after the realease, so it's not that hurry

SQP, Sunday 11 September 2011 à 16:06


Subscription date : 03 July 2010
Messages : 1081
I have no plans to change my themes display. I guess that text could be improved, so feel free to change them if you want. (or even rename)

Last versions:
    • Fluid Reggae : Using 3 images, base color will change from green to yellow or red to better show higher values.
    • Fluid Reggae Simple : The same theme using only one image. Base color will remain green even on higher values.

matttbe, Sunday 11 September 2011 à 16:17


Subscription date : 24 January 2009
Messages : 12573
Thank you
I'm going to upload them after the last modifications by Fab about these Gauge 3 (the last problem with the new "error" and "off" status for PowerManager, Wifi, Alsamixer, etc.)

fabounet, Tuesday 13 September 2011 à 14:13


Subscription date : 30 November 2007
Messages : 17118
the "undef" values are done for gauges now
so alsamixer can mute with a gauge.
I haven't upload the themes yet (basically you just add a field <file type="undef-value"></file>), I'll do it tonight

matttbe, Tuesday 13 September 2011 à 14:31


Subscription date : 24 January 2009
Messages : 12573
Ok, I will do that for these themes: Gnome 3 mono, Humanity (+mono for the sound) and ubuntu-mono (sound/wifi/battery). And if I've a few time, I'll add the possibility to use these undef values for powermanager and wifi.

Ideas | Propositions

Subjects Author Language Messages Last message
[Locked] [Patch] New gauge themes and effect
Page : 1 2
SQP English 25 matttbe [Read]
30 September 2011 à 16:28


Glx-Dock / Cairo-Dock List of forums Ideas | Propositions [Patch] New gauge themes and effect 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.