SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#7351 2014-04-11 14:51:53

Marenbraga
Member
Registered: 2013-11-14
Posts: 40

Re: Conky v1.9 Thread

Sector11 wrote:
mrpeachy wrote:

copying the code straight over i get this

http://s4.postimg.org/xh2o4z7qx/Screenshot_from_2014_04_09_20_30_27.jpg

the bottom part seems to be working but the templates are not, just 0B constant

OK, the templates are out.  big_smile

The bottom part in your example, like Marenbraga's, seems to have the graph for wlan0 (that red line) - but no border ...

And I made sure that:

# graph borders
draw_graph_borders yes #no
#default_graph_size 15 40

was in there as well.

So for this test I changed that to:

# graph borders
draw_graph_borders no #yes
#default_graph_size 15 40

http://s20.postimg.org/a442xq5jd/2014_04_10_10_52_15_331x506_Sector11.jpg .. so how come that bottom downspeed graph has a border and the upspeed doesn't?

That would be another trick just picked up from Marenbraga - wireless_link_bar - since I don't wireless it's a freebee box ...  and should be for you as well if you don't use the (net) option like this (change eth0 to something working):

no bar_graph borders:

${goto 10}${downspeedgraph eth0 40,106 76FF00 FF0000 -t}\
${goto 10}${wireless_link_bar 40,106}\
${upspeedgraph eth0 40,106 76FF00 FF0000 -t}

Does that work for you?  And you too Marenbraga?

Learning new things all around on this little quest thanks to Marenbraga  big_smile

Marenbraga wrote:

Hi Sector11 ... I thought the same thing about gw_iface. sniffff: (
The idea of the vertical bar was mine, yes. Its horizontal bar is very cool, works better than the "HR" .. great idea.
The last code you sent was constantly at 0 for me too, but I feel that this is the right way.

Try this in that test conky:

At the bottom add a line:

${gw_iface}

and run it, then just below that add  a direct command using whatever (net) you get:

${gw_iface}
${goto 10}${downspeedgraph (net) 40,106 76FF00 FF0000 -t}

If it says wlan2 change (net) to wlan2 ... Does that work?

Marenbraga wrote:

Hi Mrpeachy ... the code you sent worked without "sudo". But how I would deal with two interfaces connected? I usually use Wifi/3G connection and share the connection via network card, and it would appear that both the layout.

Yea that's a kicker, and needing an ${execp ...} for every call isn't very CPU friendly ... you'd drain a battery in no time I think.

Marenbraga wrote:

You both impressed me! One day be able to know as much as you two .... I'm still very noob .. hehe

I remember days where I said the same thing.  People bent over backwards to help me ... I made a promise to myself to repay their kindness and generosity by helping others.  And almost 6 and a half years later ... here I am, still helping.

Stick around ... we'll get you addicted ... Right mrpeachy.    BTW: mrpeachy is my lua mentor.

{click} - - - Idea Alert! 8)

please add something to that test, just below it ... bear with me on this please:

${membar 0,100}
I am using: ${if_match "${gw_iface}"=="wlan0"}wlan0${else}\
${if_match "${gw_iface}"=="wlan1"}wlan0${else}\
${if_match "${gw_iface}"=="wlan2"}wlan0${else}\
${if_match "${gw_iface}"=="wlan3"}wlan0${else}\
${if_match "${gw_iface}"=="eth0"}eth0${else}\
${if_match "${gw_iface}"=="eth1"}eth1${else}\
${if_match "${gw_iface}"=="eth2"}eth2${else}\
${if_match "${gw_iface}"=="eth3"}eth3\
${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}

and post the results.

http://s20.postimg.org/skyhojlhp/2014_04_10_11_34_22_262x346_Sector11.jpg
The code as it now stands, since template seems to be out:

update_interval 1
if_up_strictness link ## up link or address # for wireless only I think
TEXT
The Marenbraga Test

Connection: ${gw_iface}
${if_up eth1}eth1 info\
eth1 info
eth1 info${else}\
${if_up eth2}eth2 info\
eth2 info
eth2 info${else}\
${if_up eth0}${upspeedgraph eth0 40,106 76FF00 FF0000 -t}\
${goto 115}${color4}${downspeedgraph eth0 40,106 76FF00 FF0000 -t}${color}
${voffset -11}${color5}${wireless_link_bar 15,215}${voffset 11}${goto 113}${voffset -56}${wireless_link_bar 53,1}${color}
${voffset -23}${goto 10}↑ ${upspeed eth0}${goto 123}↓ ${downspeed eth0}
${goto 10}${color2}TOT: ${color4}${totalup eth0}${goto 123}${color2}TOT: ${color4}${totaldown eth0}${else}\
${if_up eth3}eth3 info\
eth3 info
eth3 info${else}\
${if_up eth4}eth4 info\
eth4 info
eth4 info${else}\
${if_up wlan1}wlan1 info\
wlan1 info
wlan1 info${else}\
${if_up wlan2}wlan2 info\
wlan2 info
wlan2 info${else}\
${if_up wlan0}${upspeedgraph wlan0 40,106 76FF00 FF0000 -t}\
${goto 115}${color4}${downspeedgraph wlan0 40,106 76FF00 FF0000 -t}${color}
${voffset -11}${color5}${wireless_link_bar 15,215}${voffset 11}${goto 113}${voffset -56}${wireless_link_bar 53,1}${color}
${voffset -23}${goto 10}↑ ${upspeed wlan0}${goto 123}↓ ${downspeed wlan0}
${goto 10}${color2}TOT: ${color4}${totalup wlan0}${goto 123}${color2}TOT: ${color4}${totaldown wlan0}${else}\
${if_up wlan3}wlan3 info\
wlan3 info
wlan3 info${else}\
${if_up wlan4}wlan4 info\
wlan4 info
wlan4 info\
${endif}${endif}${endif}${endif}${endif}\
${endif}${endif}${endif}${endif}${endif}${color}

no bar_graph borders:

${goto 10}${downspeedgraph eth0 40,106 76FF00 FF0000 -t}\
${goto 10}${wireless_link_bar 40,106}\
${upspeedgraph eth0 40,106 76FF00 FF0000 -t}

${membar 0,100}
I am using: ${if_match "${gw_iface}"=="wlan0"}wlan0${else}\
${if_match "${gw_iface}"=="wlan1"}wlan0${else}\
${if_match "${gw_iface}"=="wlan2"}wlan0${else}\
${if_match "${gw_iface}"=="wlan3"}wlan0${else}\
${if_match "${gw_iface}"=="eth0"}eth0${else}\
${if_match "${gw_iface}"=="eth1"}eth1${else}\
${if_match "${gw_iface}"=="eth2"}eth2${else}\
${if_match "${gw_iface}"=="eth3"}eth3\
${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}

