SEARCH

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

You are not logged in.

#5226 2013-05-01 15:18:12

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

Re: Conky v1.9 Thread

can anyone please test the new version of the function (custom v9000): http://crunchbang.org/forums/viewtopic. … 05#p296605

you can call the function like this:

system({variable="upspeedf",device="wlan0",del=',',se="yes"})

it's working good for device 'wlan0'. it should work for all other devices (for example eth0)!

please help me and give me some feedback smile

regards, alex

Offline

Help fund CrunchBang, donate to the project!

#5227 2013-05-01 19:47:56

ragamatrix
#! Junkie
From: Earth
Registered: 2012-12-05
Posts: 286

Re: Conky v1.9 Thread

@mr peachy
The idea and the "firsts" steps :
I'll post the entire sript if someone is interested and when I'll finished it...
thermoses

Last edited by ragamatrix (2013-05-01 19:51:26)

Offline

#5228 2013-05-02 04:10:26

jbolted
New Member
Registered: 2013-04-29
Posts: 3

Re: Conky v1.9 Thread

Does anyone have an answer on my temperature question?

ragamatrix ~ That looks like one awsome script. That would be very generous of you to share!

Last edited by jbolted (2013-05-02 04:12:36)


Gigabyte EP45-UD3P Rev 1.6 FE BIOS
Intel Q8400 2.66GHz, GSkill DDr2 800MHz
NVidia GPU GTX650 1 Gib Ram
Linux Mint Maya

Offline

#5229 2013-05-02 04:31:10

jbolted
New Member
Registered: 2013-04-29
Posts: 3

Re: Conky v1.9 Thread

#5206 2013-04-29 13:21:06

PackRat ~ My apologies I didn't realize my question went 200 pages. Wow I thank you so much! I finally got the core temps! Thank You so very much!

I'm a knuckle head! I didn't realize my question was moved to the monster thread of conky questions!  yikes  Man do I look stupid!
I can stay on this thread all day if I could there is some awsome scripts here!!!
Here is what I got, I have to clean it up some but it's getting there:conkyfilecoretemps.png

Last edited by jbolted (2013-05-02 04:37:48)


Gigabyte EP45-UD3P Rev 1.6 FE BIOS
Intel Q8400 2.66GHz, GSkill DDr2 800MHz
NVidia GPU GTX650 1 Gib Ram
Linux Mint Maya

Offline

#5230 2013-05-02 09:27:37

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

Re: Conky v1.9 Thread

i only want to display the actual times for sunset and sunrise of this weatherstation:
http://www.wunderground.com/q/zmw:96781.3.99999?MR=1

is it possible to run this if i'm already using v9000?

Offline

#5231 2013-05-02 12:45:24

ragamatrix
#! Junkie
From: Earth
Registered: 2012-12-05
Posts: 286

Re: Conky v1.9 Thread

I'm adding the arrows font in thermo...
The work is not still ending... Its takes time...
thermoses&arrows

Offline

#5232 2013-05-02 18:45:34

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

Re: Conky v1.9 Thread

lionhead wrote:

i only want to display the actual times for sunset and sunrise of this weatherstation:
http://www.wunderground.com/q/zmw:96781.3.99999?MR=1

is it possible to run this if i'm already using v9000?

so you have v9000 gathering data for one particular location and you want only the sunset/sunrise for a different location?
...for such a specific need, I would write a specific script
i have an entry in my lua how to about getting info from websites


@ragamatrix - nice work, looking good!

Offline

#5233 2013-05-02 18:53:13

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

Re: Conky v1.9 Thread

i display a webcam from a specific location (observatory mauna kea, hawaii).  because at the time of sunset/sunrise you can see the flypast (overflight) of the iss. i only want to have this two datas as reminder wink

this is my current desktop: http://ompldr.org/vaWFrcQ

there is already a weatherscript that get datas from wunderground.com

i think that i will modify this. it should be easier to modify things that already exist then build a new one smile

@mrpeachy

can i use the function get_color (from the thermometer script) within other functions? my bars would look better with this!

Last edited by lionhead (2013-05-02 19:14:21)

Offline

#5234 2013-05-02 19:21:24

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

Re: Conky v1.9 Thread

lionhead wrote:

@mrpeachy

can i use the function get_color (from the thermometer script) within other functions? my bars would look better with this!

it would be relatively easy to fit that script into other scripts and give them the color change ability
but the process would vary script to script

the get_color script itself could be modified to output a hex color instead of a lua formatted rgba table which might make it easier to integrate into the setup portion of a script

maybe next week i'll have some time smile

Offline

#5235 2013-05-02 19:44:53

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

Re: Conky v1.9 Thread

i want to include the get_color-function within the function that draws bars (an older function made by mrpeachy).

it would be cool to make this function more modern (just a proposal). this would look very cool. such a function within a cpu-bar and everybody will be impressed wink

this within v9000 and you will have a collection of functions with conky-support (see my addons)!!!!

function draw_bar(db) -- improved bars by mrpeachy (2010)

local var=nil
local dev=nil
local width=nil
local height=nil
local across=nil
local down=nil
local bgc=nil
local bga=nil
local inc=nil
local ina=nil
local lc=nil
local la=nil
local lw=nil
local rotate=nil
local justify=nil
------------------------------------------------------------------------
var=db.var
dev=db.dev or ""
width=db.w
height=db.h
across=db.x
down=db.y
bgc=db.bgc -- background color
bga=db.bga or 1
inc=db.indc -- indicator color
ina=db.inda or 1
lc=db.lc -- line color
la=db.la or 1
lw=db.lw
rotate=db.r or 0
justify=db.j or "l"

--indicator calculation
if not dev then dev=''; end

conum=conky_parse("${"..var..' '..dev.."}")
conum=tonumber(conum)

local inum=(((width-lw)/100)*(conum or 0))

if justify=="r" then -- sometimes useful
across=across-width
elseif justify=="l" then
across=across
end

--background bar
cairo_translate (cr, (across+(lw/2)), (down+(lw/2))) 
cairo_rotate (cr, rotate*math.pi/180)
cairo_set_source_rgba (cr, col(bgc, bga));
cairo_rectangle (cr, 0, 0, (width-lw), (height-lw))
cairo_fill (cr)
cairo_rotate (cr, (rotate*-1)*math.pi/180)
cairo_translate (cr, -1*(across+(lw/2)), -1*(down+(lw/2))) 
--indicator bar
cairo_translate (cr, (across+(lw/2)), (down+(lw/2))) 
cairo_rotate (cr, rotate*math.pi/180)
cairo_set_source_rgba (cr, col(inc,ina));
cairo_rectangle (cr, 0, 0, inum, (height-lw))
cairo_fill (cr)
cairo_rotate (cr, (rotate*-1)*math.pi/180)
cairo_translate (cr, -1*(across+(lw/2)), -1*(down+(lw/2))) 
--boundary line
cairo_translate (cr, (across+(lw/2)), (down+(lw/2))) 
cairo_rotate (cr, rotate*math.pi/180)
cairo_set_line_width (cr, lw);
cairo_set_source_rgba (cr, col(lc,la));
cairo_rectangle (cr, -lw/2, -lw/2, width, height)
cairo_stroke (cr)
cairo_rotate (cr, (rotate*-1)*math.pi/180)
cairo_translate (cr, -1*(across+(lw/2)), -1*(down+(lw/2))) 
end

@mrpeachy

just a broat hint: v9000 is a very good basesystem for all conky-users! and this bars would make it better smile

Offline

#5236 2013-05-03 02:45:04

thorbs
#! Member
Registered: 2013-04-22
Posts: 53

Re: Conky v1.9 Thread

I would like to show cpu temparature in Conky (and maybe fan speed). I have found diferent snippets off code, but not really anyone that gives the desired result. Anybody who have some good way to do this?

Offline

#5237 2013-05-03 03:36:31

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

Re: Conky v1.9 Thread

lionhead wrote:

i want to include the get_color-function within the function that draws bars

function draw_bar(db) -- improved bars by mrpeachy (2010)

