You are not logged in.

#1 2013-10-11 20:00:00

Chuck Arch Linux
Member
Registered: 2011-06-23
Posts: 81

[Solved] Awesome wm cpu grah

Hi everyone,
                   I almost finish my awesome 3.5 configuration, but the only thing I'm not able to do is seperate all my cpu % graph.
I can't find anywhere how to make one cpu % graph for each cpu.

Presently I use this:

 
  -- Initialize widget
    cpuwidget = awful.widget.graph()
    -- Graph properties
    cpuwidget:set_width(75)
    cpuwidget:set_height(30)
    cpuwidget:set_border_color("#222222")
    cpuwidget:set_background_color("#000000")
    cpuwidget:set_color({ type = "linear", from = { 75,0 }, to = { 75,30 }, stops = { {0, "#FF0000"}, {0.5, "#FFFF00"},
                     {1, "#00FF00" }}})

    -- Register widget
    vicious.register(cpuwidget, vicious.widgets.cpu, "$1", 1)

Is there a fonction I can call in the register to make the widget use the CPU0 by example?
My goal is to make four of them, but only one cpu by graph.

Thanks,

Last edited by Chuck Arch Linux (2013-10-13 13:43:47)

Offline

#2 2013-10-13 13:43:17

Chuck Arch Linux
Member
Registered: 2011-06-23
Posts: 81

Re: [Solved] Awesome wm cpu grah

For those interested, I found the solution.

You simply need to add the following line in your rc.lua :

vicious.cache(vicious.widgets.cpu)

Then you can copy this four time (in my case I have a quad core):

  -- Initialize widget
    cpuwidget1 = awful.widget.graph()
    -- Graph properties
    cpuwidget1:set_width(75)
    cpuwidget1:set_height(30)
    cpuwidget1:set_border_color("#222222")
    cpuwidget1:set_background_color("#000000")
    cpuwidget1:set_color({ type = "linear", from = { 75,0 }, to = { 75,30 }, stops = { {0, "#FF0000"}, {0.5, "#FFFF00"},
                     {1, "#00FF00" }}})

    -- Register widget
    vicious.register(cpuwidget1, vicious.widgets.cpu, "$2", 1)

... change all the value of cpuwidget1 and the "$2" to the correponding cpu you want. ($2, first core, $3, second core etc....) The $1 is only for the total of all available core.

Take me a while to find that it was only the caching option that I was missing.

Last edited by Chuck Arch Linux (2013-10-13 13:50:19)

Offline

Board footer

Powered by FluxBB