Hi Sector 11, the trick with gw_iface seems not to work with me. Did I forget something? I think my conky does not like me:.. 8.( 

Wow, very nice to know you got that. I loved the reception we had with you and mrpeachy. It would be great if one day I also knew that both could help "noobs" loll

${execp ifconfig | grep -EB4 "RUNNING" | grep "Link encap" | grep -v "lo" | awk '{print "${downspeed " $1 "}"}'}
${execp ifconfig | grep -EB4 "RUNNING" | grep "Link encap" | grep -v "lo" | awk '{print "${upspeed " $1 "}"}'}

I adopted this solution above. It completely replaces the line of my code that expresses the speed of download and upload any wired connection.

Offline

Help fund CrunchBang, donate to the project!

#7352 2014-04-11 15:07:22

Marenbraga
Member
Registered: 2013-11-14
Posts: 40

Re: Conky v1.9 Thread

Sector11 wrote:
Marenbraga wrote:

Hi dk75, this function you created did not work in my conky.
This code is complete? There appeared no information.

Two things:

  1. don't include the ]] in the second line, just the first line of code.

  2. Do you have vnstat installed?

It works well here, dk75 doesn't write bad code - at least not that I have ever seen:

--
${font bauhaus:regular:size 16}${goto 32}${execpi 60 ip -oneline link |mawk '!/state DOWN/ && !/loopback/ {gsub(/:/,"",$2); print $2}' | xargs -I {} vnstat -i {} --oneline |mawk -F";" '{gsub(/ /,""); gsub(/\.[0-9][0-9]/,"${font bauhaus:regular:size 16}"); gsub(/iB/,"${font bauhaus:bold:size 16}"); print $2"${font bauhaus:bold:size 16}${alignr 55}"$6"/"$11}'}${font}

${execpi 60 ip -oneline link |mawk '!/state DOWN/ && !/loopback/ {gsub(/:/,"",$2); print $2}' | xargs -I {} vnstat -i {} --oneline |mawk -F";" '{gsub(/ /,""); gsub(/\.[0-9][0-9]/,""); gsub(/iB/,""); print $2"   "$6"/"$11}'}

I changed the font, I didn't have dk75's called font, and reformatted the second line just to test.  See the bottom two lines in the attached image.

Please - test this see if it works for you (see the "I am using" section in the image):

${membar 0,100}
I am using:${gw_iface}
${if_match "${gw_iface}"=="wlan0"}↑ ${upspeed wlan0}${goto 123}↓ ${downspeed wlan0}${else}\
${if_match "${gw_iface}"=="wlan1"}↑ ${upspeed wlan1}${goto 123}↓ ${downspeed wlan1}${else}\
${if_match "${gw_iface}"=="wlan2"}↑ ${upspeed wlan2}${goto 123}↓ ${downspeed wlan2}${else}\
${if_match "${gw_iface}"=="wlan3"}↑ ${upspeed wlan3}${goto 123}↓ ${downspeed wlan3}${else}\
${if_match "${gw_iface}"=="eth0"}↑ ${upspeed eth0}${goto 123}↓ ${downspeed eth0}${else}\
${if_match "${gw_iface}"=="eth1"}↑ ${upspeed eth1}${goto 123}↓ ${downspeed eth1}${else}\
${if_match "${gw_iface}"=="eth2"}↑ ${upspeed eth2}${goto 123}↓ ${downspeed eth2}${else}\
${if_match "${gw_iface}"=="eth3"}↑ ${upspeed eth3}${goto 123}↓ ${downspeed eth3}${else}\
${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}

http://s20.postimg.org/lly7uepop/2014_04_11_11_27_35_301x570_Sector11.jpg

Hi Sector,

I answered the other post first to be smaller and faster .... I need to translate the posts with google, because my English is very weak.
The code did not work ... Vnstat seems biscuit brand name here in Brazil .. LOL ...
I do not have it installed ... just give sudo apt-get install vnstat?

bighugs

Offline

#7353 2014-04-11 15:40:21

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

Marenbraga wrote:

Hi Sector,

I answered the other post first to be smaller and faster .... I need to translate the posts with google, because my English is very weak.
The code did not work ... Vnstat seems biscuit brand name here in Brazil .. LOL ...
I do not have it installed ... just give sudo apt-get install vnstat?

bighugs

OH!!!!  I didn't think anything about you having an English problem at all, your writing is very good.  A lot better than my Spanish (or Portuguese).

Yes: sudo apt-get install vnstat will install that for you.
But think, do you really want to.  You are using #! on a USB Stick - and never sure what your net connection will be.

Sim: os sudo apt-get install vnstat instalará isto para você.
Mas pense, faça-o realmente querem a. Você está usando *! em um Pau de USB - e nunca seguro que a sua conexão líquida será.

so ${gw_iface} doesn't work at all for you.
Hmmmmmmm  .... I wonder if it is because you are on a USB Stick.

assim $ {gw_iface} não trabalha em absoluto para você.
Hmmmmmmm.... Admiro-me se for porque você está em um Pau de USB.


OH ... Bem-vindo da Argentina

imTranslator is my friend.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#7354 2014-04-11 15:45:29

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

Marenbraga wrote:

bighugs

Now that's a South American thing!

Un abraso grande!
Um abra grande!


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#7355 2014-04-11 23:27:18

Marenbraga
Member
Registered: 2013-11-14
Posts: 40

Re: Conky v1.9 Thread

mrpeachy wrote:

question about vnstat
i only have the one connection type on this computer and the command

vnstat --dumpdb

returns the following

version;3
active;1
interface;eth0
nick;eth0
created;1396490645
updated;1396894986
totalrx;558
totaltx;55
currx;38492160
curtx;7300096
totalrxk;934
totaltxk;189
btime;1396888661
d;0;1396888685;36;6;726;985;1
d;1;1396802614;65;6;306;335;1
d;2;1396674026;143;14;683;672;1
d;3;1396587625;179;13;392;954;1
d;4;1396540703;127;12;1015;425;1
d;5;1396490645;5;0;884;914;1
d;6;0;0;0;0;0;0
d;7;0;0;0;0;0;0
d;8;0;0;0;0;0;0
d;9;0;0;0;0;0;0
d;10;0;0;0;0;0;0
d;11;0;0;0;0;0;0
d;12;0;0;0;0;0;0
d;13;0;0;0;0;0;0
d;14;0;0;0;0;0;0
d;15;0;0;0;0;0;0
d;16;0;0;0;0;0;0
d;17;0;0;0;0;0;0
d;18;0;0;0;0;0;0
d;19;0;0;0;0;0;0
d;20;0;0;0;0;0;0
d;21;0;0;0;0;0;0
d;22;0;0;0;0;0;0
d;23;0;0;0;0;0;0
d;24;0;0;0;0;0;0
d;25;0;0;0;0;0;0
d;26;0;0;0;0;0;0
d;27;0;0;0;0;0;0
d;28;0;0;0;0;0;0
d;29;0;0;0;0;0;0
m;0;1396490645;558;55;934;189;1
m;1;0;0;0;0;0;0
m;2;0;0;0;0;0;0
m;3;0;0;0;0;0;0
m;4;0;0;0;0;0;0
m;5;0;0;0;0;0;0
m;6;0;0;0;0;0;0
m;7;0;0;0;0;0;0
m;8;0;0;0;0;0;0
m;9;0;0;0;0;0;0
m;10;0;0;0;0;0;0
m;11;0;0;0;0;0;0
t;0;1396587625;179;13;392;954;1
t;1;1396674026;143;14;683;672;1
t;2;1396540703;127;12;1015;425;1
t;3;1396802614;65;6;306;335;1
t;4;1396490645;5;0;884;914;1
t;5;0;0;0;0;0;0
t;6;0;0;0;0;0;0
t;7;0;0;0;0;0;0
t;8;0;0;0;0;0;0
t;9;0;0;0;0;0;0
h;0;0;0;0
h;1;0;0;0
h;2;0;0;0
h;3;0;0;0
h;4;0;0;0
h;5;0;0;0
h;6;0;0;0
h;7;0;0;0
h;8;0;0;0
h;9;0;0;0
h;10;0;0;0
h;11;1396889975;12734;1741
h;12;1396893576;21697;4743
h;13;1396894986;3159;645
h;14;1396814375;2253;232
h;15;1396817975;2196;241
h;16;1396821575;2630;259
h;17;1396825175;4131;381
h;18;1396828776;2699;300
h;19;1396832376;2679;263
h;20;1396835046;33720;1916
h;21;0;0;0
h;22;0;0;0
h;23;0;0;0

is this the same for someone who has 2 connection types, eg uses wired and wireless on a laptop
do you have to select which database?

Hi mrpeachy,

i have eth0 (wired) and 3g... 

I'm currently using that code below:

${execp ifconfig | grep -EB4 "RUNNING" | grep "Link encap" | grep -v "lo" | awk '{print "${upspeed " $1 "}"}'}

He is perfect! Small and intuitive. However, it is not meant for connections wifi/3g. I'm testing the code you sent and sector11, but so far none worked for me. The sector11 advised to think whether it's worth installing vnstat, since I'm using CrunchBang on a USB stick.
I am currently trying to get a code that works for connections Wi-Fi/3G. Somehow you imagine?


Kisses

Offline

#7356 2014-04-12 00:24:50

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

I notice in the

man vnstat

page that it doesn't mention 'wlan' specifically BUT

--enable, --disable
              Enable or disable updates for selected interface. Useful  for  interfaces  that  aren't  always
              available,  like  ppp0.  If  the  interface  goes  down it should be disabled in order to avoid
              errors. Add something like vnstat -r --disable -i ppp0 to the script that's executed  when  the
              interface  goes  down  and  vnstat  --enable -i ppp0 to the up script. These two options aren't
              needed when the daemon is used.

So that's a good sign.

@ mrpeachy

You can display multiple databases ... at least I think that's what this means:

EXAMPLES
       vnstat Display traffic summary for the default interface.

       vnstat -i eth0+eth1+eth3
              Display traffic summary for a merge of interfaces eth0, eth1 and eth3.

       vnstat -i eth2 --xml
              Output all information about interface eth2 in xml format.

       vnstat -u -i eth0
              Force  a database update for interface eth0 or create the database if it doesn't exist. This is
              usually the first command used after a fresh install.

       vnstat -u -i eth0 --nick local
              Give interface eth0 the nickname "local". That information will be later  later  visible  as  a
              label  when eth0 is queried. The database will also be updated when this command is executed or
              created if the database doesn't exist.

       vnstat -i eth2 --delete
              Delete database of interface eth2 and stop monitoring it.

@ Marenbraga

yes, get vnstat - this looks like it will work for you, USB stick or not - it is worth the try.
sim, adquira-se vnstat - isto parece a ele trabalhará para você, pau de USB ou não - ele merece a tentativa.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#7357 2014-04-12 00:31:43

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

I got sidetracked today and ended up tweaking a conky that comes out of "Conky Manager" -
2014_04_11_20_32_17_1920x1080_Sector11.jpg
Still 'rough' but it works.  Wanted a mono font so that changed and blue is my favourite colour so goodbye orange.

conkyrc_seamod
the S11 way:

# conky -c /media/5/conky/conky-manager/themes1.2/ConkySeamod/config/conky_seamod &
# pkill -xf "conky -c /media/5/conky/conky-manager/themes1.2/ConkySeamod/config/conky_seamod" &
# tweaked by Sector11 - 11 Apr 2014
#==============================================================================
#                               conkyrc_seamod
# Date    : 05/02/2012
# Author  : SeaJey
# Version : v0.1
# License : Distributed under the terms of GNU GPL version 2 or later
#
# This version is a modification of conkyrc_lunatico which is modification of conkyrc_orange
#
# conkyrc_orange:    http://gnome-look.org/content/show.php?content=137503&forumpage=0
# conkyrc_lunatico:  http://gnome-look.org/content/show.php?content=142884
#==============================================================================

background yes
update_interval 1

cpu_avg_samples 1
net_avg_samples 2
temperature_unit celsius

double_buffer yes
no_buffers yes
text_buffer_size 2048

gap_x 30
gap_y 70
minimum_size 310 900
maximum_width 310
own_window yes
own_window_type normal
own_window_transparent yes
own_window_type normal
own_window_class Conky
own_window_hints undecorate,skip_taskbar,skip_pager,below ## removed sticky for testing
#own_window_argb_visual yes
#own_window_argb_value 0.05
#own_window_colour gray


border_inner_margin 0
border_outer_margin 0
alignment top_right


draw_shades yes #no # Persoal preference
draw_outline no
draw_borders no
draw_graph_borders no # changed for test

override_utf8_locale yes
use_xft yes
## xftfont caviar dreams:size=10  ## <<-- does not use this
xftfont Share-TechMono:size=10 ## change to this and eliminate a ton of font calls.
xftalpha 0.5
uppercase no

# Defining colors
default_color FFFFFF
# Shades of Gray
color1 DDDDDD
color2 AAAAAA
color3 888888
# Orange
color4 00BFFF #DeepSkyBlue ##EF5A29
# Green
color5 77B753

# Loading lua script for drawning rings
lua_load /media/5/conky/conky-manager/themes1.2/ConkySeamod/seamod_rings.lua
lua_draw_hook_post main

## System information using conky capabilities

TEXT
${font Share-TechMono:bold:size=10}${color4}SYSTEM${font} ${hr 2}
${goto 15}${font}${color1}${sysname} ${kernel}${alignr}System & Kernel
${goto 15}${color1}${nodename}${alignr}Node Name
${goto 15}${color1}${uptime}${alignr}Uptime
${font Share-TechMono:bold:size=10}${goto 130}${cpugraph 75,175 666666 666666}${goto 85}${voffset -5}${color5}CPU
# Showing TOP 5 CPU-consumers
${goto 105}${font}${color4}${top name 1}${alignr}${top cpu 1}%
${goto 105}${color1}${top name 2}${alignr}${top cpu 2}%
${goto 105}${color2}${top name 3}${alignr}${top cpu 3}%
${goto 105}${color3}${top name 4}${alignr}${top cpu 4}%
${goto 105}${color3}${top name 5}${alignr}${top cpu 5}%${font Share-TechMono:bold:size=40}
#Showing memory part with TOP 5
${goto 85}${font Share-TechMono:bold:size=10}${color5}MEM
${goto 105}${font Share-TechMono:size=10}${color4}${top_mem name 1}${alignr}${top_mem mem 1}%
${goto 105}${color1}${top_mem name 2}${alignr}${top_mem mem 2}%
${goto 105}${color2}${top_mem name 3}${alignr}${top_mem mem 3}%
${goto 105}${color3}${top_mem name 4}${alignr}${top_mem mem 4}%
${goto 105}${color3}${top_mem name 4}${alignr}${top_mem mem 5}%
# Showing disk partitions: root, home and Data
${alignr}${diskiograph 86,175 666666 666666}
${voffset -20}${font Share-TechMono:bold:size=10}${goto 85}${color5}DISKS${color1}
${goto 113}${font Share-TechMono:size=8.5}Free:  ${fs_free /}\
${alignr}Used:   ${fs_used /}
${goto 113}Free:  ${fs_free /home}\
${alignr}Used:   ${fs_used /home}
${goto 113}Free:  ${fs_free /media/5}\
${alignr}Used:   ${fs_used /media/5}${font Share-TechMono:bold:size=40}
# Network data (my desktop have only LAN). ETHERNET ring is mostly useless but looks pretty, main info is in the graphs
${alignr}${upspeedgraph eth0 86,285 4B1B0C 00BFFF 100 -l}${voffset -20}${font Share-TechMono:size=8.5}
${goto 115}$color2${upspeed eth0}${goto 200}/ ${totalup}
${goto 115}$color2${downspeed eth0}${goto 200}/ ${totaldown}
${alignr}${downspeedgraph eth0 40,285 324D23 77B753 100 -l}
${voffset -110}${goto 90}${font Share-TechMono:bold:size=10}${color5}NET${voffset 90}
${color4}${hr 2}

and seamod_rings.lua

--==============================================================================
--                            seamod_rings.lua
--
--  Date    : 05/02/2012
--  Author  : SeaJey
--  Version : v0.1
--  License : Distributed under the terms of GNU GPL version 2 or later
--
--  This version is a modification of lunatico_rings.lua wich is modification of conky_orange.lua
--
--  conky_orange.lua:    http://gnome-look.org/content/show.php?content=137503&forumpage=0
--  lunatico_rings.lua:  http://gnome-look.org/content/show.php?content=142884
--==============================================================================

require 'cairo'


--------------------------------------------------------------------------------
--                                                                    gauge DATA
gauge = {
{
    name='cpu',                    arg='cpu0',                  max_value=100,
    x=70,                          y=130,
    graph_radius=54,
    graph_thickness=5,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
    hand_fg_colour=0x00BFFF,       hand_fg_alpha=1.0,
    txt_radius=64,
    txt_weight=0,                  txt_size=9.0,
    txt_fg_colour=0x00BFFF,        txt_fg_alpha=1.0,
    graduation_radius=28,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=9.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='cpu',                    arg='cpu1',                  max_value=100,
    x=70,                          y=130,
    graph_radius=48,
    graph_thickness=5,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
    hand_fg_colour=0x00BFFF,       hand_fg_alpha=1.0,
    txt_radius=40,
    txt_weight=0,                  txt_size=9.0,
    txt_fg_colour=0x00BFFF,        txt_fg_alpha=1.0,
    graduation_radius=28,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=9.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='cpu',                    arg='cpu2',                  max_value=100,
    x=70,                          y=130,
    graph_radius=20,
    graph_thickness=5,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
    hand_fg_colour=0x00BFFF,       hand_fg_alpha=1.0,
    txt_radius=30,
    txt_weight=0,                  txt_size=9.0,
    txt_fg_colour=0x00BFFF,        txt_fg_alpha=1.0,
    graduation_radius=28,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=9.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='cpu',                    arg='cpu3',                  max_value=100,
    x=70,                          y=130,
    graph_radius=14,
    graph_thickness=5,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
    hand_fg_colour=0x00BFFF,       hand_fg_alpha=1.0,
    txt_radius=4,
    txt_weight=0,                  txt_size=9.0,
    txt_fg_colour=0x00BFFF,        txt_fg_alpha=1.0,
    graduation_radius=28,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=9.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='memperc',                arg='',                      max_value=100,
    x=70,                          y=300,
    graph_radius=54,
    graph_thickness=10,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
    hand_fg_colour=0x00BFFF,       hand_fg_alpha=1.0,
    txt_radius=42,
    txt_weight=0,                  txt_size=9.0,
    txt_fg_colour=0x00BFFF,        txt_fg_alpha=1.0,
    graduation_radius=23,
    graduation_thickness=0,        graduation_mark_thickness=2,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.5,
    caption='',
    caption_weight=1,              caption_size=10.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='fs_used_perc',           arg='/media/5',                     max_value=100,
    x=70,                          y=470,
    graph_radius=54,
    graph_thickness=7,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
    hand_fg_colour=0x00BFFF,       hand_fg_alpha=1.0,
    txt_radius=64,
    txt_weight=0,                  txt_size=9.0,
    txt_fg_colour=0x00BFFF,        txt_fg_alpha=1.0,
    graduation_radius=23,
    graduation_thickness=0,        graduation_mark_thickness=2,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    caption='M/5',
    caption_weight=1,              caption_size=12.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.5,
},
{
    name='fs_used_perc',           arg='/home/',                     max_value=100,
    x=70,                          y=470,
    graph_radius=42,
    graph_thickness=7,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
    hand_fg_colour=0x00BFFF,       hand_fg_alpha=1.0,
    txt_radius=32,
    txt_weight=0,                  txt_size=9.0,
    txt_fg_colour=0x00BFFF,        txt_fg_alpha=1.0,
    graduation_radius=23,
    graduation_thickness=0,        graduation_mark_thickness=2,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    caption='Home',
    caption_weight=1,              caption_size=12.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.5,
},
{
    name='fs_used_perc',           arg='/',                     max_value=100,
    x=70,                          y=470,
    graph_radius=30,
    graph_thickness=7,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
    hand_fg_colour=0x00BFFF,       hand_fg_alpha=1.0,
    txt_radius=22,
    txt_weight=0,                  txt_size=9.0,
    txt_fg_colour=0x00BFFF,        txt_fg_alpha=1.0,
    graduation_radius=23,
    graduation_thickness=0,        graduation_mark_thickness=2,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    caption='Root',
    caption_weight=1,              caption_size=12.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.5,
},
{
    name='downspeedf',           arg='eth0',                     max_value=100,
    x=70,                          y=660,
    graph_radius=54,
    graph_thickness=7,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
    hand_fg_colour=0x00BFFF,       hand_fg_alpha=0,
    txt_radius=64,
    txt_weight=0,                  txt_size=9.0,
    txt_fg_colour=0x00BFFF,        txt_fg_alpha=1.0,
    graduation_radius=28,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    caption='Down',
    caption_weight=1,              caption_size=12.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.5,
},
{
    name='upspeedf',           arg='eth0',                     max_value=100,
    x=70,                          y=660,
    graph_radius=42,
    graph_thickness=7,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
    hand_fg_colour=0x00BFFF,       hand_fg_alpha=0,
    txt_radius=30,
    txt_weight=0,                  txt_size=9.0,
    txt_fg_colour=0x00BFFF,        txt_fg_alpha=1.0,
    graduation_radius=28,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    caption='Up',
    caption_weight=1,              caption_size=12.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.5,
},
}

-------------------------------------------------------------------------------
--                                                                 rgb_to_r_g_b
-- converts color in hexa to decimal
--
function rgb_to_r_g_b(colour, alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

-------------------------------------------------------------------------------
--                                                            angle_to_position
-- convert degree to rad and rotate (0 degree is top/north)
--
function angle_to_position(start_angle, current_angle)
    local pos = current_angle + start_angle
    return ( ( pos * (2 * math.pi / 360) ) - (math.pi / 2) )
end


-------------------------------------------------------------------------------
--                                                              draw_gauge_ring
-- displays gauges
--
function draw_gauge_ring(display, data, value)
    local max_value = data['max_value']
    local x, y = data['x'], data['y']
    local graph_radius = data['graph_radius']
    local graph_thickness, graph_unit_thickness = data['graph_thickness'], data['graph_unit_thickness']
    local graph_start_angle = data['graph_start_angle']
    local graph_unit_angle = data['graph_unit_angle']
    local graph_bg_colour, graph_bg_alpha = data['graph_bg_colour'], data['graph_bg_alpha']
    local graph_fg_colour, graph_fg_alpha = data['graph_fg_colour'], data['graph_fg_alpha']
    local hand_fg_colour, hand_fg_alpha = data['hand_fg_colour'], data['hand_fg_alpha']
    local graph_end_angle = (max_value * graph_unit_angle) % 360

    -- background ring
    cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, 0), angle_to_position(graph_start_angle, graph_end_angle))
    cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha))
    cairo_set_line_width(display, graph_thickness)
    cairo_stroke(display)

    -- arc of value
    local val = value % (max_value + 1)
    local start_arc = 0
    local stop_arc = 0
    local i = 1
    while i <= val do
        start_arc = (graph_unit_angle * i) - graph_unit_thickness
        stop_arc = (graph_unit_angle * i)
        cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
        cairo_set_source_rgba(display, rgb_to_r_g_b(graph_fg_colour, graph_fg_alpha))
        cairo_stroke(display)
        i = i + 1
    end
    local angle = start_arc

    -- hand
    start_arc = (graph_unit_angle * val) - (graph_unit_thickness * 2)
    stop_arc = (graph_unit_angle * val)
    cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
    cairo_set_source_rgba(display, rgb_to_r_g_b(hand_fg_colour, hand_fg_alpha))
    cairo_stroke(display)

    -- graduations marks
    local graduation_radius = data['graduation_radius']
    local graduation_thickness, graduation_mark_thickness = data['graduation_thickness'], data['graduation_mark_thickness']
    local graduation_unit_angle = data['graduation_unit_angle']
    local graduation_fg_colour, graduation_fg_alpha = data['graduation_fg_colour'], data['graduation_fg_alpha']
    if graduation_radius > 0 and graduation_thickness > 0 and graduation_unit_angle > 0 then
        local nb_graduation = graph_end_angle / graduation_unit_angle
        local i = 0
        while i < nb_graduation do
            cairo_set_line_width(display, graduation_thickness)
            start_arc = (graduation_unit_angle * i) - (graduation_mark_thickness / 2)
            stop_arc = (graduation_unit_angle * i) + (graduation_mark_thickness / 2)
            cairo_arc(display, x, y, graduation_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
            cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_colour,graduation_fg_alpha))
            cairo_stroke(display)
            cairo_set_line_width(display, graph_thickness)
            i = i + 1
        end
    end

    -- text
    local txt_radius = data['txt_radius']
    local txt_weight, txt_size = data['txt_weight'], data['txt_size']
    local txt_fg_colour, txt_fg_alpha = data['txt_fg_colour'], data['txt_fg_alpha']
    local movex = txt_radius * math.cos(angle_to_position(graph_start_angle, angle))
    local movey = txt_radius * math.sin(angle_to_position(graph_start_angle, angle))
    cairo_select_font_face (display, "Share-TechMono", CAIRO_FONT_SLANT_NORMAL, txt_weight)
    cairo_set_font_size (display, txt_size)
    cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha))
    cairo_move_to (display, x + movex - (txt_size / 2), y + movey + 3)
    cairo_show_text (display, value)
    cairo_stroke (display)

    -- caption
    local caption = data['caption']
    local caption_weight, caption_size = data['caption_weight'], data['caption_size']
    local caption_fg_colour, caption_fg_alpha = data['caption_fg_colour'], data['caption_fg_alpha']
    local tox = graph_radius * (math.cos((graph_start_angle * 2 * math.pi / 360)-(math.pi/2)))
    local toy = graph_radius * (math.sin((graph_start_angle * 2 * math.pi / 360)-(math.pi/2)))
    cairo_select_font_face (display, "Share-TechMono", CAIRO_FONT_SLANT_NORMAL, caption_weight);
    cairo_set_font_size (display, caption_size)
    cairo_set_source_rgba (display, rgb_to_r_g_b(caption_fg_colour, caption_fg_alpha))
    cairo_move_to (display, x + tox + 5, y + toy + 1)
    -- bad hack but not enough time !
    if graph_start_angle < 105 then
        cairo_move_to (display, x + tox - 30, y + toy + 1)
    end
    cairo_show_text (display, caption)
    cairo_stroke (display)