local var=nil
local dev=nil
local width=nil
local height=nil
local across=nil
local down=nil
local bgc=nil
local bga=nil
local inc=nil
local ina=nil
local lc=nil
local la=nil
local lw=nil
local rotate=nil
local justify=nil
------------------------------------------------------------------------
var=db.var
dev=db.dev or ""
width=db.w
height=db.h
across=db.x
down=db.y
bgc=db.bgc -- background color
bga=db.bga or 1
inc=db.indc -- indicator color
ina=db.inda or 1
lc=db.lc -- line color
la=db.la or 1
lw=db.lw
rotate=db.r or 0
justify=db.j or "l"

--indicator calculation
if not dev then dev=''; end

conum=conky_parse("${"..var..' '..dev.."}")
conum=tonumber(conum)

local inum=(((width-lw)/100)*(conum or 0))

if justify=="r" then -- sometimes useful
across=across-width
elseif justify=="l" then
across=across
end

--background bar
cairo_translate (cr, (across+(lw/2)), (down+(lw/2))) 
cairo_rotate (cr, rotate*math.pi/180)
cairo_set_source_rgba (cr, col(bgc, bga));
cairo_rectangle (cr, 0, 0, (width-lw), (height-lw))
cairo_fill (cr)
cairo_rotate (cr, (rotate*-1)*math.pi/180)
cairo_translate (cr, -1*(across+(lw/2)), -1*(down+(lw/2))) 
--indicator bar
cairo_translate (cr, (across+(lw/2)), (down+(lw/2))) 
cairo_rotate (cr, rotate*math.pi/180)
cairo_set_source_rgba (cr, col(inc,ina));
cairo_rectangle (cr, 0, 0, inum, (height-lw))
cairo_fill (cr)
cairo_rotate (cr, (rotate*-1)*math.pi/180)
cairo_translate (cr, -1*(across+(lw/2)), -1*(down+(lw/2))) 
--boundary line
cairo_translate (cr, (across+(lw/2)), (down+(lw/2))) 
cairo_rotate (cr, rotate*math.pi/180)
cairo_set_line_width (cr, lw);
cairo_set_source_rgba (cr, col(lc,la));
cairo_rectangle (cr, -lw/2, -lw/2, width, height)
cairo_stroke (cr)
cairo_rotate (cr, (rotate*-1)*math.pi/180)
cairo_translate (cr, -1*(across+(lw/2)), -1*(down+(lw/2))) 
end

hmm there is some stuff in there that doesnt look like mine... this is a lionhead tweaked mrpeachy script if i'm not mitsaken smile

however that one would be quite easy to retrofit
paste the get_color function into the bottom of the script as indicated below
then i would remove the conky parse operation from the drawing script and put it into the setup

function whatever()
val=tonumber(conky_parse("whatever"))
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
draw_bar({val=val, all the other settings},tcol)
end


function draw_bar(db,tcol) -- improved bars by mrpeachy (2010)

local var=nil
local dev=nil
local width=nil
local height=nil
local across=nil
local down=nil
local bgc=nil
local bga=nil
local inc=nil
local ina=nil
local lc=nil
local la=nil
local lw=nil
local rotate=nil
local justify=nil
------------------------------------------------------------------------
--var=db.var
--dev=db.dev or ""
width=db.w
height=db.h
across=db.x
down=db.y
bgc=db.bgc -- background color
bga=db.bga or 1
inc=db.indc -- indicator color
ina=db.inda or 1
lc=db.lc -- line color
la=db.la or 1
lw=db.lw
rotate=db.r or 0
justify=db.j or "l"
--indicator calculation
--if not dev then dev=''; end
--conum=conky_parse("${"..var..' '..dev.."}")
conum=tonumber(db.val)

local inum=(((width-lw)/100)*(conum or 0))

if justify=="r" then -- sometimes useful
across=across-width
elseif justify=="l" then
across=across
end

--background bar
cairo_translate (cr, (across+(lw/2)), (down+(lw/2))) 
cairo_rotate (cr, rotate*math.pi/180)
cairo_set_source_rgba (cr, col(bgc, bga));
cairo_rectangle (cr, 0, 0, (width-lw), (height-lw))
cairo_fill (cr)
cairo_rotate (cr, (rotate*-1)*math.pi/180)
cairo_translate (cr, -1*(across+(lw/2)), -1*(down+(lw/2))) 
--indicator bar
cairo_translate (cr, (across+(lw/2)), (down+(lw/2))) 
cairo_rotate (cr, rotate*math.pi/180)
cairo_set_source_rgba (cr, tcol[1],tcol[2],tcol[3],tcol[4]);
cairo_rectangle (cr, 0, 0, inum, (height-lw))
cairo_fill (cr)
cairo_rotate (cr, (rotate*-1)*math.pi/180)
cairo_translate (cr, -1*(across+(lw/2)), -1*(down+(lw/2))) 
--boundary line
cairo_translate (cr, (across+(lw/2)), (down+(lw/2))) 
cairo_rotate (cr, rotate*math.pi/180)
cairo_set_line_width (cr, lw);
cairo_set_source_rgba (cr, col(lc,la));
cairo_rectangle (cr, -lw/2, -lw/2, width, height)
cairo_stroke (cr)
cairo_rotate (cr, (rotate*-1)*math.pi/180)
cairo_translate (cr, -1*(across+(lw/2)), -1*(down+(lw/2))) 
end

function get_color()
etc etc etc
end

that should more or less work  big_smile

Offline

#5238 2013-05-03 08:15:40

Naik
#! Die Hard
From: Leipzig
Registered: 2012-11-16
Posts: 595

Re: Conky v1.9 Thread

there are several ways to do so, as you allready found out: one that works for me is using $acpitemp and $acpifan, but this will only work if your computer is using acpi
another way would be to grep the desired output of sensors
just type sensors in terminal and see if you get what you desire..
the call in conky for me would be

${execi 13 sensors | grep 'fan1' | cut -c14-23}
${execi 13 sensors | grep 'temp1' | cut -c14-23}

for you it may be different but as a rolemodel it maybe helps...

greetz -naik


*kaum macht man es richtig, funktioniert es sofort*

Offline

#5239 2013-05-03 09:27:27

ichase
#! CrunchBanger
Registered: 2011-03-16
Posts: 146

Re: Conky v1.9 Thread

Mr Peachy or S11, I made some minor changes to the clock in regards to thickness of the hands and marks, but I can't figure out the code for color.  I see this line in the lauclock2412 script, and when I change the color and remove the -- I get a nil value error.

--set mark color and alpha,red blue green alpha
local mr,mg,mb,ma=1,1,1,1  --red

42c9fe252343362.jpg
Also, how to I active the "seconds hand"

--SECONDS HAND SETUP
--set length of seconds hand
local sh_length=12
--set hand width
local sh_width=1
--set hand line cap
local sh_cap=CAIRO_LINE_CAP_ROUND
--set seconds hand color
local shr,shg,shb,sha=0,1,1,0  --fully opaque cyan

Thanks as always for your unselfish help you both provide.  smile

Ian

Last edited by ichase (2013-05-03 09:28:54)

Offline

#5240 2013-05-03 13:15:33

ragamatrix
#! Junkie
From: Earth
Registered: 2012-12-05
Posts: 286

Re: Conky v1.9 Thread

Hi !
I've just finished this; Thanks mr peachy for the help useful to create what I imagined...
thermoses_lua_weather:
thermoses_lua_weather
bigger
You will need arrows and lobster fonts :font_link1
                                                             font_link2
and modify your city name in the template and the language of items... easy smile
The template v9000 thermo lua:

--[[
 The latest script is a lua only weather script. aka: v9000
 http://crunchbang.org/forums/viewtopic.php?id=16100

 the file:
 http://dl.dropbox.com/u/19008369/weatheragain9000.lua.tar.gz

 mrppeachys LUA Tutorial
 http://crunchbang.org/forums/viewtopic.php?id=17246
--====================Modified---script---by---ragamatrix---===========================================--
--====================                                      ===========================================--
_________________________________________________________________________________________________________
]]
_G.weather_script = function()--#### DO NOT EDIT THIS LINE ##############
--these tables hold the coordinates for each repeat do not edit #########
top_left_x_coordinate={}--###############################################
top_left_y_coordinate={}--###############################################
--#######################################################################
--SET DEFAULTS ##########################################################
--set defaults do not localise these defaults if you use a seperate display script
default_font="Droid-Sans-Bold"--font must be in quotes
default_font_size=9
default_color=0xffffff	--white
default_alpha=1		--fully opaque
default_image_width=50
default_image_height=50
-- ## New Options ###
default_face="bold"
-- "normal" for normal/normal
-- "bold" for normal/bold
-- "italic" for italic/normal
-- "bolditalic" for italic/bold
--END OF DEFAULTS #######################################################
--START OF WEATHER CODE -- START OF WEATHER CODE -- START OF WEATHER CODE
--THERMOMETER--THERMOMETER--THERMOMETER--THERMOMETER--THERMOMETER--THERMOMETER--THERMOMETER--THERMOMETER
--[[
set a string named val to the valyue you want to display first, then use that string in the following 2 functions
use tonumber so that the output is a number
--]]
val=tonumber(now["temp"])
--val=tonumber(os.date("%S"))-10
--[[
get_color settings - this calculates the color of the thermometer inside
settings are inside ({ and }) and seperated by commas
	val needs to always be the first things set.  following val sub tables containing a number and a hex color are set
	sub tables set between { and } with the 2 values separated by a comma
	each sub table {},{} must be seperated from another sub table using a comma
the first number is the number at which the thermometer is that color
eg...  {0,0x00ff00} means that at value 0 the thermometer would be green
by setting multiple colors you can have the thermometer change according to a gradient
{0,0x00ff00},{100,0xff0000} would be green a 0, red at 100 and a gracient between the two colors at values in between

the get_color function outputs a lua formatted table containing the rgba color
tcol=get_color({}) stores that color in the tcol variable which is then used in the drawing function below
--]]
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
--[[
thermometer settings - this draws the thermometer
settings are inside ({ and }) and seperated by commas
x=x position (center of thermometer circle)
y=y position
lines=1 or 0 , 1 for scale lines, 0 for no scale lines
f=font (font name in quotes)
fs=font size
label=text to display on side, must be in brackets.  Do not set or set label=nil for no label
scale=size of thermometer, this affects all sizes including font size
units="C" or "F" 
val=val, leave this as it is, val is set above
tcol=tcol, leave this as it is to get the correct color change, tcol is set above
---##############################################################################################example#####################################
#################################################################################################       #####################################

val=tonumber(high_temp[10])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=100.5,y=300,numbers=0,lines=0,f="sans",fs=12,label=weather_location,scale=1,units="C",tcol=tcol,val=val})

val=tonumber(low_temp[10])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=200.5,y=300,numbers=0,lines=0,f="sans",fs=12,label=weather_location,scale=1,units="C",tcol=tcol,val=val})

val=tonumber(high_temp[9])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=300.5,y=300,numbers=0,lines=0,f="sans",fs=12,label=weather_location,scale=1,units="C",tcol=tcol,val=val})

val=tonumber(low_temp[9])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=400,y=300,numbers=0,lines=0,f="sans",fs=12,label=weather_location,scale=1,units="C",tcol=tcol,val=val})

etc
--]]
--##thermo actuel##--
thermometer ({x=720,y=123,numbers=1,lines=1,f="Mono",fs=12,label=weather_location,scale=0.6,units="C",tcol=tcol,val=val})
--Thermo j+10
val=tonumber(high_temp[10])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1785.5,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Maxi",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0xff0000,a=1,f="Arrows",fs=20,x=1780,y=25,txt="c"})
val=tonumber(low_temp[10])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1855,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Mini",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0x00ffff,a=1,f="Arrows",fs=20,x=1850,y=25,txt="d"})
--Thermo j+9
val=tonumber(high_temp[9])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1660,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Maxi",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0xff0000,a=1,f="Arrows",fs=20,x=1655,y=25,txt="c"})
val=tonumber(low_temp[9])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1730,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Mini",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0x00ffff,a=1,f="Arrows",fs=20,x=1725,y=25,txt="d"})
--Thermo j+8
val=tonumber(high_temp[8])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1535,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Maxi",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0xff0000,a=1,f="Arrows",fs=20,x=1530,y=25,txt="c"})
val=tonumber(low_temp[8])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1605,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Mini",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0x00ffff,a=1,f="Arrows",fs=20,x=1600,y=25,txt="d"})
--Thermo j+7
val=tonumber(high_temp[7])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1410,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Maxi",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0xff0000,a=1,f="Arrows",fs=20,x=1405,y=25,txt="c"})
val=tonumber(low_temp[7])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1480,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Mini",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0x00ffff,a=1,f="Arrows",fs=20,x=1475,y=25,txt="d"})
--Thermo j+6
val=tonumber(high_temp[6])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1285,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Maxi",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0xff0000,a=1,f="Arrows",fs=20,x=1280,y=25,txt="c"})
val=tonumber(low_temp[6])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1355,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Mini",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0x00ffff,a=1,f="Arrows",fs=20,x=1350,y=25,txt="d"})
--Thermo j+5
val=tonumber(high_temp[5])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1160,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Maxi",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0xff0000,a=1,f="Arrows",fs=20,x=1155,y=25,txt="c"})
val=tonumber(low_temp[5])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1230,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Mini",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0x00ffff,a=1,f="Arrows",fs=20,x=1225,y=25,txt="d"})
--Thermo j+4
val=tonumber(high_temp[4])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1035,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Maxi",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0xff0000,a=1,f="Arrows",fs=20,x=1030,y=25,txt="c"})
val=tonumber(low_temp[4])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=1105,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Mini",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0x00ffff,a=1,f="Arrows",fs=20,x=1100,y=25,txt="d"})
--Thermo j+3
val=tonumber(high_temp[3])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=910,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Maxi",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0xff0000,a=1,f="Arrows",fs=20,x=905,y=25,txt="c"})
val=tonumber(low_temp[3])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=980,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Mini",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0x00ffff,a=1,f="Arrows",fs=20,x=975,y=25,txt="d"})
--Thermo j+2
val=tonumber(high_temp[2])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=785,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Maxi",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0xff0000,a=1,f="Arrows",fs=20,x=780,y=25,txt="c"})
val=tonumber(low_temp[2])
tcol=get_color({val,{0,0x00ffff},{10,0x00ff00},{20,0xffff00},{30,0xff7f00},{40,0xff0000}})
thermometer ({x=855,y=123,numbers=0,lines=0,f="Mono",fs=13,label="Mini",scale=0.6,units="C",tcol=tcol,val=val})
out({c=0x00ffff,a=1,f="Arrows",fs=20,x=850,y=25,txt="d"})


--####End set thermo

--[[ forecast
datay=450  --375
datayy=15 --datay+(datayy*1)

datafx1=20

imgx=35
imgy=575
imgyy=60 -- imgy+(imgyy*1)
]]
-- forecast
datay=450
datayy=15 --datay+(datayy*1)

datafx1=20

imgx=45
imgy=575
imgyy=60 -- imgy+(imgyy*1)

ih=60
iw=60


-- ======================================================================
-- CURRENT FOR TODAY - SEE TOP LEFT -------------------------------------
   out({c=0xffd433,a=1,f="Lobster1.4",fs=20,x=30,y=26,txt="Horgen"})
   image({x=30,y=30,w=60,h=60,file=now["weather_icon"]})
 --image({x=20,y=25,w=87,h=130,file="/home/raphix/v9000/additional_files/s12.png"})
   out({c=0xFAFAEC,a=1,x=40,y=135,fs=15,txt="T° "})
      out({c=0xFF8C00,fs=15,a=1,x=63,y=135,txt=now["temp"].."°"})
   out({c=0xC0C0C0,a=1,x=40,y=115,fs=15,txt="± "})
      out({c=0xC0C0C0,fs=15,a=1,x=63,y=115,txt=now["feels_like"].."°"})

-- FORECAST TODAY - SEE TOP RIGHT ---------------------------------------
	out({c=silver,fs=15,a=1,x=320,y=25,txt="Tendance"})
   image({x=325,y=30,w=60,h=60,file=weather_icon[1]})
-- image({x=285,y=100,w=60,h=60,file="/media/5/Conky/images/red+.png"})
   out({c=0xff0000,a=1,f="Arrows",fs=20,x=590,y=26,txt="c"})
     out({c=0xff0000,fs=15,a=1,x=603,y=25,txt=high_temp[1].."°"})
   out({c=0x00ffff,a=1,f="Arrows",fs=20,x=645,y=26,txt="d"})
     out({c=0x00ffff,fs=15,a=1,x=658,y=25,txt=low_temp[1].."°"})