end


-------------------------------------------------------------------------------
--                                                               go_gauge_rings
-- loads data and displays gauges
--
function go_gauge_rings(display)
    local function load_gauge_rings(display, data)
        local str, value = '', 0
        str = string.format('${%s %s}',data['name'], data['arg'])
        str = conky_parse(str)
        value = tonumber(str)
        draw_gauge_ring(display, data, value)
    end

    for i in pairs(gauge) do
        load_gauge_rings(display, gauge[i])
    end
end

-------------------------------------------------------------------------------
--                                                                         MAIN
function conky_main()
    if conky_window == nil then
        return
    end

    local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    local display = cairo_create(cs)

    local updates = conky_parse('${updates}')
    update_num = tonumber(updates)

    if update_num > 5 then
        go_gauge_rings(display)
    end

    cairo_surface_destroy(cs)
    cairo_destroy(display)

end

·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#7358 2014-04-12 01:05:10

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: Conky v1.9 Thread

^ and off it goes, getting the top spot in the conky archive smile

Offline

#7359 2014-04-12 01:15:41

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

mrpeachy wrote:

^ and off it goes, getting the top spot in the conky archive smile

But only until someone else post one  ...


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#7360 2014-04-12 20:19:04

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: Conky v1.9 Thread

here is an idea in its infancy
the build it yourself conky - gui conky builder big_smile
[video]http://youtu.be/xuvCZP8C1dw[/video]

im entering which conky objects i want shown and their coordinates and up they go  big_smile

im thinking of having a button "Add Object"
you click it, a new dialog comes up and you enter the next thing you want to see

just an experiment for now, will see if it goes anywhere!

Last edited by mrpeachy (2014-04-12 21:10:36)

Offline

#7361 2014-04-12 20:47:06

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

mrpeachy wrote:

here is an idea in its infancy
the build it yourself conky

Not sure what you mean - build it yourself.

I've been "building conkies" for years.  smile


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#7362 2014-04-12 21:12:17

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: Conky v1.9 Thread

Sector11 wrote:
mrpeachy wrote:

here is an idea in its infancy
the build it yourself conky

Not sure what you mean - build it yourself.

I've been "building conkies" for years.  smile

fine  tongue  , build it yourself wasnt a very good name
how about gui conky builder?  big_smile

i was just thinking that this might be an easier way to build a wun weather template
build it piece by piece using text entry boxes instead of editing a template lua file

Offline

#7363 2014-04-12 21:45:24

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

mrpeachy wrote:

fine  tongue  , build it yourself wasnt a very good name
how about gui conky builder?  big_smile

i was just thinking that this might be an easier way to build a wun weather template
build it piece by piece using text entry boxes instead of editing a template lua file

There's a few of those out there - gui conky builder.