-- ======================================================================
-- MOON------------------------------------------------------
   --out({c=0xFAFAEC,a=1,x=20,y=35,txt="Lever Soleil "})
      --out({c=0x00BFFF,a=1,x=30,y=50,txt=sun_rise_24[1]})
-- MOON PHASE - CENTRE --------------------------------------------------
   out({c=0xffd433,a=1,f="Lobster1.4",fs=20,x=150,y=26,txt="Ephéméride"})
   image({x=165,y=30,w=60,h=60,file=moon_icon[1]})
-- image({x=170,y=170,w=120,h=120,file="/media/5/Conky/images/red+.png"})
   --out({c=0xFFFFFF,a=1.0,x=190,y=235,txt=moon_phase[1]})
   --out({c=0xFAFAEC,a=1,x=90,y=35,txt=" Lever Lune"})
      out({c=0x00BFFF,fs=15,a=1,x=170,y=115,txt=moon_rise_24[1]})
   --out({c=0xFAFAEC,a=1,x=100,y=65,txt=" Coucher Lune"})
      out({c=0xFF8C00,fs=15,a=1,x=170,y=135,txt=moon_set_24[1]})
-- SUN-------------------------------------------------------
   --out({c=0x00BFFF,a=1,x=275,y=115,fs=15,txt="Lever :"})
      out({c=0x00BFFF,a=1,x=330,y=115,fs=15,txt=sun_rise_24[1]})
   --out({c=0xFF8C00,a=1,x=254,y=135,fs=15,txt="Coucher :"})
      out({c=0xFF8C00,a=1,x=330,y=135,fs=15,txt=sun_set_24[1]})
-- ======================================================================
-- ======================================================================x=465,y=25
-- WIND INFORMATION - SEE BOTTOM ----------------------------------------
   image({x=665,y=103,w=30,h=30,file=now["wind_icon"]})
-- image({x=185,y=290,w=90,h=90,file="/media/5/Conky/images/red+.png"})
   out({c=0xffffff,a=1,x=642,y=115,txt=now["wind_deg"]})
   out({c=0xffffff,a=1,x=642,y=125,txt=now["wind_nesw"]})
--   out({c=0xffffff,a=1,x=333,y=295,txt="@"})
      out({c=0xFF8C00,a=1,x=660,y=140,txt=now["wind_km"]..""})

-- ======================================================================
-- Barometric Pressure
   out({c=0xFAFAEC,a=1,x=590,y=45,txt="Pression:"})
	out({c=0xFF8C00,a=1,x=635,y=45,txt=now["pressure_mb"].." mb"})
-- Humidity -------------------------------------------------------------
   out({c=0xFAFAEC,a=1,x=590,y=55,txt="Humidité:"})
      out({c=0x00BFFF,a=1,x=640,y=55,txt=now["humidity"].."%"})
-- Dew Point ------------------------------------------------------------
   --out({c=0xFAFAEC,a=1,x=90,y=520,txt="DP:"})
      --out({c=0xC0C0C0,a=1,x=135,y=520,txt=now["dew_point"].."°"})
-- ======================================================================
-- BOTTOM RIGHT
-- Ceiling
   out({c=0xFAFAEC,a=1,x=590,y=65,txt="Plafond:"})
     out({c=0x00BFFF,a=1,x=640,y=65,txt=now["ceiling"]})
-- Chance of Rain -------------------------------------------------------
   out({c=0xFAFAEC,a=1,x=590,y=75,txt="Prob Préc:"})
      out({c=0x00BFFF,a=1,x=640,y=75,txt=precipitation[1].."%"})
-- Cloud Cover
   out({c=0xFAFAEC,a=1,x=590,y=85,txt="Couv Nuages:"})
      out({c=0x00BFFF,a=1,x=658,y=85,txt=cloud_cover[1].."%"})
-- ======================================================================
-- BOTTOM CENTRE
-- UV -------------------------------------------------------------------
   out({c=0xFAFAEC,a=1,x=590,y=96,txt="UV :"})
     out({c=0xFF8C00,a=1,x=615,y=96,txt=uv_index_num[1]})
       out({c=0xFF8C00,a=1,x=625,y=96,txt=uv_index_txt[1]})

-- ======================================================================
-- FORECAST FOR NEXT 3 HOURS --------------------------------------------
  --image({x=450,y=50,w=240,h=2,file="/home/climatix/.conky/conky37/red_1.png"})
--out({c=0xFAFAEC,a=1,f="Droid-Sans-Bold",fs=10,x=415,y=55,txt="prochaines heures"})
 --out({c=0x227992,a=1,f="Arial",fs=16,x=400,y=30,txt="Hours"})
-- 1st hour
out({c=0xFF9600,x=425,y=25,fs=15,txt=now["fc_hour1_time_24"]..":00"})
  image({w=60,h=60,x=425,y=30,file=now["fc_hour1_wicon"]})
 --image({w=60,h=60,x=20,y=475,file="/media/5/Conky/images/red+.png"})
out({c=silver,fs=15,x=435,y=105,txt=now["fc_hour1_temp"] .."°"})
-- 2nd hour
--out({c=0xFF9600,x=212,y=470,txt=now["fc_hour2_time_24"]..":00"})
  --image({w=60,h=60,x=200,y=475,file=now["fc_hour2_wicon"]})
-- image({w=60,h=60,x=200,y=475,file="/media/5/Conky/images/red+.png"})
--out({c=0xAFAFAF,x=221,y=550,txt=now["fc_hour2_temp"] .."°"})
-- 3rd hour
out({c=0xFF9600,x=520,y=25,fs=15,txt=now["fc_hour3_time_24"]..":00"})
  image({w=60,h=60,x=510,y=30,file=now["fc_hour3_wicon"]})
-- image({w=60,h=60,x=380,y=475,file="/media/5/Conky/images/red+.png"})
out({c=silver,fs=15,x=525,y=105,txt=now["fc_hour3_temp"] .."°"})

-- ======================================================================
-- FORECAST for the next 9 days
-- Forecast day 2 -- x = l|r  y = u|d
out({c=0x9ACD32,a=1,x=800,y=17,txt=forecast_day_short[2]})
 out({c=0x9ACD32,a=1,x=825,y=17,txt=forecast_date[2]})
  --out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*8),txt=forecast_month_short[4]})
image({w=40,h=40,x=800,y=21,file=weather_icon[2]})
-- image({w=iw,h=ih,x=imgx*7.52,y=imgy,file="/media/5/Conky/images/red+.png"})
--out({c=0xFF8C00,a=1,x=1850,y=35,txt=high_temp[10].."°"})
--out({c=0x00BFFF,a=1,x=1850,y=55,txt=low_temp[10].."°"})
 out({c=0x00BFFF,a=1,x=805,y=72,txt=sun_rise_24[2]})
 out({c=0xFF8C00,a=1,x=805,y=82,txt=sun_set_24[2]})
-- UV -------------------------------------------------------------------
 out({c=0xFAFAEC,a=1,x=805,y=92,txt="UV:"})
 out({c=0xC0C0C0,a=1,x=825,y=92,txt=uv_index_num[2]})
--Wind ------------------------------------------------------------------
image({x=805,y=103,w=30,h=30,file=wind_icon[2]})
 out({c=0xffffff,a=1,x=807,y=103,txt=wind_nesw[2]})
 out({c=0xFF8C00,a=1,x=801,y=141,txt=wind_km[2].." Km/h"})

-- ======================================================================

-- Forecast day 3 -- x = l|r  y = u|d
out({c=0x9ACD32,a=1,x=925,y=17,txt=forecast_day_short[3]})
 out({c=0x9ACD32,a=1,x=950,y=17,txt=forecast_date[3]})
  --out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*8),txt=forecast_month_short[4]})
image({w=40,h=40,x=925,y=21,file=weather_icon[3]})
-- image({w=iw,h=ih,x=imgx*7.52,y=imgy,file="/media/5/Conky/images/red+.png"})
--out({c=0xFF8C00,a=1,x=1850,y=35,txt=high_temp[10].."°"})
--out({c=0x00BFFF,a=1,x=1850,y=55,txt=low_temp[10].."°"})
 out({c=0x00BFFF,a=1,x=930,y=72,txt=sun_rise_24[3]})
 out({c=0xFF8C00,a=1,x=930,y=82,txt=sun_set_24[3]})
-- UV -------------------------------------------------------------------
 out({c=0xFAFAEC,a=1,x=930,y=92,txt="UV:"})
 out({c=0xC0C0C0,a=1,x=950,y=92,txt=uv_index_num[3]})
--Wind ------------------------------------------------------------------
image({x=930,y=103,w=30,h=30,file=wind_icon[3]})
 out({c=0xffffff,a=1,x=932,y=103,txt=wind_nesw[3]})
 out({c=0xFF8C00,a=1,x=926,y=141,txt=wind_km[3].." Km/h"})

-- ======================================================================
-- Forecast day 4 -- x = l|r  y = u|d
 out({c=0x9ACD32,a=1,x=1050,y=17,txt=forecast_day_short[4]})
 out({c=0x9ACD32,a=1,x=1075,y=17,txt=forecast_date[4]})
  --out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*8),txt=forecast_month_short[4]})
image({w=40,h=40,x=1050,y=21,file=weather_icon[4]})
-- image({w=iw,h=ih,x=imgx*7.52,y=imgy,file="/media/5/Conky/images/red+.png"})
--out({c=0xFF8C00,a=1,x=1850,y=35,txt=high_temp[10].."°"})
--out({c=0x00BFFF,a=1,x=1850,y=55,txt=low_temp[10].."°"})
 out({c=0x00BFFF,a=1,x=1055,y=72,txt=sun_rise_24[4]})
 out({c=0xFF8C00,a=1,x=1055,y=82,txt=sun_set_24[4]})
-- UV -------------------------------------------------------------------
 out({c=0xFAFAEC,a=1,x=1055,y=92,txt="UV:"})
 out({c=0xC0C0C0,a=1,x=1075,y=92,txt=uv_index_num[4]})
--Wind ------------------------------------------------------------------
image({x=1055,y=103,w=30,h=30,file=wind_icon[4]})
 out({c=0xffffff,a=1,x=1057,y=103,txt=wind_nesw[4]})
 out({c=0xFF8C00,a=1,x=1051,y=141,txt=wind_km[4].." Km/h"})

-- ======================================================================
-- ======================================================================
-- Forecast day 5 -- x = l|r  y = u|d
  out({c=0x9ACD32,a=1,x=1175,y=17,txt=forecast_day_short[5]})
 out({c=0x9ACD32,a=1,x=1200,y=17,txt=forecast_date[5]})
  --out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*8),txt=forecast_month_short[4]})
image({w=40,h=40,x=1175,y=21,file=weather_icon[5]})
-- image({w=iw,h=ih,x=imgx*7.52,y=imgy,file="/media/5/Conky/images/red+.png"})
--out({c=0xFF8C00,a=1,x=1850,y=35,txt=high_temp[10].."°"})
--out({c=0x00BFFF,a=1,x=1850,y=55,txt=low_temp[10].."°"})
 out({c=0x00BFFF,a=1,x=1180,y=72,txt=sun_rise_24[5]})
 out({c=0xFF8C00,a=1,x=1180,y=82,txt=sun_set_24[5]})
-- UV -------------------------------------------------------------------
 out({c=0xFAFAEC,a=1,x=1180,y=92,txt="UV:"})
 out({c=0xC0C0C0,a=1,x=1200,y=92,txt=uv_index_num[5]})
--Wind ------------------------------------------------------------------
image({x=1180,y=103,w=30,h=30,file=wind_icon[5]})
 out({c=0xffffff,a=1,x=1182,y=103,txt=wind_nesw[5]})
 out({c=0xFF8C00,a=1,x=1176,y=141,txt=wind_km[5].." Km/h"})

-- ======================================================================

-- Forecast day 6 -- x = l|r  y = u|d
 out({c=0x9ACD32,a=1,x=1300,y=17,txt=forecast_day_short[6]})
 out({c=0x9ACD32,a=1,x=1325,y=17,txt=forecast_date[6]})
  --out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*8),txt=forecast_month_short[4]})
image({w=40,h=40,x=1300,y=21,file=weather_icon[6]})
-- image({w=iw,h=ih,x=imgx*7.52,y=imgy,file="/media/5/Conky/images/red+.png"})
--out({c=0xFF8C00,a=1,x=1850,y=35,txt=high_temp[10].."°"})
--out({c=0x00BFFF,a=1,x=1850,y=55,txt=low_temp[10].."°"})
 out({c=0x00BFFF,a=1,x=1305,y=72,txt=sun_rise_24[6]})
 out({c=0xFF8C00,a=1,x=1305,y=82,txt=sun_set_24[6]})
-- UV -------------------------------------------------------------------
 out({c=0xFAFAEC,a=1,x=1305,y=92,txt="UV:"})
 out({c=0xC0C0C0,a=1,x=1325,y=92,txt=uv_index_num[6]})
--Wind ------------------------------------------------------------------
image({x=1305,y=103,w=30,h=30,file=wind_icon[6]})
 out({c=0xffffff,a=1,x=1307,y=103,txt=wind_nesw[6]})
 out({c=0xFF8C00,a=1,x=1301,y=141,txt=wind_km[6].." Km/h"})

-- ======================================================================

-- Forecast day 7 -- x = l|r  y = u|d
 out({c=0x9ACD32,a=1,x=1425,y=17,txt=forecast_day_short[7]})
 out({c=0x9ACD32,a=1,x=1450,y=17,txt=forecast_date[7]})
  --out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*8),txt=forecast_month_short[4]})
image({w=40,h=40,x=1425,y=21,file=weather_icon[7]})
-- image({w=iw,h=ih,x=imgx*7.52,y=imgy,file="/media/5/Conky/images/red+.png"})
--out({c=0xFF8C00,a=1,x=1850,y=35,txt=high_temp[10].."°"})
--out({c=0x00BFFF,a=1,x=1850,y=55,txt=low_temp[10].."°"})
 out({c=0x00BFFF,a=1,x=1430,y=72,txt=sun_rise_24[7]})
 out({c=0xFF8C00,a=1,x=1430,y=82,txt=sun_set_24[7]})
-- UV -------------------------------------------------------------------
 out({c=0xFAFAEC,a=1,x=1430,y=92,txt="UV:"})
 out({c=0xC0C0C0,a=1,x=1450,y=92,txt=uv_index_num[7]})
--Wind ------------------------------------------------------------------
image({x=1430,y=103,w=30,h=30,file=wind_icon[7]})
 out({c=0xffffff,a=1,x=1432,y=103,txt=wind_nesw[7]})
 out({c=0xFF8C00,a=1,x=1426,y=141,txt=wind_km[7].." Km/h"})

-- ======================================================================
-- Forecast day 8 -- x = l|r  y = u|d
     out({c=0x9ACD32,a=1,x=1550,y=17,txt=forecast_day_short[8]})
 out({c=0x9ACD32,a=1,x=1575,y=17,txt=forecast_date[8]})
  --out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*8),txt=forecast_month_short[4]})
image({w=40,h=40,x=1550,y=21,file=weather_icon[8]})
-- image({w=iw,h=ih,x=imgx*7.52,y=imgy,file="/media/5/Conky/images/red+.png"})
--out({c=0xFF8C00,a=1,x=1850,y=35,txt=high_temp[10].."°"})
--out({c=0x00BFFF,a=1,x=1850,y=55,txt=low_temp[10].."°"})
 out({c=0x00BFFF,a=1,x=1555,y=72,txt=sun_rise_24[8]})
 out({c=0xFF8C00,a=1,x=1555,y=82,txt=sun_set_24[8]})
-- UV -------------------------------------------------------------------
 out({c=0xFAFAEC,a=1,x=1555,y=92,txt="UV:"})
 out({c=0xC0C0C0,a=1,x=1575,y=92,txt=uv_index_num[8]})
--Wind ------------------------------------------------------------------
image({x=1555,y=103,w=30,h=30,file=wind_icon[8]})
 out({c=0xffffff,a=1,x=1557,y=103,txt=wind_nesw[8]})
 out({c=0xFF8C00,a=1,x=1551,y=141,txt=wind_km[8].." Km/h"})

-- Forecast day 9 -- x = l|r  y = u|d
    out({c=0x9ACD32,a=1,x=1675,y=17,txt=forecast_day_short[9]})
 out({c=0x9ACD32,a=1,x=1700,y=17,txt=forecast_date[9]})
  --out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*8),txt=forecast_month_short[4]})
image({w=40,h=40,x=1675,y=21,file=weather_icon[9]})
-- image({w=iw,h=ih,x=imgx*7.52,y=imgy,file="/media/5/Conky/images/red+.png"})
--out({c=0xFF8C00,a=1,x=1207,y=35,txt=high_temp[9].."°"})
--out({c=0x00BFFF,a=1,x=1207,y=55,txt=low_temp[9].."°"})
 out({c=0x00BFFF,a=1,x=1680,y=72,txt=sun_rise_24[9]})
 out({c=0xFF8C00,a=1,x=1680,y=82,txt=sun_set_24[9]})
-- UV -------------------------------------------------------------------
 out({c=0xFAFAEC,a=1,x=1680,y=92,txt="UV:"})
 out({c=0xC0C0C0,a=1,x=1700,y=92,txt=uv_index_num[9]})
--Wind ------------------------------------------------------------------
image({x=1680,y=103,w=30,h=30,file=wind_icon[9]})
 out({c=0xffffff,a=1,x=1682,y=103,txt=wind_nesw[9]})
 out({c=0xFF8C00,a=1,x=1676,y=141,txt=wind_km[9].." Km/h"})
-- Forecast day 10 -- x = l|r  y = u|d
   out({c=0x9ACD32,a=1,x=1800,y=17,txt=forecast_day_short[10]})
 out({c=0x9ACD32,a=1,x=1825,y=17,txt=forecast_date[10]})
  --out({c=0x9ACD32,a=1,x=datafx1*19.8,y=datay+(datayy*8),txt=forecast_month_short[4]})
image({w=40,h=40,x=1800,y=21,file=weather_icon[10]})
-- image({w=iw,h=ih,x=imgx*7.52,y=imgy,file="/media/5/Conky/images/red+.png"})
--out({c=0xFF8C00,a=1,x=1850,y=35,txt=high_temp[10].."°"})
--out({c=0x00BFFF,a=1,x=1850,y=55,txt=low_temp[10].."°"})
 out({c=0x00BFFF,a=1,x=1805,y=72,txt=sun_rise_24[10]})
 out({c=0xFF8C00,a=1,x=1805,y=82,txt=sun_set_24[10]})
-- UV -------------------------------------------------------------------
 out({c=0xFAFAEC,a=1,x=1805,y=92,txt="UV:"})
 out({c=0xC0C0C0,a=1,x=1825,y=92,txt=uv_index_num[10]})
--Wind ------------------------------------------------------------------
image({x=1805,y=103,w=30,h=30,file=wind_icon[10]})
 out({c=0xffffff,a=1,x=1810,y=103,txt=wind_nesw[10]})
 out({c=0xFF8C00,a=1,x=1800,y=141,txt=wind_km[10].." Km/h"})

--]]

--#######################################################################
--END OF WEATHER CODE ----END OF WEATHER CODE ----END OF WEATHER CODE ---
--#######################################################################
end--of weather_display function do not edit this line ##################
--#######################################################################
function get_color(ctab)
--by mrpeachy 04/2013
local function color(col)
return {((col / 0x10000) % 0x100) / 255, ((col / 0x100) % 0x100) / 255, (col % 0x100) / 255, 1}
end
local ncol=#ctab
local val=ctab[1]
local lownum=(ctab[2])[1]
local lowcol=color((ctab[2])[2])
local highnum=(ctab[ncol])[1]
local highcol=color((ctab[ncol])[2])
if val<=lownum then 
color=lowcol
elseif val>=highnum then
color=highcol
else
	for i=2,ncol do
	entry1=ctab[i]
	entry2=ctab[i+1] or ctab[i]
	lower=entry1[1]
	upper=entry2[1]
		if val>=lower and val<=upper then
		nentry=i
		end
	end
ctop=color((ctab[nentry+1] or nentry)[2])
ntop=(ctab[nentry+1] or nentry)[1]
clow=color((ctab[nentry])[2])
nlow=(ctab[nentry])[1]
i1=ntop-nlow
i2=val-nlow
c1=clow[1]+((ctop[1]-clow[1])*i2/i1)
c2=clow[2]+((ctop[2]-clow[2])*i2/i1)
c3=clow[3]+((ctop[3]-clow[3])*i2/i1)
c4=clow[4]+((ctop[4]-clow[4])*i2/i1)
color={c1,c2,c3,c4}
end
ctab=nil
return color
end--function
--#############################################################################################################################################################
--##--##--thermometer##thermometer##thermometer##thermometer##thermometer##thermometer##thermometer##thermometer##thermometer##thermometer
function thermometer(therm)
--by mrpeachy 04/2013
local mx=therm.x or 0
local my=therm.y or 0
local tcol=therm.tcol
local temp=therm.val or 0
local label=therm.label or nil
local scale=therm.scale or 1
local units=therm.units or "F"
local font=therm.f or "Mono"
local fsize=therm.fs or "10"
local lines=therm.lines or 1
local numbers=therm.numbers or 1
therm=nil
--by mrpeachy 2011
if units=="F" then height=150 elseif units=="C" then height=160 end
local mx=mx*(1/scale)
local my=my*(1/scale)
cairo_scale (cr,scale,scale)
cairo_set_line_width (cr,1)
cairo_set_source_rgba (cr,1,1,1,1)
--graphics outer
--bottom circle
r_outer=25
local lang_outer=335
local rang_outer=0+(360-lang_outer)
local h_outer=height-4--maybe make this a percentage?###########
cairo_arc (cr,mx,my,r_outer,(math.pi/180)*(rang_outer-90),(math.pi/180)*(lang_outer-90))
--coordinates,left line
local arc=(math.pi/180)*lang_outer
local lxo=0+r_outer*(math.sin(arc))
local lyo=0-r_outer*(math.cos(arc))
cairo_line_to (cr,mx+lxo,my+lyo-h_outer)
--coordinates,left line
local arc=(math.pi/180)*rang_outer
local rxo=0+r_outer*(math.sin(arc))
local ryo=0-r_outer*(math.cos(arc))
--top circle
cairo_arc (cr,mx+lxo+((rxo-lxo)/2),my+lyo-h_outer,(rxo-lxo)/2,(math.pi/180)*(270-90),(math.pi/180)*(90-90))
--right line
cairo_line_to (cr,mx+lxo+((rxo-lxo)),my+lyo)
cairo_stroke (cr)
----------------------------------------------
--graphics inner
--####################################################
if units=="F" then
cairo_set_source_rgba (cr,tcol[1],tcol[2],tcol[3],tcol[4])
--bottom circle
r_inner=r_outer-6
local lang_inner=lang_outer+9
local rang_inner=0+(360-lang_inner)
local h_inner=temp+30
cairo_arc (cr,mx,my,r_inner,(math.pi/180)*(rang_inner-90),(math.pi/180)*(lang_inner-90))
--coordinates,left line
local arc=(math.pi/180)*lang_inner
lxi=0+r_inner*(math.sin(arc))
local lyi=0-r_inner*(math.cos(arc))
cairo_line_to (cr,mx+lxi,my+lyi-h_inner)
--coordinates,left line
local arc=(math.pi/180)*rang_inner
rxi=0+r_inner*(math.sin(arc))
local ryi=0-r_inner*(math.cos(arc))
--top circle
cairo_arc (cr,mx+lxi+((rxi-lxi)/2),my+lyi-h_inner,(rxi-lxi)/2,(math.pi/180)*(270-90),(math.pi/180)*(90-90))
--right line
cairo_line_to (cr,mx+lxi+((rxi-lxi)),my+lyi)
cairo_fill (cr)
----------------------------
if lines==1 then
--scale lines
cairo_set_line_width (cr,1)
cairo_set_source_rgba (cr,1,1,1,0.5)
local grad=10
local lnn=15
local lnx=mx+lxo
local lnw=(rxo-lxo)
	for i=1,lnn do
	lny=my-r_inner-(10+((i-1)*grad))-((rxi-lxi)/2)
		if i==lnn then
		lnx=lnx+2
		lnw=lnw-4
		end
	cairo_move_to (cr,lnx,lny)
	cairo_rel_line_to (cr,lnw,0)
	cairo_stroke (cr)
	end
end--if lines
if numbers==1 then
--numbers
cairo_set_source_rgba (cr,1,1,1,1)
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
local grad=20
local lnn=8
local lnx=mx+lxo+(rxo-lxo)+4
num={-20,"0°"..units,20,40,60,80,100,120}
for i=1,lnn do
lny=my-r_inner-(10+((i-1)*grad))-((rxi-lxi)/2)+(fsize/3)
cairo_move_to (cr,lnx,lny)
cairo_show_text (cr,num[i])
cairo_stroke (cr)
end
end--if label
end--if units=F
--#################################################
if units=="C" then
cairo_set_source_rgba (cr,tcol[1],tcol[2],tcol[3],tcol[4])
--cairo_set_source_rgba (cr,0,1,1,1)
--bottom circle
r_inner=r_outer-6
local lang_inner=lang_outer+9
local rang_inner=0+(360-lang_inner)
local h_inner=(temp*2)+60
cairo_arc (cr,mx,my,r_inner,(math.pi/180)*(rang_inner-90),(math.pi/180)*(lang_inner-90))
--coordinates,left line
local arc=(math.pi/180)*lang_inner
lxi=0+r_inner*(math.sin(arc))
local lyi=0-r_inner*(math.cos(arc))
cairo_line_to (cr,mx+lxi,my+lyi-h_inner)
--coordinates,left line
local arc=(math.pi/180)*rang_inner
rxi=0+r_inner*(math.sin(arc))
local ryi=0-r_inner*(math.cos(arc))
--top circle
cairo_arc (cr,mx+lxi+((rxi-lxi)/2),my+lyi-h_inner,(rxi-lxi)/2,(math.pi/180)*(270-90),(math.pi/180)*(90-90))
--right line
cairo_line_to (cr,mx+lxi+((rxi-lxi)),my+lyi)
cairo_fill (cr)
----------------------------
if lines==1 then
--scale lines
cairo_set_line_width (cr,1)
cairo_set_source_rgba (cr,1,1,1,0.5)
local grad=10
local lnn=17
local lnx=mx+lxo
local lnw=(rxo-lxo)
	for i=1,lnn do
	lny=my-r_inner-(((i-1)*grad))-((rxi-lxi)/2)
		if i==lnn then
		lnx=lnx+2
		lnw=lnw-4
		end
	cairo_move_to (cr,lnx,lny)
	cairo_rel_line_to (cr,lnw,0)
	cairo_stroke (cr)
	end
end--if lines
if numbers==1 then
--numbers
cairo_set_source_rgba (cr,1,1,1,1)
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
local grad=20
local lnn=9
local lnx=mx+lxo+(rxo-lxo)+4
num={-30,-20,-10,"0°"..units,10,20,30,40,50}
for i=1,lnn do
lny=my-r_inner-(((i-1)*grad))-((rxi-lxi)/2)+(fsize/3)
cairo_move_to (cr,lnx,lny)
cairo_show_text (cr,num[i])
cairo_stroke (cr)
end
end--if label=none
end--if units=C
--#################################################
--label
if label~=nil then
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
local lbx=mx+lxo-5
local lby=my-r_inner-10-((rxi-lxi)/2)
cairo_move_to (cr,lbx,lby)
cairo_rotate (cr,(math.pi/180)*(-90))
cairo_show_text (cr,label)
cairo_stroke (cr)
cairo_rotate (cr,(math.pi/180)*(90))
--temperature readout
cairo_set_source_rgba (cr,0,0,0,1)
local text=temp.."°"..units
local extents=cairo_text_extents_t:create()
cairo_text_extents(cr,text,extents)
local width=extents.width
local height=extents.height
cairo_move_to (cr,mx-(width/2),my+(height/2))
cairo_show_text (cr,text)
cairo_stroke (cr)
end--if label
------------------------------------
cairo_scale (cr,1/scale,1/scale)
end--thermometer function
--#################################################################################################

Enjoy wink

Last edited by ragamatrix (2013-05-03 13:27:43)

Offline

#5241 2013-05-03 15:46:34

captdavid1949
Member
From: Deltaville VA
Registered: 2012-09-22
Posts: 42
Website

Re: Conky v1.9 Thread

------------Edit---------------
Solved it..  Increased  text_buffer_size and everything works as it should. Little more tweaking to get buffer down to min and still not drop strings. Am leaving this post in place just in case someone else runs into similar problem. Also commented script in case anyone has a use for it  Learned a few new things today. That's good.  Thanks again to mrpeachy and Sector11 for their suggestions and assistance. This setup runs on Fedora with its default hotplug parameters. Anyone has questions, PM me. Still subscribed to thread but not checking every day.
David
-----------------End Edit-------------

@Sector11
@mrpeachy
re: My earlier post(s)
Stubborn SOB  that I am, plus I need the practice, plus it's fun. ...

Nice as mrpeachy's script is, it really isn't exactly what I wanted.  Plus I don't know squat about Lua, so I decided to poke up a minimal perl script to grab the info I need, and use conky's  ${execp} to drag the output into my conkyrc...

Script:

#!/usr/bin/perl
# This is a quick hack.. Your mileage may vary.  It should enable you display (simple) stats on removable drives . 
# as long as they always mount in the same directory Eg:  /mnt  ,  /run/media/[user]  , etc  Not pretty, but it works for me

# In case we screw up our syntax etc
use warnings;

# Directory where my removable drives mount (Fedora default)
my $directory = '/run/media/david';

# One of the ugly parts.. Really for files, but will ouput directories as well, and never any "files" in this path, only mount points 
# Creates array containing directory names 
opendir(DIR,$directory);
my @files =  grep { $_ ne '.' && $_ ne '..' } readdir(DIR);
closedir(DIR);

#Loops through array and prints results. Conky will read this using ${execp [script-name]} which is placed in the TEXT area
# $_  is the bit returned from the array. Anything else should be enclosed in single quotes ( ' [something]' ) so it gets passed to 
# conky  without perl thinking it is a function or command. The setup below is for my conky.  Modify as required but remember 
#your quotes.  the final "\n' is a newline so each drive is on a new line (duh)
foreach(@files)
{
  print $_, '${alignr}${fs_used /run/media/david/', $_, '} / ${fs_size /run/media/david/', $_, '}    ${alignr}${fs_free_perc /run/media/david/', $_, '}% Free', "\n";
}

#If you actually use this script, you might want to run it in a terminal first, then paste the output into conky to try it out. If it works 
#then insert ${execp [script-name]} into the TEXT section of your conkyrc

Short version of the ouput is:
[drive volume name]  fs_used [path} /  fs_size [path]  fs_free-perc [path]   [\n]
looping through all the mounted external drives.

Works as advertised in a terminal, but when calling from conkyrc  info for second mounted drive is truncated (see screenshot below)
Copied output in terminal and pasted into conkyrc below the ${execp} function and as you can see in the screenshot everything is as expected, so I assume it is a problem in how conky is parsing the script output...
Any suggestions?

Screenshot
Screenshot
Relevant portion of conkyrc .... Note:  the sections below $execp are copied directly from the terminal and include the embeded new line character.

TEXT
Removable Drives

#${execp drive-list}  

Misc-Files${alignr}${fs_used /run/media/david/Misc-Files} / ${fs_size /run/media/david/Misc-Files}    ${alignr}${fs_free_perc /run/media/david/Misc-Files}% Free
External_Drive_1${alignr}${fs_used /run/media/david/External_Drive_1} / ${fs_size /run/media/david/External_Drive_1}    ${alignr}${fs_free_perc /run/media/david/External_Drive_1}% Free

${execp drive-list}  has been comment out as I found that conky is returning:
Conky: statfs64 '/run/media/d': No such file or directory
After some further experimentation with different drives  and the length of the script ouputs it would seem the issue is with the total length of the string being parsed by ${execp}. After x amount of characters it just packs it in. Is there a buffer or timeout somewhere in the config section I can modify. Have not had time to explore all the possibilities and I really HAVE to get off to work.

TIA  for any suggestions.

Last edited by captdavid1949 (2013-05-03 19:19:17)


"When you're up to your ass in alligators, its difficult to remember your initial objective was to drain the swamp"

Offline

#5242 2013-05-03 16:25:36

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

Re: Conky v1.9 Thread

@mrpeachy

this is original script i'm using to draw my bars: http://crunchbang.org/forums/viewtopic. … 805#p55805

because i only needed a bit of code it looks different smile why should i use a script that also can draws rings when i do not need it.

i'm drawing bars now like this:

draw_bar({var="cpu",dev="cpu0", w=150,h=10, x=15,y=400, bgc=0xffff00, indc=0x0000ff, lc=0x000000,lw=1})

in my opinion this is easier.  and you can use html-code. it almost look like a 'standard conky bar' wink

some settings (for example indicator alpha) use standard-values. but surely you can define your own values.

btw: here u can see some of the features from custom v9000: http://i.imgbox.com/adhkSklE.png

Offline

#5243 2013-05-03 19:55:25

grzegorzdabrowka
New Member
Registered: 2013-04-25
Posts: 3

Re: Conky v1.9 Thread

1) how to check automaticly witch is nr of CPU
${hwmon x temp y}         ${hwmon 0 temp 2}        ${hwmon 1 temp 2}         ${hwmon 2 temp 2}
${hwmon 0 temp 1}         ${hwmon 1 temp 1}        ${hwmon 2 temp 1}

2) how to use commend like this (in my system wanted play):
${addr ${gw_iface}}

3) how to do commend:
for i=0 i=i+1 end
do till i=x...

4) how to do commend:
=22+5

5) how to do commend:
if existing $HOME/logo.bmp than ${image $HOME/logo bmp -p 0,0 -s 96x72} else nothing ${endif}

5) how to do commend in .conkyrc:
${sudo open conky -c conkyrc2;}
${sudo open conky -c lua;}
smile  neutral  sad  big_smile  yikes  wink  hmm  tongue  lol  mad  roll  cool  O:)  8.(  ]:D  8)  {)  8o  :8

Offline

#5244 2013-05-03 21:26:29

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

Re: Conky v1.9 Thread

ragamatrix wrote:

Hi !
I've just finished this; Thanks mr peachy for the help useful to create what I imagined...
thermoses_lua_weather:
http://pix.toile-libre.org/upload/thumb/1367586542.png
bigger
You will need arrows and lobster fonts :font_link1
                                                             font_link2
and modify your city name in the template and the language of items... easy smile
The template v9000 thermo lua:

Enjoy wink

very nice work ragamatrix

Offline

#5245 2013-05-03 21:31:03

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

Re: Conky v1.9 Thread

ichase wrote:

Mr Peachy or S11, I made some minor changes to the clock in regards to thickness of the hands and marks, but I can't figure out the code for color.  I see this line in the lauclock2412 script, and when I change the color and remove the -- I get a nil value error.

--set mark color and alpha,red blue green alpha
local mr,mg,mb,ma=1,1,1,1  --red
local shr,shg,shb,sha=0,1,1,0  --fully opaque cyan

lua uses red, green, blue and alpha from 0 to 1

so making sha=0 means it is fully transparent

look in the script for places that say

cairo_set_source_rgba(cr,)

this is where the script is actually setting colors

Offline

#5246 2013-05-03 23:53:16

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,572

Re: Conky v1.9 Thread


"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

#5247 2013-05-04 00:01:06

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

Re: Conky v1.9 Thread

grzegorzdabrowka wrote:

1) how to check automaticly witch is nr of CPU
${hwmon x temp y}         ${hwmon 0 temp 2}        ${hwmon 1 temp 2}         ${hwmon 2 temp 2}
${hwmon 0 temp 1}         ${hwmon 1 temp 1}        ${hwmon 2 temp 1}

Install inxi a full featured system information script and compare what "sensors" says with inxi . inxi tells you what the temps are.

 03 May 13 | 20:54:47 ~
         $ sensors
acpitz-virtual-0
Adapter: Virtual device
temp1:        +30.0°C  (crit = +110.0°C)

k10temp-pci-00c3
Adapter: PCI adapter
temp1:        +28.0°C  (high = +70.0°C)

f71862fg-isa-0a00
Adapter: ISA adapter
+3.3V:        +3.42 V  
in1:          +1.35 V  
in2:          +1.51 V  
in3:          +0.86 V  
in4:          +0.00 V  
in5:          +0.00 V  
in6:          +0.00 V  
3VSB:         +3.41 V  
Vbat:         +2.86 V  
fan1:        1905 RPM
fan2:           0 RPM  ALARM
fan3:           0 RPM  ALARM
temp1:        +38.0°C  (high = +85.0°C, hyst = +81.0°C)
                       (crit = +70.0°C, hyst = +66.0°C)  sensor = transistor
temp2:        +32.0°C  (high = +85.0°C, hyst = +81.0°C)
                       (crit = +100.0°C, hyst = +96.0°C)  sensor = thermistor
temp3:       +127.0°C  (high = +70.0°C, hyst = +68.0°C)  ALARM (CRIT)
                       (crit = +85.0°C, hyst = +83.0°C)  sensor = transistor

 
 03 May 13 | 20:54:52 ~
         $ sen
Sensors:   System Temperatures: cpu: 37.0C mobo: 32.0C gpu: 0.0:44C 
           Fan Speeds (in rpm): cpu: 1901 fan-2: 0 fan-3: 0 
 
 03 May 13 | 20:54:54 ~
         $ 

Then check: Using Sensors - use 1.4 METHOD 3 - platform it is better than hwmon.

grzegorzdabrowka wrote:

2) how to use commend like this (in my system wanted play):
${addr ${gw_iface}}

${addr eth0} or ${addr eth1} or ${addr wlan0} etc

${gw_iface}
         Displays the default route's interface or "multiple"/"none" accordingly.

${gw_ip}
         Displays the default gateway's IP or "multiple"/"none" accordingly.

I have no router - sorry.

grzegorzdabrowka wrote:

3) how to do commend:
for i=0 i=i+1 end
do till i=x...

Need bash script or a LUA script. I can not do those.  sad

grzegorzdabrowka wrote:

4) how to do commend:
=22+5

Same ... bash script or LUA or some other script.

grzegorzdabrowka wrote:

5) how to do commend:
if existing $HOME/logo.bmp than ${image $HOME/logo bmp -p 0,0 -s 96x72} else nothing ${endif}

${if_existing /media/5/Conky/images/red+x.png}${image /media/5/Conky/images/red+x.png -p 0,0 -s 96x72}${else}nothing${endif}
${if_existing /media/5/Conky/images/green+x.png}${image /media/5/Conky/images/green+x.png -p 200,0 -s 96x72}${else}nothing${endif}

acvoW5LI.jpg

grzegorzdabrowka wrote:

5) how to do commend in .conkyrc:
${sudo open conky -c conkyrc2;}
${sudo open conky -c lua;}

No need for "sudo" to start a conky ..

ssc.sh to start and stop conkys:

#!/bin/bash
if [ "$(pidof conky)" ]; then
    killall conky
conky &
conky -c  /path/to/conkyrc2 &
    exit
else
conky &
conky -c  /path/to/conkyrc2 &
    exit
fi

if you have:
~/.conkyrc, and
~/.conkyrc2


conky will start ~/.conkyrc
conky -c ~/.conkyrc2 - will start the second conky

Start lua inside a conky, need more information

What lua script do you want to use?


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

Offline

#5248 2013-05-04 00:05:28

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

Re: Conky v1.9 Thread

ragamatrix wrote:

Hi !
I've just finished this; Thanks mr peachy for the help useful to create what I imagined...
thermoses_lua_weather:

OH MY!!!!!!!!!  Beautiful!  I like it ... consider it "borrowed"

Last edited by Sector11 (2013-05-04 00:06:45)


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

Offline

#5249 2013-05-04 08:57:48

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

Re: Conky v1.9 Thread

is it posssible to use underlined text in lua while u use different style (for example dashed)?

Offline

Help fund CrunchBang, donate to the project!

#5250 2013-05-04 13:19:31

ichase
#! CrunchBanger
Registered: 2011-03-16
Posts: 146

Re: Conky v1.9 Thread

Mr Peachy,
Thank you, would have helped if I actually READ the lau tutorial you spent so much time putting together.  My fault.  Works great.
56c61a252573361.jpg

Think I am good.............for now.   8o

63052a252633418.jpg

Last edited by ichase (2013-05-04 18:35:32)

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