However, "mrpeachy's GUI Conky WUN LUA Builder" sounds A*W*E*S*O*M*E - just the thing →" I "← need!

Last edited by Sector11 (2014-04-12 21:46:47)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#7364 2014-04-13 02:44:21

#!_828
#! Tinfoil Hat
From: Ohio, U. S. of A.
Registered: 2013-09-19
Posts: 1,244

Re: Conky v1.9 Thread

mrpeachy wrote:

how about gui conky builder?  big_smile

i was just thinking that this might be an easier way to build a wun weather template
build it piece by piece using text entry boxes instead of editing a template lua file

I've looked into some of the gui builders out there. Most of them are crap, with limited features (no way in hell could they make the script for the Emergency Tinfoil Hat Conky Alert System) & wound up being so confusing & ass-backwards that I had an easier time just biting the bullet & using the text files


Those who would trade essential liberty for temporary security deserve neither
Member of the (Un)Official #! Emergency Tinfoil Hat Distribution Center
Emergency Tinfoil Hat Conky Alert System development team

Offline

#7365 2014-04-13 04:56:48

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: Conky v1.9 Thread

^i'll do my best to avoid any ass-backary O:)

but, i think gui wun setup could be a reality
im feeling quite pleased with myself  ]:D

i can setup a display entirely through popup boxes, i can edit each item via popups, i can save the display to text files and then I can load the display from the text files
and i just solved a problem where i couldnt edit items after loading  big_smile

[video]http://youtu.be/konHawD18ls[/video]

Last edited by mrpeachy (2014-04-13 04:59:28)

Offline

#7366 2014-04-13 05:12:52

#!_828
#! Tinfoil Hat
From: Ohio, U. S. of A.
Registered: 2013-09-19
Posts: 1,244

Re: Conky v1.9 Thread

mrpeachy wrote:

^i'll do my best to avoid any ass-backary O:)
{snip}
I can setup a display entirely through popup boxes, I can edit each item via popups, I can save the display to text files and then I can load the display from the text files

On behalf of everyone, thank you. I see more than enough ass in my neighborhood whenever I go out on the street, or look out my window during the day.

Also, do the great & powerful Baba-Peachy's popups involve getting love back? Or black magic mantras? Or metaphysical astrology consultation? With a free gift of a virus from your friendly neighborhood psychic master Baba-Peachy?  ]:D


Those who would trade essential liberty for temporary security deserve neither
Member of the (Un)Official #! Emergency Tinfoil Hat Distribution Center
Emergency Tinfoil Hat Conky Alert System development team

Offline

#7367 2014-04-13 14:02:11

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

mrpeachy wrote:

^i'll do my best to avoid any ass-backary O:) AND THE SCRIPT:

but, i think gui wun setup could be a reality
im feeling quite pleased with myself  ]:D

I have to agree with #!_828, I've looked at a few GUI conky builders and ... you have two options, use the conkys that come with it or you're SOL.  And even then - they don't take into consideration: composite manages in use, desk tops in use, window manages in use and a whole bunch of other variables.

bass-ackwards is not an option, it's a built in fault! lol lol lol

mrpeachy wrote:

i can setup a display entirely through popup boxes, i can edit each item via popups, i can save the display to text files and then I can load the display from the text files
and i just solved a problem where i couldnt edit items after loading  big_smile

OH MY!!!  I like the looks of it.

Will it have the ability to create a "header" commented out section?
I can see a menu system:

Header Section
- - - Comment box opens with Name: Date created: By: Main Function: Path: etc etc
Comment Section
- - - that opens a text box.  Everything in there will be inclosed in a --[[   ]] section
Comment Line
- - - that opens a text box.  Everything in there will be after a --

Header Section Opens a box with the following supplied:

Name:
Date created:
By:
Main Function:
Path:

fill in the blanks and in the script we'll see:

--[[ ##########
Name: 30day_test.lua
Date created: 14 Apr 2014
By: Sector11
Usage:
lua_load /media/5/Conky/LUA/30day_test.lua
lua_draw_hook_pre bass_4wards
or
lua_draw_hook_post bass_4wards
########## ]]

Comment Section - opens a box ... keep on typing:

The purpose of this script is to eat all your cookies,
drink all your milk and
put the cat out in the morning if
it is not raining

other than that - 30 day forecast for BsAs

In the script:

--[[ ##########
The purpose of this script is to eat all your cookies,
drink all your milk and
put the cat out in the morning if
it is not raining

other than that - 30 day forecast for BsAs
########## ]]

Comment Line:

DO NOT EDIT THE NEXT THREE LINES

and in the script

-- DO NOT EDIT THE NEXT THREE LINES

Feel free to tell me to take a long walk off a short pier.  ]:D

Last edited by Sector11 (2014-04-13 14:04:03)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#7368 2014-04-13 14:33:32

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

Marenbraga wrote:

i have eth0 (wired) and 3g... 

I'm currently using that code below:

${execp ifconfig | grep -EB4 "RUNNING" | grep "Link encap" | grep -v "lo" | awk '{print "${upspeed " $1 "}"}'}

He is perfect! Small and intuitive. However, it is not meant for connections wifi/3g. I'm testing the code you sent and sector11, but so far none worked for me. The sector11 advised to think whether it's worth installing vnstat, since I'm using CrunchBang on a USB stick.
I am currently trying to get a code that works for connections Wi-Fi/3G. Somehow you imagine?

Kisses

wlanX calls do work in conkys and LUA scripts ... I have a lot of examples here:
2014_04_13_11_11_54_900x1075_Sector11.jpg
so I'm guessing that it has to be something to do with you being on the USB stick.

Try this: wifi.sh

#! /bin/bash
function dload()
{
	if [ $lq -lt 100 ] && [ $lq -gt 50 ]; then
	echo '${image ~/Conky/images/nm-100.png -p 0,60 -s 24x24}'
	fi
	if [ $lq -lt 51 ] && [ $lq -gt 35 ]; then
	echo '${image ~/Conky/images/nm-75.png -p 0,60 -s 24x24}'
	fi
	if [ $lq -lt 36 ] && [ $lq -gt 19 ]; then
	echo '${image ~/Conky/images/nm-50.png -p 0,60 -s 24x24}'
	fi
	if [ $lq -lt 20 ] && [ $lq -gt 5 ]; then
	echo '${image ~/Conky/images/nm-25.png -p 0,60 -s 24x24}'
	fi
   if [ $lq -lt 5 ]; then
   echo '#{image ~/Conky/images/nm-00.png -p 0,60 -s 24x24}'
   fi
 
}
function usage()
{
echo '${image ~/Conky/images/nm-100.png -p 0,60 -s 24x24}'
}
 
lq=$(iwconfig wlan0|grep 'Link Quality='|grep '='|grep --max-count=1 -o '\=\([0-9]\+\)'|grep --max-count=1 -o '\([0-9]\+\)')
 
if [ $lq -lt 5 ]
then
	usage
else
	dload
fi
 
exit 0

The images are small:
nm_00.png nm_25.png nm_50.png nm_75.png nm_100.png

In a conky:

${if_existing /proc/net/route wlan0}${execpi 1 ~/conky/scripts/wifi.sh}${endif}${offset 25}${color1}${wireless_link_qual_perc wlan0}% Connectivity on '${wireless_essid wlan0}' @ ${wireless_bitrate wlan0}

Change ~/conky/scripts/wifi.sh to where you put wifi.sh.  Make sure the script is executable.

Is there any way to test that conky on a Linux system installed on a hard drive?


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#7369 2014-04-13 14:50:00

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: Conky v1.9 Thread

Sector11 wrote:

Will it have the ability to create a "header" commented out section?
I can see a menu system:

Header Section
- - - Comment box opens with Name: Date created: By: Main Function: Path: etc etc
Comment Section
- - - that opens a text box.  Everything in there will be inclosed in a --[[   ]] section
Comment Line
- - - that opens a text box.  Everything in there will be after a --

Header Section Opens a box with the following supplied:

Name:
Date created:
By:
Main Function:
Path:

fill in the blanks and in the script we'll see:

--[[ ##########
Name: 30day_test.lua
Date created: 14 Apr 2014
By: Sector11
Usage:
lua_load /media/5/Conky/LUA/30day_test.lua
lua_draw_hook_pre bass_4wards
or
lua_draw_hook_post bass_4wards
########## ]]

The short answer is no smile
The way I am doing it, no lua file or conky config is being actually "written"
so i'm not generating code as such
each setting/value entered is stored in a table
then the script reads the tables and puts the pieces together to get the output

the contents of the tables are written to text files to save a configuration, then those files are read to load it

Offline

#7370 2014-04-13 16:12:00

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

mrpeachy wrote:

The short answer is no smile

Well, that is certainly better than long walk|short pier lol lol lol lol lol

mrpeachy wrote:

The way I am doing it, no lua file or conky config is being actually "written"
so i'm not generating code as such
each setting/value entered is stored in a table
then the script reads the tables and puts the pieces together to get the output

the contents of the tables are written to text files to save a configuration, then those files are read to load it

Ooooooo ... even better ... tables for some reason caused (me) headaches.
If you need lua noob to break .. errr ... ßeta test it .. I'm the noob! wink

One thing about me, if it can be broken, I'll find out how first!

Last edited by Sector11 (2014-04-13 16:13:32)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#7371 2014-04-13 17:46:14

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

The CrunchBang Linux Binary Clock (Ref: this thread)
2014_04_13_13_02_28_1920x1080_Sector11.jpg«--12:59  04/13/14 || 01:03 04/13/14 --» 2014_04_13_13_03_43_1920x1080_Sector11.jpg
CBLBC.conky

# pkill -xf "conky -c /media/5/Conky/CBLBC.conky" &
# conky -c /media/5/Conky/CBLBC.conky &
## Conky
background yes

# Window
own_window yes
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager ## add sticky

# Graphics
double_buffer yes
use_spacer right
override_utf8_locale yes
use_xft yes
xftfont Zekton:size=9
xftalpha 0
update_interval 1
uppercase no
stippled_borders 0
border_inner_margin 0
border_width 0
default_outline_color black
default_shade_color black
draw_borders no
draw_graph_borders no
draw_outline yes  # amplifies text if yes
draw_shades yes  # shadecolor black

# Colors
default_color DCDCDC #Gainsboro
color0 FFFFF0 #Ivory
color1 FFA07A #LightSalmon
color2 FF8C00 #Darkorange
color3 7FFF00 #Chartreuse
color4 778899 #LightSlateGrey
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 48D1CC #MediumTurquoise
color8 FFFF00 #Yellow
color9 FF0000 #Red

text_buffer_size 2048 # required for dotdatetime script
no_buffers yes
short_units yes
pad_percents 2


# Layout
# Aligned position on screen: tl, tr, tm, bl, br, bm, ml, mr
alignment br
gap_x 10 # l|r
gap_y 10 # u|d

# echo $(date +%y) |cut -c1
# will give you decade
# ---------
# echo $(date +%y) |cut -c2
# will give you year in that decade
### requires two blank lines at the end ###

TEXT
${goto 5}${font Bauhaus:size=14}${color6}CrunchBang${color5}Linux
${alignc}${color5}Binary${color6}Clock${font}
${execpi 600 /media/5/Conky/scripts/dotdatetime.sh}

dotdatetime.sh

#!/bin/bash
############################################################
# This work is licensed under the Creative Commons         #
# Attribution-Share Alike 3.0 Unported License.            #
# To view a copy of this license, visit                    #
# http://creativecommons.org/licenses/by-sa/3.0/           #
# or send a letter to Creative Commons, 171 Second Street, #
# Suite 300, San Francisco, California, 94105, USA.        #
############################################################
cd $(dirname $0)
DATE=$(date +%y%m%d%I%M)
CURRENT="\${color FFDEAD}"
DEFAULT="\${color 778899}"
TEXT="\${color 48D1CC}"
MONTH=${DATE:2:2}
HOUR=${DATE:6:2}
YEAR10C[${DATE:0:1}]="$CURRENT"
YEARC[${DATE:1:1}]="$CURRENT"
MONTHC[${MONTH/#0/}]="$CURRENT"
DAY10C[${DATE:4:1}]="$CURRENT"
DAYC[${DATE:5:1}]="$CURRENT"
HOURC[${HOUR/#0/}]="$CURRENT"
MIN10C[${DATE:8:1}]="$CURRENT"
MINC[${DATE:9:1}]="$CURRENT"
YEAR10R[${DATE:0:1}]="$DEFAULT"
YEARR[${DATE:1:1}]="$DEFAULT"
MONTHR[${MONTH/#0/}]="$DEFAULT"
DAY10R[${DATE:4:1}]="$DEFAULT"
DAYR[${DATE:5:1}]="$DEFAULT"
HOURR[${HOUR/#0/}]="$DEFAULT"
MIN10R[${DATE:8:1}]="$DEFAULT"
MINR[${DATE:9:1}]="$DEFAULT"
echo -n "\${font Bauhaus:size=12}$DEFAULT"
for n in 1 4 7 10; do
    for i in $(seq $n $[n+2]); do
        echo -n "${HOURC[$i]}=${HOURR[$i]} "
    done
echo -n "\${goto 101}"
    for i in $(seq $n $[n+2]); do
        echo -en "${MONTHC[$i]}=${MONTHR[$i]} "
    done
echo
done
echo "$TEXT\${font Bauhaus:bold:size=8}\${goto 10}Hour\${goto 106}Month\${font Bauhaus:size=12}$DEFAULT"
for n in 1 2 3; do
    echo -n "${MIN10C[$n]}=${MIN10R[$n]} "
done
echo -n "\${goto 101}"
for n in 1 2 3; do
    echo -n "${DAY10C[$n]}=${DAY10R[$n]} "
done
echo
for n in 4 5 6; do
    echo -n "${MIN10C[$n]}=${MIN10R[$n]} "
done
echo -e "\n$TEXT\${font Bauhaus:bold:size=8}\${goto 4}Min x10\${goto 102}Day x10\${font Bauhaus:size=12}$DEFAULT"
for n in 1 4 7; do
    for i in $(seq $n $[n+2]); do
        echo -n "${MINC[$i]}=${MINR[$i]} "
    done
echo -n "\${goto 101}"
    for i in $(seq $n $[n+2]); do
        echo -en "${DAYC[$i]}=${DAYR[$i]} "
    done
echo
done
echo "$TEXT\${font Bauhaus:bold:size=8}\${goto 9}Min\${goto 109}Day\${font Bauhaus:size=12}$DEFAULT"
for n in 1 4 7; do
    for i in $(seq $n $[n+2]); do
        echo -n "${YEAR10C[$i]}=${YEAR10R[$i]} "
    done
echo -n "\${goto 101}"
    for i in $(seq $n $[n+2]); do
        echo -en "${YEARC[$i]}=${YEARR[$i]} "
    done
echo
done
echo "$TEXT\${font Bauhaus:bold:size=8}\${goto 2}Year x10\${goto 110}Year$DEFAULT"
exit 0

·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#7372 2014-04-15 12:36:59

Ruuku
New Member
From: Tasmania, Australia
Registered: 2014-04-15
Posts: 9

Re: Conky v1.9 Thread

A rather simple request, but can anybody help me install this cleanly?

http://xexpanderx.deviantart.com/art/3D … 57745&qo=2

It contains two files, none of which has to do with conky.rc. I'm utterly new to it so I clueless

Any help is appreciated, still crunchin and bangin strong!

Offline

#7373 2014-04-15 13:26:01

boisei0
#! CrunchBanger
From: Gaanderen, Netherlands
Registered: 2013-07-16
Posts: 193

Re: Conky v1.9 Thread

Ruuku wrote:

A rather simple request, but can anybody help me install this cleanly?

http://xexpanderx.deviantart.com/art/3D … 57745&qo=2

It contains two files, none of which has to do with conky.rc. I'm utterly new to it so I clueless

Any help is appreciated, still crunchin and bangin strong!

The included start_conky is the conkyrc file, according to the description. The lua_widgets.lua contains supporting code. The Conky can be launched by issuing the command

conky -c start_conky

YAWS (cli weather script with conkyForecast syntax) | Bitbucket | Github | Blog
Member of the Unofficial #! Emergency Tinfoil Hat Distribution Center
Emergency Tinfoil Hat Conky Alert System development team

Offline

#7374 2014-04-15 13:30:47

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

Ruuku wrote:

A rather simple request, but can anybody help me install this cleanly?

http://xexpanderx.deviantart.com/art/3D … 57745&qo=2

It contains two files, none of which has to do with conky.rc. I'm utterly new to it so I clueless

Any help is appreciated, still crunchin and bangin strong!

~/.conkrc is only a 'default' name that starts when you run

conky

in a terminal if it exists.  For that reason most people that run one conky put it there for convenience.  If ~/.conkyrc doesn't exist 'conky' will start the installed default conky: /etc/conky/conky.conf <-- ugly little thing that.

You can run multiple conkys or a conky by a different name.  In the archive you pointed to there are two files, so if you extract them to ~/conky

  • ~/conky/start_conky <-- is the conky file

  • ~/conky/lua_widgets.lua <-- lua script to draw rings and boxes etc

You can start the conky, using:

conky -c ~/conky/start_conky

However ... it's not that simple.

Looking at the LUA script.  You will need to make changes and you will require a couple of helper apps.

sudo apt-get install lm-sensors hddtemp

Check this out: Using sensors

and to reconfigure hddtemp

sudo dpkg-reconfigure hddtemp

Answers: No, 0, Yes, OK, OK

Now use in it in conky or a LUA file:

${hddtemp /dev/sda}°

Once you've installed them and run sensors-detect, as seen in the link ... come back and post, in a code box, the results of

sensors

so we know what and where your temps are ...

graphics card - Intel or Nvidia?

OOPS! .. boisei0 beat me by 4 minutes ... I'm a slow typist.  big_smile

Last edited by Sector11 (2014-04-15 13:36:38)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

Help fund CrunchBang, donate to the project!

#7375 2014-04-15 14:30:58

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

For what it's worth, I can't get the lua script in the archive Ruuku is talking about to work at all.

I made some changes ... in the temp section - I don't have a quad core Intel - with 8 cpu's (see line 3)

I have an AMD X3 - the division part is a killer.

lua_widgets.lua

-- 2014-02-17 by xeXpanderx

require 'cairo'

------------------------- CONFIGURATION  ----------------------------------

------------------------- Transparency, from 0 to 1 -------------------------
transp = 0.5
------------------------- CPU config -------------------------
cpu_x_step = 10
cpu_y_step = 8
grades = 8
number_of_cpus = 4 -- original 8 ## see line 200 original '${cpu cpu1}' changed to cpu0
cpu_x_start = 60
cpu_y_start = 60
cpu_widget_x_start = 15
cpu_widget_y_start = 0
cpu_widget_width = 190
cpu_widget_height = 285
------------------------- Free space -------------------------
free_space_widget_x_start = 15
free_space_widget_y_start = 330
free_space_widget_width = 190
free_space_widget_height = 240
free_space_x_start = 120
free_space_y_start = 430
free_space_radius = 50
------------------------- Temperatures -------------------------
temperatures_widget_x_start = 15
temperatures_widget_y_start = 615
temperatures_widget_width = 190
temperatures_widget_height = 265
temperatures_x_start = 120
temperatures_y_start = 620


------------------------- Heavy code --------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------
--                                                                 rgb_to_r_g_b
-- converts color in hexa to decimal
--
function rgb_to_r_g_b(colour, alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
--------------------------------------------------------------------------------------------------------------------------

keep_y = 0

function horizontal_bar (cr, start_x,start_y, conky_value)
	cairo_set_operator(cr,CAIRO_OPERATOR_SOURCE)
	cairo_set_line_width (cr, 1);

	local percent_per_block = 100.0 / 20.0
	local step= 0
	local number_of_charged_blocks = math.floor((conky_value/percent_per_block)+0.5)

	cairo_stroke(cr)
	for i=1,20 do
	  cairo_rectangle (cr, start_x+step, start_y, 5, 20);
	  cairo_close_path(cr)
	  if i <= number_of_charged_blocks then
	    cairo_set_source_rgba(cr, 0,0,0,transp)
	    cairo_fill(cr)
	  else
	    cairo_set_source_rgba(cr, 0,0,0,transp-0.3)
	    cairo_fill(cr)
	  end
	  step = step + 8
	end
	cairo_set_source_rgba(cr, 0,0,0,transp)
end

function draw_circles(cr, x_start,y_start,radius, angle_1, angle_2, free_perc, angle_step)
	 cairo_select_font_face (cr, "Dejavu Sans Condensed", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
	 local number_of_circles = 360 / angle_step
	 local angle_start = 90
	 cairo_set_line_width(cr, 1)
	 local percent_per_circle = 100.0 / number_of_circles
	 local number_of_nonfree_circles = math.floor(((100.0 - tonumber(free_perc)) / percent_per_circle)+0.5)
	 cairo_set_source_rgba(cr, 0,0,0,transp)

	for i=1,number_of_circles do
	  cairo_arc(cr,x_start+(radius*math.cos(angle_start*(math.pi/180.0))),y_start-(radius+5)+radius-(radius*math.sin(angle_start*(math.pi/180.0))),4,angle1,angle2)
	  if i <= number_of_nonfree_circles then
	    cairo_set_source_rgba(cr, 0,0,0,transp)
	    cairo_fill(cr)
	  else
	    cairo_set_source_rgba(cr, 0,0,0,transp-0.3)
	    cairo_fill(cr)
	  end
	  angle_start = angle_start - angle_step
	end
	cairo_set_source_rgba(cr, 0,0,0,transp)

end

function draw_widget(cr, x,y, str_conky, font_size, height, width)
	cairo_select_font_face (cr, "Dejavu Sans Condensed", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
  	cairo_set_line_width (cr, 3);
	cairo_set_operator(cr,CAIRO_OPERATOR_SOURCE)
	cairo_set_source_rgba(cr, 0,0,0,transp-0.3)
	cairo_move_to (cr, x+10, y+27)
	cairo_arc(cr,x+10,y+27,5,0,2*math.pi)
	cairo_move_to (cr, x+10, y+27)
	cairo_rel_line_to (cr, width, 0)
	cairo_rel_line_to (cr, 8, 8)
	cairo_rel_line_to (cr, 0, height)
	cairo_rel_line_to (cr, -8, 8)
	cairo_rel_line_to (cr, -width, 0)
	cairo_stroke (cr);
	cairo_close_path(cr)
	cairo_arc(cr,x+10,y+height+16+27,5,0,2*math.pi)
	cairo_stroke(cr)

	cairo_move_to (cr, x+15, y+22)
	cairo_set_source_rgba(cr, 0,0,0,transp)
	cairo_set_font_size (cr, font_size);
	cairo_show_text (cr, str_conky)
	cairo_set_source_rgba(cr, 0,0,0,transp)
end

function draw_vertical_bars_3d(cr, x_start,y_start,x_step,y_step,grades, current_value)
	cairo_select_font_face (cr, "Dejavu Sans Condensed", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
	cairo_set_operator(cr,CAIRO_OPERATOR_SOURCE)
	cairo_set_source_rgba(cr, 0,0,0,transp)
	cairo_move_to(cr,x_start,y_start)
	cairo_rel_line_to(cr,-x_step,-y_step)
	cairo_rel_line_to(cr,x_step-x_step,y_step)
	cairo_rel_line_to(cr, x_step,y_step)
	cairo_rel_line_to(cr, x_step-x_step,-y_step)
	cairo_rel_line_to(cr, x_step,-y_step)
	cairo_rel_line_to(cr, x_step-x_step,y_step)
	cairo_rel_line_to(cr, -x_step,y_step)
	cairo_close_path(cr)

	if math.floor((current_value/(100.0/grades))+0.5) < grades then
	  cairo_stroke(cr)
	else
	  cairo_fill(cr)
	end

	cairo_move_to(cr, x_start+x_step,y_start-y_step)
	cairo_rel_line_to(cr, -x_step, -y_step)
	cairo_rel_line_to(cr, -x_step, y_step)
	cairo_stroke(cr)

	for i=1,(grades-1) do
	  cairo_move_to(cr, x_start+x_step,y_start+y_step*1.5*(i-1))
	  cairo_rel_line_to(cr, -x_step*0.25,y_step*0.25)
	  cairo_rel_line_to(cr, x_step*0.25,y_step*0.25)
	  cairo_stroke(cr)
	  cairo_move_to(cr, x_start-x_step*0.75,y_start+y_step*0.25+y_step*1.5*(i-1))
	  cairo_rel_line_to(cr, -x_step*0.25,y_step*0.25)
	  cairo_stroke(cr)
	  cairo_move_to(cr, x_start, y_start+y_step*1.5*i)
	  keep_y = (y_start+y_step*1.5*i+y_step) - y_start
	  cairo_rel_line_to(cr, -x_step, -y_step)
	  cairo_rel_line_to(cr, x_step-x_step, y_step)
	  cairo_rel_line_to(cr,x_step,y_step)
	  cairo_rel_line_to(cr,x_step,-y_step)
	  cairo_rel_line_to(cr,x_step-x_step,-y_step)
	  cairo_rel_line_to(cr,-x_step,y_step)
	  cairo_rel_line_to(cr,x_step-x_step,y_step)
	  cairo_close_path(cr)
	  if math.floor((current_value/(100.0/grades))+0.5) >= (grades-i) then
	    cairo_fill(cr)
	  else
	    cairo_stroke(cr)
	  end

	end
end

function draw_function(cr)
  local w,h=conky_window.width,conky_window.height
  cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND)
  cairo_set_line_width(cr, 1)
  cairo_set_source_rgba(cr, 0,0,0,transp)
  cairo_select_font_face (cr, "Dejavu Sans Condensed", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);


--- CPU section ---
  cairo_close_path(cr)
  cairo_set_font_size (cr, 10);

  counter = 1
  if number_of_cpus > 1 and number_of_cpus % 2 == 0 then
    if (number_of_cpus / 2) <= 4 then
      for j=1, 2 do
	for i=1, (number_of_cpus/2) do
	  str = '${cpu cpu' .. tostring(counter) .. '}'
	  draw_vertical_bars_3d(cr, cpu_x_start+cpu_x_step*4*(i-1),cpu_y_start+(keep_y+50)*(j-1),cpu_x_step,cpu_y_step,grades, tonumber(conky_parse(str)))
	  cairo_move_to(cr, cpu_x_start+cpu_x_step*4*(i-1)-3, cpu_y_start+(keep_y+50)*(j-1)+(keep_y+15))
	  cairo_show_text(cr, conky_parse(str) .. "%")
	  counter = counter+1
	end
      end
    end
  else
    draw_CPU(cr, cpu_x_start,cpu_y_start,cpu_x_step,cpu_y_step,grades, tonumber(conky_parse('${cpu cpu0}')))
  end

  draw_widget(cr, cpu_widget_x_start,cpu_widget_y_start, "CPU", 16, cpu_widget_height, cpu_widget_width)

--- Free space section ---
  draw_widget(cr, free_space_widget_x_start,free_space_widget_y_start, "Free space", 16, free_space_widget_height, free_space_widget_width)
  angle1 = 0.0  * (math.pi/180.0);
  angle2 = 360.0 * (math.pi/180.0);
  free_hd1 = conky_parse("${fs_free_perc /}")
  free_hd2 = conky_parse("${fs_free_perc /home}")

  draw_circles(cr, free_space_x_start,free_space_y_start,free_space_radius, angle_1, angle_2, free_hd1, 10)
  draw_circles(cr, free_space_x_start,free_space_y_start+120,free_space_radius, angle_1, angle_2, free_hd2, 10)
  cairo_set_source_rgba(cr, 0,0,0,transp)
  cairo_move_to (cr, free_space_x_start-20, free_space_y_start);
  cairo_show_text(cr, "R: " .. free_hd1 .. "%")
  cairo_move_to (cr,free_space_x_start-20, free_space_y_start+120);
  cairo_show_text(cr, "H: " .. free_hd2 .. "%")



--- Temperatures ---
  cairo_set_operator(cr,CAIRO_OPERATOR_OVER)
  draw_widget(cr, temperatures_widget_x_start,temperatures_widget_y_start, "Temperatures", 16, temperatures_widget_height, temperatures_widget_width)
  cairo_select_font_face (cr, "Dejavu Sans Condensed", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
  cairo_set_font_size (cr, 10);
  tmp = conky_parse("${platform f71882fg.2560 temp 1")
  horizontal_bar (cr, temperatures_x_start-75,temperatures_y_start+60, tonumber(tmp))
  cairo_close_path(cr)
  cairo_move_to(cr, temperatures_x_start-10, temperatures_y_start+50)
  --cairo_show_text(cr, "CPU 0: " .. tmp .. "\194\176C")
  cairo_show_text(cr, "CPU")

  tmp = conky_parse("${platform f71882fg.2560 temp 2}")
  horizontal_bar (cr, temperatures_x_start-75,temperatures_y_start+110, tmp)
  cairo_move_to(cr, temperatures_x_start-10, temperatures_y_start+100)
  cairo_show_text(cr, "M/B")

  tmp = conky_parse("${hddtemp /dev/sda}")
  horizontal_bar (cr, temperatures_x_start-75,temperatures_y_start+160, tmp)
  cairo_move_to(cr, temperatures_x_start-10, temperatures_y_start+150)
  cairo_show_text(cr, "HDD")

  tmp = conky_parse("${nvidia temp}")
  horizontal_bar (cr, temperatures_x_start-75,temperatures_y_start+210, tmp)
  cairo_move_to(cr, temperatures_x_start-10, temperatures_y_start+200)
  cairo_show_text(cr, "GPU")


--[[  tmp = conky_parse("${exec nvidia-smi | grep 'GeForce' -A 1 | tail -n 1 | awk '{print $3}' | cut -b1,2}")
  horizontal_bar (cr, temperatures_x_start-75,temperatures_y_start+260, tmp)
  cairo_move_to(cr, temperatures_x_start-25, temperatures_y_start+250)
  cairo_show_text(cr, "Nvidia GPU") ]]
end

function conky_start_widgets()
	local function draw_conky_function(cr)
		local str=''
		local value=0
		draw_function(cr)
	end

	-- Check that Conky has been running for at least 5s

	if conky_window==nil then return end
	local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height)

	local cr=cairo_create(cs)

	local updates=conky_parse('${updates}')
	update_num=tonumber(updates)

	if update_num>5 then
		draw_conky_function(cr)
	end
	cairo_surface_destroy(cs)
	cairo_destroy(cr)
end
Conky: desktop window (265) is root window
Conky: window type - normal
Conky: drawing to created window (0x3000002)
Conky: drawing to double buffer
conky pkill -xf "conky -c /media/5/conky/Ruuku/start_conky"  Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:136: attempt to perform arithmetic on local 'current_value' (a nil value)
Conky: llua_do_call: function conky_start_widgets execution failed: /media/5/conky/Ruuku/lua_widgets.lua:136: attempt to perform arithmetic on local 'current_value' (a nil value)

line 136 to 140:

	if math.floor((current_value/(100.0/grades))+0.5) < grades then
	  cairo_stroke(cr)
	else
	  cairo_fill(cr)
	end

In the config area:

number_of_cpus = 4 -- original 8 ## see line 200 original '${cpu cpu1}' changed to cpu0 for this.

I also tried

number_of_cpus = 2 -- original 8 ## see line 200 original '${cpu cpu1}'

·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo