You are not logged in.

#851 2018-02-06 21:12:11

Alpetjr
Member
Registered: 2018-01-11
Posts: 13

Re: Show us your conky

martix wrote:
TeoBigusGeekus wrote:
martix wrote:

Recently a general question regarding conky popped in my mind:

Getting things like battery info or fan info grabs data from the root part of the system.

However when I edit conkyrc, I do not need sudo (i.e. root privileges).

Is there maybe a genaral explanation how conky gets root data without having root privileges?

You don't need to be root to read your system's /proc and /sys folders.

Look at your /sys/class/power_supply/BAT0 file, which has info about your battery; anyone can read it.

Indeed, I can read those files in the BAT0 folder without sudo. I'm wondering why I needed sudo, when I tried to edit conkyrc on an ubuntu machine?
Also when I gave conkyrc from Bunsenlabs to users on different distros, without sudo it did not show all the data (e.g. not for fan speed, battery, etc.).

I,m using Mate and I don't have to be root to show temps or battery.

${voffset 6}${goto 15}ACPI: ${color FFFFFF}${acpitemp}°F 
${color}HDD: ${color FFFFFF}${hddtemp /dev/sda}°F  ${color}
${voffset 4}${font StyleBats:size=9.9}${color2}k${voffset -2}${font DroidSansFallback:size=8.39}${color0}${offset 2}CPU Temp: $alignr${execi 600 sensors -f | grep 'Core 0' | awk '{print $3}' | cut -c2-9}
${exec sensors | grep "cpu_fan:" | sed 's/fan1/Cpu Fan/'}

Battery capacity:$alignr${execi 60 acpi | grep -Eo '[0-9]+%'}
remaining:$alignr${execi 60 acpi | grep -Eo '(:?[0-9]+){3}'}

with my Battery I have a extra % in it but it works. I even have it in lua with a bargragh and it works. The problem I have is showing Network speed in lua. if it is using bandwith it doesn't show it in graduated with speed. if I am downloading it is max, even if it is a slow download.

Offline

#852 2018-02-06 21:29:39

TeoBigusGeekus
BL DieHard
From: /Greece/Kastoria
Registered: 2015-10-04
Posts: 1,195

Re: Show us your conky

Head_on_a_Stick wrote:

^ I think some distributions now have sysfs restrictions in place, my stretch-based VM won't let me read the kernel ring buffer as a normal user.

Strange indeed. What'd be the purpose of these restrictions I wonder?


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#853 2018-02-07 10:06:10

ragamatrix
Member
Registered: 2015-10-04
Posts: 423

Re: Show us your conky

unklar wrote:

^ Thank you, loutch.

No, I don't have a chance. ops

I thought it was because of the writing "Japan", too.

But now I have found it, in both Conky's must be in the text.lua
to comment out the line (99). Then the display is correct. big_smile

		{
			text=conky_parse("${time %H:%M}"),
			font_name="FreeSans",
			font_size=36,
			h_align="c",
			bold=true,
			x=200,
			y=100,
			reflection_alpha=0.7,
			reflection_length=0.7,
			colour={{0,col0,1},{1,colbg,1}},
--			radial={0,-0,0,0,-80,70}        <---
		},

https://cdn.scrot.moe/images/2018/01/24/fehler_behoben.jpg

But I don't know anything about Lua.
I'm sure you know better than that.   wink

Thanks a lot unklar to solve this problem, I had the same lua problem, now I can replay with text.lua wink:
mini_18020711101874872.png

Offline

#854 2018-02-07 12:16:14

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: Show us your conky

^Nice conky, gives a great overview.

Does the way using LUA with
"lua_load = '$HOME/.config/conky/LUA/draw-bg.lua'," in conky.config and

"${lua conky_draw_bg 15 0 0 0 0 0x000000 0.25}" in conky.text

still gives a blinking conky without a composite manager?

Offline

#855 2018-02-07 13:31:28

ragamatrix
Member
Registered: 2015-10-04
Posts: 423

Re: Show us your conky

thx martix, I'm not using draw_bg.lua anymore, I don't know why it's not working with my conky.v.10 version  hmm

Offline

#856 2018-02-07 14:33:04

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: Show us your conky

@ragamatrix If I've seen correctly, there are two ways using it:

In conky.config:
lua_load = '$HOME/.config/conky/LUA/draw-bg.lua',

and

in conky.text:
${lua conky_draw_bg 15 0 0 0 0 0x000000 0.25}

OR

Both lines in conky.config:

lua_load = '$HOME/.config/conky/LUA/draw-bg.lua',
lua_draw_hook_pre = 'draw_bg 15 0 0 0 0 0x000000 0.25',

Do both of these methods refuse to work?

Last edited by martix (2018-02-07 14:35:03)

Offline

#857 2018-02-07 15:28:03

unklar
Member
Registered: 2015-10-31
Posts: 1,026

Re: Show us your conky

ragamatrix wrote:

Thanks a lot unklar to solve this problem, I had the same lua problem, now I can replay with text.lua  wink
mini_18020711101874872.png

^ ragamatrix, always happy to help, if I can help (but that was coincidence)  lol

martix wrote:

still gives a blinking conky without a composite manager?

you should post the upper part of your conky.conf (is that openbox/compton?)

Offline

#858 2018-02-07 16:38:51

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: Show us your conky

@unklar It's working fine for me (with openbox/compton), I'm just asking if anyone is still having that issue with conky. However I guess here every user has a composite manager, so that might not be an issue at all.

Offline

#859 2018-02-08 09:56:46

unklar
Member
Registered: 2015-10-31
Posts: 1,026

Re: Show us your conky

wink

Offline

#860 2018-02-08 20:16:11

unklar
Member
Registered: 2015-10-31
Posts: 1,026

Re: Show us your conky

https://forums.bunsenlabs.org/viewtopic … 929#p67929

^ It was tedious (as a Lua Ignorant  big_smile ) but a very big improvement with the syntax 1.10 in Conky and the draw_bg.lua script.
The "corners" are still uneven. Transparency works.
The Conky can be moved with' Alt+Right mouse button'. smile

indian1.th.png  indian2.th.png

Great work!

Offline

#861 2018-02-09 01:02:05

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: Show us your conky

@unklar I suspect that the corner issue might come from moving around the conky. At least the corners looked perfect here, but now after trying alt+right mouse button (which worked great) I realized that those corners do not look good anymore.

There is a question I'd like to ask.

lua_draw_hook_pre means: "This function, if defined, will be called by Conky through each iteration before drawing to the window. Requires X support. Takes any number of optional arguments. Use this hook for drawing things on top of what Conky draws."

With draw-bg it's e.g.: lua_draw_hook_pre = 'draw_bg 15 0 0 0 0 0x000000 0.25',

Now what is the difference (in plain human language) between this OR using ${lua conky_draw_bg 15 0 0 0 0 0x000000 0.25} in conky.text?

Offline

#862 2018-02-09 06:46:30

TeoBigusGeekus
BL DieHard
From: /Greece/Kastoria
Registered: 2015-10-04
Posts: 1,195

Re: Show us your conky

I've got a new gpu and a 4k monitor, so conky space has dramatically increased.

DxCBtXIt.jpg

dbItcZbt.jpg


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#863 2018-02-09 08:19:15

Indian
Member
Registered: 2018-02-05
Posts: 23

Re: Show us your conky

martix wrote:

With draw-bg it's e.g.: lua_draw_hook_pre = 'draw_bg 15 0 0 0 0 0x000000 0.25',

Now what is the difference (in plain human language) between this OR using ${lua conky_draw_bg 15 0 0 0 0 0x000000 0.25} in conky.text?

If you call draw_bg with lua_draw_hook_pre the shadow appears at the background, if you call draw_bg with lua_draw_hook_post the text appears at bottom and the shadow is in the top, if you call draw_bg in the text i think it's the same as lua_draw_hook_pre.

Offline

#864 2018-02-09 10:42:40

unklar
Member
Registered: 2015-10-31
Posts: 1,026

Re: Show us your conky

^ Thank you very much, Indian.  smile

@martix,

In addition, I would like to mention our Conkystador, Sector11, in connection with it:
- transparency
- Type of desktop and composite manager used

answer.  e.g.
https://forums.bunsenlabs.org/viewtopic … 059#p11059
https://forums.bunsenlabs.org/viewtopic … 735#p27735


We hope to include as much as possible in the syntax of version 1.10 as possible.  wink


@Teo,
this is verry good. Still, I don't quite understand what you mean (I'm already old)  devil  lol

Offline

#865 2018-02-09 10:47:46

ragamatrix
Member
Registered: 2015-10-04
Posts: 423

Re: Show us your conky

martix wrote:

@ragamatrix If I've seen correctly, there are two ways using it:

In conky.config:
lua_load = '$HOME/.config/conky/LUA/draw-bg.lua',

and

in conky.text:
${lua conky_draw_bg 15 0 0 0 0 0x000000 0.25}

OR

Both lines in conky.config:

lua_load = '$HOME/.config/conky/LUA/draw-bg.lua',
lua_draw_hook_pre = 'draw_bg 15 0 0 0 0 0x000000 0.25',

Do both of these methods refuse to work?

Thanks, I'll try every draw_bg.lua stuffs when I'll come back, I'm leaving for few days: no more linux tweaking  big_smile

Offline

#866 2018-02-09 11:57:01

TeoBigusGeekus
BL DieHard
From: /Greece/Kastoria
Registered: 2015-10-04
Posts: 1,195

Re: Show us your conky

unklar wrote:

@Teo,
this is verry good. Still, I don't quite understand what you mean (I'm already old)  devil  lol

Thanks a lot unklar. I wanted to say that I've got a new graphics card and a 3840x2160 (ie. 4K) monitor.


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#867 2018-02-09 12:19:20

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: Show us your conky

@Indian @unklar Thank you for the clarification.

Those Sector11 posts are great, sometimes they are hard to find in the haystack. There are really nice lua-conkys, this weather conky was posted by Sector11 before:
http://postimg.org/image/uz4zqt3k9/

Offline

#868 2018-02-10 15:51:07

unklar
Member
Registered: 2015-10-31
Posts: 1,026

Re: Show us your conky

ragamatrix wrote:

Thanks, I'll try every draw_bg.lua stuffs when I'll come back, I'm leaving for few days: no more linux tweaking  big_smile

^come back healthy, you're still needed here!  wink

TeoBigusGeekus wrote:

Thanks a lot unklar. I wanted to say that I've got a new graphics card and a 3840x2160 (ie. 4K) monitor.

^OMG, this is a dream, 4K. I have to see if "my government" can't realize the coming Christmas celebration for Easter already....   devil  cool

martix wrote:

Those Sector11 posts are great, sometimes they are hard to find in the haystack. There are really nice lua-conkys, this weather conky was posted by Sector11 before:
http://postimg.org/image/uz4zqt3k9/

smile  I have them all, I've studied them all, what the Conky master created.

Offline

#869 2018-02-10 16:24:27

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: Show us your conky

^Yeah, those conkys are truly work of art.

Offline

#870 2018-02-11 18:17:30

loutch
Member
Registered: 2015-12-12
Posts: 391

Re: Show us your conky

Hello guys

here is a new radiotray conky who does 2 things

1- if there is an artist and a title he will display the name and the title of the song as well as the cover of the album

like this

1518372720.png

- if the radio shows "playing"

1518372756.png

it will not show anything and will display the radio logo

1518372800.png

conkyrc

background yes
use_xft yes
xftfont Liberation Sans:size=7
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
#own_window_color 000000
own_window_argb_visual yes
#own_window_argb_value 0
own_window_type normal
own_window_hints undecorated,below,skip_taskbar,skip_pager
double_buffer yes
minimum_size 200 180
maximum_width 200
text_buffer_size 2048
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_outline_color white
alignment tl
gap_x 10
gap_y 800
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
#imlib_cache_flush_interval 60
imlib_cache_size 0


# Taille des pointillés
stippled_borders 5

# Couleurs
default_color ffffff#ffd579
default_shade_color 333333
default_outline_color black

lua_load ~/.conky/lua/image.lua


TEXT

${lua fDrawImage ~/.conky/radiotray/images/caset.png 00 00 150 150}
${voffset 120}${if_match "${execi 5 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray getCurrentMetaData| fold -s -w30}" == "Playing"} 
${else}${execi 5 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray getCurrentMetaData| fold -s -w30 }${endif}
${execi 5 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray getCurrentMetaData| fold -s -w30 > ~/.conky/radiotray/artiste_titre.txt}
${execi 5 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray net.sourceforge.radiotray.getCurrentRadio > ~/.conky/radiotray/logo.txt}
${texeci 5 ~/.conky/radiotray/pochette.sh}${texeci 2 ~/.conky/radiotray/logo.sh}
${if_match "${execi 5 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray getCurrentMetaData| fold -s -w30}" == "Playing"}${lua fDrawImage ~/.conky/radiotray/logo.png 19 19 112 112}
${else}${lua fDrawImage ~/.conky/radiotray/pochette.png 19 19 112 112}${endif}
${voffset -1000}

logo.sh

 
#!bin/bash
# créé par loutch

 
titre=$(head -1 ~/.conky/radiotray/logo.txt)
lienMiniature=$(wget -U'Googlebot-Image/1.0' -qO - "www.google.fr/search?q=$titre\&tbm=isch" | perl -pe 's!.*?<img .*?src="([^"]*)".*!$1!')
wget -qO Googlelogo $lienMiniature

convert ~/Googlelogo ~/.conky/radiotray/logo.png

pochette.sh

 
#!bin/bash
#créé par loutch

 
titre=$(head -1 ~/.conky/radiotray/artiste_titre.txt)
lienMiniature=$(wget -U'Googlebot-Image/1.0' -qO - "www.google.fr/search?q=$titre\&tbm=isch" | perl -pe 's!.*?<img .*?src="([^"]*)".*!$1!')
wget -qO miniatureGoogleImage $lienMiniature

convert ~/miniatureGoogleImage ~/.conky/radiotray/pochette.png

@+


Linuxmint 19.1 Tessa cinnamon & mageia 7 mate on ssd hp pavilion g7
Xubuntu 18.04 lts & 19.04 xfce on ASUS Rog STRIX

Offline

#871 2018-02-12 11:08:43

Alpetjr
Member
Registered: 2018-01-11
Posts: 13

Re: Show us your conky

I made some headway on my weather conky but now I am stuck. It updates but I have error message that I don't know about. Any help would be very appreciated. Thanks

al@al-X55CR:~$ conky -c ~/wea_conky/Vert-Weather &
[1] 32685
al@al-X55CR:~$ conky: desktop window (1200006) is subwindow of root window (108)
conky: window type - normal
conky: drawing to created window (0x4a00002)
conky: drawing to double buffer
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  116k  100  116k    0     0   116k      0  0:00:01 --:--:--  0:00:01  290k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  116k  100  116k    0     0   116k      0  0:00:01 --:--:--  0:00:01  486k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  116k  100  116k    0     0  39885      0  0:00:03  0:00:03 --:--:-- 35537
conky: llua_do_call: function conky_weatherdata execution failed: /home/al/wea_conky/forecast_VW.lua:270: attempt to call a nil value
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  116k  100  116k    0     0   116k      0  0:00:01 --:--:--  0:00:01  404k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  116k  100  116k    0     0   116k      0  0:00:01 --:--:--  0:00:01  405k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  116k  100  116k    0     0   116k      0  0:00:01  0:00:01 --:--:-- 81788
conky: llua_do_call: function conky_weatherdata execution failed: /home/al/wea_conky/forecast_VW.lua:270: attempt to call a nil value
conky: llua_do_call: function conky_draw_bg execution failed: attempt to call a nil value
conky: llua_do_call: function conky_weather execution failed: [string "return image.now"]:1: attempt to index global 'image' (a nil value)
conky: llua_do_call: function conky_weather execution failed: [string "return image.day1"]:1: attempt to index global 'image' (a nil value)
conky: llua_do_call: function conky_weather execution failed: [string "return moonfont.day1"]:1: attempt to index global 'moonfont' (a nil value)
conky: llua_do_call: function conky_weather execution failed: [string "return image.day2"]:1: attempt to index global 'image' (a nil value)

forecast_VW.lua

--[[weather display by mrpeachy nov 2011

version 6
call data via conkyrc
ability to display weather images
]]
--#########################################################################################################
--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP--SETUP
secs=1800--set update interval
web="http://www.intellicast.com/Local/Forecast.aspx?location=USOH1015"--insert unit=C& after? for C
--get web address by going to the intellicast site and entering your location in the box
--for version 3 you must get click on "Extended Forecast" to get the necessary address
units="F"
--set location where weather data txt will be saved
location="home/al/wea_conky/weather.txt"
--set location of weather images
weathericons="~/weathericons/"
--#########################################################################################################
require 'imlib2'
require 'cairo'
------------------------------------------------------------------------------
function string:split(delimiter)
local result = { }
local from  = 1
local delim_from, delim_to = string.find( self, delimiter, from  )
while delim_from do
table.insert( result, string.sub( self, from , delim_from-1 ) )
from  = delim_to + 1
delim_from, delim_to = string.find( self, delimiter, from  )
end
table.insert( result, string.sub( self, from  ) )
return result
end
--------------------------------------------------------------------------------
--###################################
function conky_weatherdata()--#######
--###################################
--table to convert intellicast images to icons and fonts
wimage={
wx_65="32,a",
wx_66="30,c",
wx_67="26,f",
wx_68="32,a",
wx_69="28,d",
wx_70="20,0",
wx_71="32,a",
wx_72="21,9",
wx_73="36,5",
wx_74="14,p",
wx_75="28,d",
wx_76="18,w",
wx_77="14,p",
wx_78="23,6",
wx_79="05,x",
wx_80="15,8",
wx_81="15,8",
wx_82="11,h",
wx_83="16,q",
wx_84="00,m",
wx_85="32,a",
wx_86="25,-",
wx_87="09,h",
wx_88="05,x",
wx_89="18,w",
wx_90="18,w",
wx_91="39,g",
wx_92="39,g",
wx_93="39,g",
wx_94="39,g",
wx_95="37,k",
wx_96="37,k",
wx_97="31,A",
wx_98="29,C",
wx_99="27,D",
wx_100="47,K",
wx_101="47,K",
wx_102="33,B",
wx_103="26,f",
wx_104="20,0",
wx_105="45,G",
wx_106="45,G",
wx_107="11,h",--or 40 if heavy?
wx_108="46,O",
wx_109="46,O",
wx_110="06,x",
wx_111="18,w",
wx_112="06,x",
wx_113="46,O",
wx_114="46,O",
wx_115="31,A",
wx_116="47,K",
}--end table
--table to convert wind direction to font and images
windfontt={S="9",SSW=":",SW=";",WSW="<",W="=",WNW=">",NW="?",NNW="@",N="1",NNE="2",NE="3",ENE="4",E="5",ESE="6",SE="7",SSE="8"}
windicont={S="1",SSW="2",SW="3",WSW="4",W="5",WNW="6",NW="7",NNW="8",N="9",NNE=":",NE=";",ENE="<",E="=",ESE=">",SE="?",SSE="@"}
--table to convert moonphase to font and image
moonfontt={New="=",Full="@",FirstQuarter="G",LastQuarter="T",WaningGibbous="R",WaningCrescent="V",WaxingCrescent="E",WaxingGibbous="I"}
moonicont={New="=",Full="@",FirstQuarter="G",LastQuarter="T",WaningGibbous="R",WaningCrescent="V",WaxingCrescent="E",WaxingGibbous="I"}

--##################################################
--######data gatering and initial processing########
--##################################################
local updates=tonumber(conky_parse('${updates}'))
local timer=(updates %secs)+1
if timer==1 or updates==0 then
--gets current data
local f=io.popen("curl '"..web.."' | grep -A62 'As of ' | gawk -F'>' -v RS='</' 'RT{print $NF}' | sed -e 's/^[ \t]*//' -e '/^$/d' -e 's/&deg;//g' -e 's/%//g' -e 's/  / /g' -e 's/Thunderstorms/T.Storms/g'")
data1=f:read("*a")
f:close()
local data2=string.split(data1,"\n")
data={}
for i,v in pairs(data2) do
if string.find(v,"[%a%d]")~=nil then
table.insert(data,data2[i])
end
end
--gets forecast data
local f=io.popen("curl '"..web.."' | grep -A554 'View the Calendar Forecast' | gawk -F'>' -v RS='<' 'RT{print $NF}' | sed -e 's/^[ \t]*//' -e 's/&deg;//g' -e 's/  / /g' -e 's/%//g' -e 's/&deg//g' -e 's/Thunderstorms/T.Storms/g'")
local fdata1=f:read("*a")
f:close()
local fdata=string.split(fdata1,"\n")
fdata2={}
for i,v in pairs(fdata) do
if string.find(v,"[%a%d]")~=nil then
table.insert(fdata2,fdata[i])
end
end
--gets weather image codes
local f=io.popen("curl '"..web.."' | gawk -F'App_Images' -v RS='.png' 'RT{print $NF}'")
icondata1=f:read("*a")
f:close()
local icondata=string.split(icondata1,"\n")
icondata2={}
for i,v in pairs(icondata) do
if string.find(v,"32_white")==nil then
table.insert(icondata2,icondata[i])
end
end
--##################################################
--######data processing#############################
--##################################################
--current conditions
local cdn=string.split(data[2],"/")
if cdn[2]==nil then cd2=""
else
cd2="/"..string.gsub(cdn[2],"[\r\n]","")
end
local wdr=string.split(data[25]," ")
now={con=string.gsub(cdn[1],"[\r\n]",""),tmp=string.gsub(data[4],units,""),flk=string.gsub(data[5],"Feels Like: ",""),wch=data[7],cel=data[10],hid=data[12],vis=string.gsub(data[15],"[ %a]",""),dpt=data[17],wsp=string.gsub(data[20],"[ %a]",""),wdg=(wdr[1]),wdi=string.gsub(wdr[2],"[%(%)\n\r]",""),wgs=string.gsub(data[30]," mph",""),hum=data[22],prs=string.gsub(data[27],"\"",""),cd2=cd2}
--forecast days
local cdn=string.split(fdata2[3],"/")
if cdn[2]==nil then cd2=""
else
cd2="/"..cdn[2]
end
local dyt=string.split(fdata2[2],",")
local uvi=string.split(fdata2[20]," ")
local wsp=string.split(fdata2[32]," ")
local wdr=string.split(fdata2[34]," ")
day1={day=dyt[1],dat=string.gsub(dyt[2],"^.",""),con=cdn[1],hih=fdata2[4],low=fdata2[5],sri=fdata2[8],sst=fdata2[10],mri=fdata2[12],mst=fdata2[14],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[22],ppt=fdata2[24],snw=fdata2[26],cld=fdata2[28],mph=fdata2[30],wmh=string.gsub(wsp[1],"[%a]",""),wkm=string.gsub(wsp[2],"[%a%(,]",""),wkt=string.gsub(wsp[3],"[%a%)]",""),wdg=wdr[1],wdi=string.gsub(wdr[2],"[%(%)\n\r]",""),cd2=cd2}
--day2
local cdn=string.split(fdata2[36],"/")
if cdn[2]==nil then cd2=""
else
cd2="/"..cdn[2]
end
local dyt=string.split(fdata2[35],",")
local uvi=string.split(fdata2[53]," ")
local wsp=string.split(fdata2[65]," ")
local wdr=string.split(fdata2[67]," ")
day2={day=dyt[1],dat=string.gsub(dyt[2],"^.",""),con=cdn[1],hih=fdata2[37],low=fdata2[38],sri=fdata2[41],sst=fdata2[43],mri=fdata2[45],mst=fdata2[47],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[55],ppt=fdata2[57],snw=fdata2[59],cld=fdata2[61],mph=fdata2[63],wmh=string.gsub(wsp[1],"[%a]",""),wkm=string.gsub(wsp[2],"[%a%(,]",""),wkt=string.gsub(wsp[3],"[%a%)]",""),wdg=wdr[1],wdi=string.gsub(wdr[2],"[%(%)\n\r]",""),cd2=cd2}
--day3
local start=68
local cdn=string.split(fdata2[start+1],"/")
if cdn[2]==nil then cd2=""
else
cd2="/"..cdn[2]
end
local dyt=string.split(fdata2[start],",")
local uvi=string.split(fdata2[start+14]," ")
local wsp=string.split(fdata2[start+26]," ")
local wdr=string.split(fdata2[start+28]," ")
day3={day=dyt[1],dat=string.gsub(dyt[2],"^.",""),con=cdn[1],hih=fdata2[start+2],low=fdata2[start+3],sri=fdata2[start+5],sst=fdata2[start+7],mri=fdata2[start+9],mst=fdata2[start+11],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[start+16],ppt=fdata2[start+18],snw=fdata2[start+20],cld=fdata2[start+22],mph=fdata2[start+24],wmh=string.gsub(wsp[1],"[%a]",""),wkm=string.gsub(wsp[2],"[%a%(,]",""),wkt=string.gsub(wsp[3],"[%a%)]",""),wdg=wdr[1],wdi=string.gsub(wdr[2],"[%(%)\n\r]",""),cd2=cd2}
--day4
local start=start+29
local cdn=string.split(fdata2[start+1],"/")
if cdn[2]==nil then cd2=""
else
cd2="/"..cdn[2]
end
local dyt=string.split(fdata2[start],",")
local uvi=string.split(fdata2[start+14]," ")
local wsp=string.split(fdata2[start+26]," ")
local wdr=string.split(fdata2[start+28]," ")
day4={day=dyt[1],dat=string.gsub(dyt[2],"^.",""),con=cdn[1],hih=fdata2[start+2],low=fdata2[start+3],sri=fdata2[start+5],sst=fdata2[start+7],mri=fdata2[start+9],mst=fdata2[start+11],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[start+16],ppt=fdata2[start+18],snw=fdata2[start+20],cld=fdata2[start+22],mph=fdata2[start+24],wmh=string.gsub(wsp[1],"[%a]",""),wkm=string.gsub(wsp[2],"[%a%(,]",""),wkt=string.gsub(wsp[3],"[%a%)]",""),wdg=wdr[1],wdi=string.gsub(wdr[2],"[%(%)\n\r]",""),cd2=cd2}
--day5
local start=start+29
local cdn=string.split(fdata2[start+1],"/")
if cdn[2]==nil then cd2=""
else
cd2="/"..cdn[2]
end
local dyt=string.split(fdata2[start],",")
local uvi=string.split(fdata2[start+14]," ")
local wsp=string.split(fdata2[start+26]," ")
local wdr=string.split(fdata2[start+28]," ")
day5={day=dyt[1],dat=string.gsub(dyt[2],"^.",""),con=cdn[1],hih=fdata2[start+2],low=fdata2[start+3],sri=fdata2[start+5],sst=fdata2[start+7],mri=fdata2[start+9],mst=fdata2[start+11],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[start+16],ppt=fdata2[start+18],snw=fdata2[start+20],cld=fdata2[start+22],mph=fdata2[start+24],wmh=string.gsub(wsp[1],"[%a]",""),wkm=string.gsub(wsp[2],"[%a%(,]",""),wkt=string.gsub(wsp[3],"[%a%)]",""),wdg=wdr[1],wdi=string.gsub(wdr[2],"[%(%)\n\r]",""),cd2=cd2}
--day6
local start=start+29
local cdn=string.split(fdata2[start+1],"/")
if cdn[2]==nil then cd2=""
else
cd2="/"..cdn[2]
end
local dyt=string.split(fdata2[start],",")
local uvi=string.split(fdata2[start+14]," ")
local wsp=string.split(fdata2[start+26]," ")
local wdr=string.split(fdata2[start+28]," ")
day6={day=dyt[1],dat=string.gsub(dyt[2],"^.",""),con=cdn[1],hih=fdata2[start+2],low=fdata2[start+3],sri=fdata2[start+5],sst=fdata2[start+7],mri=fdata2[start+9],mst=fdata2[start+11],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[start+16],ppt=fdata2[start+18],snw=fdata2[start+20],cld=fdata2[start+22],mph=fdata2[start+24],wmh=string.gsub(wsp[1],"[%a]",""),wkm=string.gsub(wsp[2],"[%a%(,]",""),wkt=string.gsub(wsp[3],"[%a%)]",""),wdg=wdr[1],wdi=string.gsub(wdr[2],"[%(%)\n\r]",""),cd2=cd2}
--day7
local start=start+29
local cdn=string.split(fdata2[start+1],"/")
if cdn[2]==nil then cd2=""
else
cd2="/"..cdn[2]
end
local dyt=string.split(fdata2[start],",")
local uvi=string.split(fdata2[start+14]," ")
local wsp=string.split(fdata2[start+26]," ")
local wdr=string.split(fdata2[start+28]," ")
day7={day=dyt[1],dat=string.gsub(dyt[2],"^.",""),con=cdn[1],hih=fdata2[start+2],low=fdata2[start+3],sri=fdata2[start+5],sst=fdata2[start+7],mri=fdata2[start+9],mst=fdata2[start+11],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[start+16],ppt=fdata2[start+18],snw=fdata2[start+20],cld=fdata2[start+22],mph=fdata2[start+24],wmh=string.gsub(wsp[1],"[%a]",""),wkm=string.gsub(wsp[2],"[%a%(,]",""),wkt=string.gsub(wsp[3],"[%a%)]",""),wdg=wdr[1],wdi=string.gsub(wdr[2],"[%(%)\n\r]",""),cd2=cd2}
--day8
local start=start+29
local cdn=string.split(fdata2[start+1],"/")
if cdn[2]==nil then cd2=""
else
cd2="/"..cdn[2]
end
local dyt=string.split(fdata2[start],",")
local uvi=string.split(fdata2[start+14]," ")
local wsp=string.split(fdata2[start+26]," ")
local wdr=string.split(fdata2[start+28]," ")
day8={day=dyt[1],dat=string.gsub(dyt[2],"^.",""),con=cdn[1],hih=fdata2[start+2],low=fdata2[start+3],sri=fdata2[start+5],sst=fdata2[start+7],mri=fdata2[start+9],mst=fdata2[start+11],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[start+16],ppt=fdata2[start+18],snw=fdata2[start+20],cld=fdata2[start+22],mph=fdata2[start+24],wmh=string.gsub(wsp[1],"[%a]",""),wkm=string.gsub(wsp[2],"[%a%(,]",""),wkt=string.gsub(wsp[3],"[%a%)]",""),wdg=wdr[1],wdi=string.gsub(wdr[2],"[%(%)\n\r]",""),cd2=cd2}
--day9
local start=start+29
local cdn=string.split(fdata2[start+1],"/")
if cdn[2]==nil then cd2=""
else
cd2="/"..cdn[2]
end
local dyt=string.split(fdata2[start],",")
local uvi=string.split(fdata2[start+14]," ")
local wsp=string.split(fdata2[start+26]," ")
local wdr=string.split(fdata2[start+28]," ")
day9={day=dyt[1],dat=string.gsub(dyt[2],"^.",""),con=cdn[1],hih=fdata2[start+2],low=fdata2[start+3],sri=fdata2[start+5],sst=fdata2[start+7],mri=fdata2[start+9],mst=fdata2[start+11],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[start+16],ppt=fdata2[start+18],snw=fdata2[start+20],cld=fdata2[start+22],mph=fdata2[start+24],wmh=string.gsub(wsp[1],"[%a]",""),wkm=string.gsub(wsp[2],"[%a%(,]",""),wkt=string.gsub(wsp[3],"[%a%)]",""),wdg=wdr[1],wdi=string.gsub(wdr[2],"[%(%)\n\r]",""),cd2=cd2}
--day10
local start=start+29
local cdn=string.split(fdata2[start+1],"/")
if cdn[2]==nil then cd2=""
else
cd2="/"..cdn[2]
end
local dyt=string.split(fdata2[start],",")
local uvi=string.split(fdata2[start+14]," ")
local wsp=string.split(fdata2[start+26]," ")
local wdr=string.split(fdata2[start+28]," ")
day10={day=dyt[1],dat=string.gsub(dyt[2],"^.",""),con=cdn[1],hih=fdata2[start+2],low=fdata2[start+3],sri=fdata2[start+5],sst=fdata2[start+7],mri=fdata2[start+9],mst=fdata2[start+11],uvn=uvi[1],uvt=string.gsub(uvi[2],"[%(%)]",""),hum=fdata2[start+16],ppt=fdata2[start+18],snw=fdata2[start+20],cld=fdata2[start+22],mph=fdata2[start+24],wmh=string.gsub(wsp[1],"[%a]",""),wkm=string.gsub(wsp[2],"[%a%(,]",""),wkt=string.gsub(wsp[3],"[%a%)]",""),wdg=wdr[1],wdi=string.gsub(wdr[2],"[%(%)\n\r]",""),cd2=cd2}
--##################################################
--######font and image processing###################
--##################################################
nowif=string.split((loadstring("return ".."wimage."..string.gsub(icondata2[1],"/40_white/",""))()),",")
day1if=string.split((loadstring("return ".."wimage."..string.gsub(icondata2[2],"/40_white/",""))()),",")
day2if=string.split((loadstring("return ".."wimage."..string.gsub(icondata2[3],"/40_white/",""))()),",")
day3if=string.split((loadstring("return ".."wimage."..string.gsub(icondata2[4],"/40_white/",""))()),",")
day4if=string.split((loadstring("return ".."wimage."..string.gsub(icondata2[5],"/40_white/",""))()),",")
day5if=string.split((loadstring("return ".."wimage."..string.gsub(icondata2[6],"/40_white/",""))()),",")
day6if=string.split((loadstring("return ".."wimage."..string.gsub(icondata2[7],"/40_white/",""))()),",")
day7if=string.split((loadstring("return ".."wimage."..string.gsub(icondata2[8],"/40_white/",""))()),",")
day8if=string.split((loadstring("return ".."wimage."..string.gsub(icondata2[9],"/40_white/",""))()),",")
day9if=string.split((loadstring("return ".."wimage."..string.gsub(icondata2[10],"/40_white/",""))()),",")
day10if=string.split((loadstring("return ".."wimage."..string.gsub(icondata2[11],"/40_white/",""))()),",")
---------------------------------------------------
image={now=nowif[1],day1=day1if[1],day2=day2if[1],day3=day3if[1],day4=day4if[1],day5=day5if[1],day6=day6if[1],day7=day7if[1],day8=day8if[1],day9=day9if[1],day10=day10if[1]}
font={now=nowif[2],day1=day1if[2],day2=day2if[2],day3=day3if[2],day4=day4if[2],day5=day5if[2],day6=day6if[2],day7=day7if[2],day8=day8if[2],day9=day9if[2],day10=day10if[2]}
--wind font-----------------------------------------
print ((loadstring("return ".."windfontt."..day1.wdi)()))
windfont={
now=(loadstring("return ".."windfontt."..now.wdi)()),
day1=(loadstring("return ".."windfontt."..day1.wdi)()),
day2=(loadstring("return ".."windfontt."..day2.wdi)()),
day3=(loadstring("return ".."windfontt."..day3.wdi)()),
day4=(loadstring("return ".."windfontt."..day4.wdi)()),
day5=(loadstring("return ".."windfontt."..day5.wdi)()),
day6=(loadstring("return ".."windfontt."..day6.wdi)()),
day7=(loadstring("return ".."windfontt."..day7.wdi)()),
day8=(loadstring("return ".."windfontt."..day8.wdi)()),
day9=(loadstring("return ".."windfontt."..day9.wdi)()),
day10=(loadstring("return ".."windfontt."..day10.wdi)()),
}
--wind image----------------------------------------
windicon={
now=(loadstring("return ".."windicont."..now.wdi)()),
day1=(loadstring("return ".."windicont."..day1.wdi)()),
day2=(loadstring("return ".."windicont."..day2.wdi)()),
day3=(loadstring("return ".."windicont."..day3.wdi)()),
day4=(loadstring("return ".."windicont."..day4.wdi)()),
day5=(loadstring("return ".."windicont."..day5.wdi)()),
day6=(loadstring("return ".."windicont."..day6.wdi)()),
day7=(loadstring("return ".."windicont."..day7.wdi)()),
day8=(loadstring("return ".."windicont."..day8.wdi)()),
day9=(loadstring("return ".."windicont."..day9.wdi)()),
day10=(loadstring("return ".."windicont."..day10.wdi)()),
}
--moon font-----------------------------------------
--print (day1.mph,(loadstring("return ".."moonfontt."..string.gsub(day1.mph," ",""))()))
moonfont={
day1=(loadstring("return ".."moonfontt."..string.gsub(day1.mph," ",""))()),
day2=(loadstring("return ".."moonfontt."..string.gsub(day2.mph," ",""))()),
day3=(loadstring("return ".."moonfontt."..string.gsub(day3.mph," ",""))()),
day4=(loadstring("return ".."moonfontt."..string.gsub(day4.mph," ",""))()),
day5=(loadstring("return ".."moonfontt."..string.gsub(day5.mph," ",""))()),
day6=(loadstring("return ".."moonfontt."..string.gsub(day6.mph," ",""))()),
day7=(loadstring("return ".."moonfontt."..string.gsub(day7.mph," ",""))()),
day8=(loadstring("return ".."moonfontt."..string.gsub(day8.mph," ",""))()),
day9=(loadstring("return ".."moonfontt."..string.gsub(day9.mph," ",""))()),
day10=(loadstring("return ".."moonfontt."..string.gsub(day10.mph," ",""))()),
}
--moon icon-----------------------------------------
moonicon={
day1=(loadstring("return ".."moonicont."..string.gsub(day1.mph," ",""))()),
day2=(loadstring("return ".."moonicont."..string.gsub(day2.mph," ",""))()),
day3=(loadstring("return ".."moonicont."..string.gsub(day3.mph," ",""))()),
day4=(loadstring("return ".."moonicont."..string.gsub(day4.mph," ",""))()),
day5=(loadstring("return ".."moonicont."..string.gsub(day5.mph," ",""))()),
day6=(loadstring("return ".."moonicont."..string.gsub(day6.mph," ",""))()),
day7=(loadstring("return ".."moonicont."..string.gsub(day7.mph," ",""))()),
day8=(loadstring("return ".."moonicont."..string.gsub(day8.mph," ",""))()),
day9=(loadstring("return ".."moonicont."..string.gsub(day9.mph," ",""))()),
day10=(loadstring("return ".."moonicont."..string.gsub(day10.mph," ",""))()),
}
--##################################################
--##writing data to file for conkyrc restart########
--##################################################
local file = io.open(location, "w")
local datastringnow=now.con.."|"..now.tmp.."|"..now.flk.."|"..now.wch.."|"..now.cel.."|"..now.hid.."|"..now.vis.."|"..now.dpt.."|"..now.wsp.."|"..now.wdg.."|"..now.wdi.."|"..now.wgs.."|"..now.hum.."|"..now.prs.."|"..now.cd2
local datastringday1=day1.day.."|"..day1.dat.."|"..day1.con.."|"..day1.hih.."|"..day1.low.."|"..day1.sri.."|"..day1.sst.."|"..day1.mri.."|"..day1.mst.."|"..day1.uvn.."|"..day1.uvt.."|"..day1.hum.."|"..day1.ppt.."|"..day1.snw.."|"..day1.cld.."|"..day1.mph.."|"..day1.wmh.."|"..day1.wkm.."|"..day1.wkt.."|"..day1.wdg.."|"..day1.wdi.."|"..day1.cd2
local datastringday2=day2.day.."|"..day2.dat.."|"..day2.con.."|"..day2.hih.."|"..day2.low.."|"..day2.sri.."|"..day2.sst.."|"..day2.mri.."|"..day2.mst.."|"..day2.uvn.."|"..day2.uvt.."|"..day2.hum.."|"..day2.ppt.."|"..day2.snw.."|"..day2.cld.."|"..day2.mph.."|"..day2.wmh.."|"..day2.wkm.."|"..day2.wkt.."|"..day2.wdg.."|"..day2.wdi.."|"..day2.cd2
local datastringday3=day3.day.."|"..day3.dat.."|"..day3.con.."|"..day3.hih.."|"..day3.low.."|"..day3.sri.."|"..day3.sst.."|"..day3.mri.."|"..day3.mst.."|"..day3.uvn.."|"..day3.uvt.."|"..day3.hum.."|"..day3.ppt.."|"..day3.snw.."|"..day3.cld.."|"..day3.mph.."|"..day3.wmh.."|"..day3.wkm.."|"..day3.wkt.."|"..day3.wdg.."|"..day3.wdi.."|"..day3.cd2
local datastringday4=day4.day.."|"..day4.dat.."|"..day4.con.."|"..day4.hih.."|"..day4.low.."|"..day4.sri.."|"..day4.sst.."|"..day4.mri.."|"..day4.mst.."|"..day4.uvn.."|"..day4.uvt.."|"..day4.hum.."|"..day4.ppt.."|"..day4.snw.."|"..day4.cld.."|"..day4.mph.."|"..day4.wmh.."|"..day4.wkm.."|"..day4.wkt.."|"..day4.wdg.."|"..day4.wdi.."|"..day4.cd2
local datastringday5=day5.day.."|"..day5.dat.."|"..day5.con.."|"..day5.hih.."|"..day5.low.."|"..day5.sri.."|"..day5.sst.."|"..day5.mri.."|"..day5.mst.."|"..day5.uvn.."|"..day5.uvt.."|"..day5.hum.."|"..day5.ppt.."|"..day5.snw.."|"..day5.cld.."|"..day5.mph.."|"..day5.wmh.."|"..day5.wkm.."|"..day5.wkt.."|"..day5.wdg.."|"..day5.wdi.."|"..day5.cd2
local datastringday6=day6.day.."|"..day6.dat.."|"..day6.con.."|"..day6.hih.."|"..day6.low.."|"..day6.sri.."|"..day6.sst.."|"..day6.mri.."|"..day6.mst.."|"..day6.uvn.."|"..day6.uvt.."|"..day6.hum.."|"..day6.ppt.."|"..day6.snw.."|"..day6.cld.."|"..day6.mph.."|"..day6.wmh.."|"..day6.wkm.."|"..day6.wkt.."|"..day6.wdg.."|"..day6.wdi.."|"..day6.cd2
local datastringday7=day7.day.."|"..day7.dat.."|"..day7.con.."|"..day7.hih.."|"..day7.low.."|"..day7.sri.."|"..day7.sst.."|"..day7.mri.."|"..day7.mst.."|"..day7.uvn.."|"..day7.uvt.."|"..day7.hum.."|"..day7.ppt.."|"..day7.snw.."|"..day7.cld.."|"..day7.mph.."|"..day7.wmh.."|"..day7.wkm.."|"..day7.wkt.."|"..day7.wdg.."|"..day7.wdi.."|"..day7.cd2
local datastringday8=day8.day.."|"..day8.dat.."|"..day8.con.."|"..day8.hih.."|"..day8.low.."|"..day8.sri.."|"..day8.sst.."|"..day8.mri.."|"..day8.mst.."|"..day8.uvn.."|"..day8.uvt.."|"..day8.hum.."|"..day8.ppt.."|"..day8.snw.."|"..day8.cld.."|"..day8.mph.."|"..day8.wmh.."|"..day8.wkm.."|"..day8.wkt.."|"..day8.wdg.."|"..day8.wdi.."|"..day8.cd2
local datastringday9=day9.day.."|"..day9.dat.."|"..day9.con.."|"..day9.hih.."|"..day9.low.."|"..day9.sri.."|"..day9.sst.."|"..day9.mri.."|"..day9.mst.."|"..day9.uvn.."|"..day9.uvt.."|"..day9.hum.."|"..day9.ppt.."|"..day9.snw.."|"..day9.cld.."|"..day9.mph.."|"..day9.wmh.."|"..day9.wkm.."|"..day9.wkt.."|"..day9.wdg.."|"..day9.wdi.."|"..day9.cd2
local datastringday10=day10.day.."|"..day10.dat.."|"..day10.con.."|"..day10.hih.."|"..day10.low.."|"..day10.sri.."|"..day10.sst.."|"..day10.mri.."|"..day10.mst.."|"..day10.uvn.."|"..day10.uvt.."|"..day10.hum.."|"..day10.ppt.."|"..day10.snw.."|"..day10.cld.."|"..day10.mph.."|"..day10.wmh.."|"..day10.wkm.."|"..day10.wkt.."|"..day10.wdg.."|"..day10.wdi.."|"..day10.cd2
local datastringfont=font.now.."|"..font.day1.."|"..font.day2.."|"..font.day3.."|"..font.day4.."|"..font.day5.."|"..font.day6.."|"..font.day7.."|"..font.day8.."|"..font.day9.."|"..font.day10
local datastringimage=image.now.."|"..image.day1.."|"..image.day2.."|"..image.day3.."|"..image.day4.."|"..image.day5.."|"..image.day6.."|"..image.day7.."|"..image.day8.."|"..image.day9.."|"..image.day10
local datastringwindfont=windfont.now.."|"..windfont.day1.."|"..windfont.day2.."|"..windfont.day3.."|"..windfont.day4.."|"..windfont.day5.."|"..windfont.day6.."|"..windfont.day7.."|"..windfont.day8.."|"..windfont.day9.."|"..windfont.day10
local datastringwindicon=windicon.now.."|"..windicon.day1.."|"..windicon.day2.."|"..windicon.day3.."|"..windicon.day4.."|"..windicon.day5.."|"..windicon.day6.."|"..windicon.day7.."|"..windicon.day8.."|"..windicon.day9.."|"..windicon.day10
local datastringmoonfont=moonfont.day1.."|"..moonfont.day2.."|"..moonfont.day3.."|"..moonfont.day4.."|"..moonfont.day5.."|"..moonfont.day6.."|"..moonfont.day7.."|"..moonfont.day8.."|"..moonfont.day9.."|"..moonfont.day10
local datastringmoonicon=moonicon.day1.."|"..moonicon.day2.."|"..moonicon.day3.."|"..moonicon.day4.."|"..moonicon.day5.."|"..moonicon.day6.."|"..moonicon.day7.."|"..moonicon.day8.."|"..moonicon.day9.."|"..moonicon.day10
file:write(datastringnow.."<>"..datastringday1.."<>"..datastringday2.."<>"..datastringday3.."<>"..datastringday4.."<>:"..datastringday5.."<>"..datastringday6.."<>"..datastringday7.."<>"..datastringday8.."<>"..datastringday9.."<>"..datastringday10.."<>"..datastringfont.."<>"..datastringimage.."<>"..datastringwindfont.."<>"..datastringwindicon.."<>"..datastringmoonfont.."<>"..datastringmoonicon)
file:close()
end--timed section
--##################################################
--#read written data and process for conyrc restart#
--##################################################
if data1==nil then
local f=io.popen("cat '"..location.."'")
local alldata=f:read("*a")
f:close()
daydata=string.split(alldata,"<>")
now=string.split(daydata[1],"|")
day1=string.split(daydata[2],"|")
day2=string.split(daydata[3],"|")
day3=string.split(daydata[4],"|")
day4=string.split(daydata[5],"|")
day5=string.split(daydata[6],"|")
day6=string.split(daydata[7],"|")
day7=string.split(daydata[8],"|")
day8=string.split(daydata[9],"|")
day9=string.split(daydata[10],"|")
day10=string.split(daydata[11],"|")
font=string.split(daydata[12],"|")
image=string.split(daydata[13],"|")
windfont=string.split(daydata[14],"|")
windicon=string.split(daydata[15],"|")
moonfont=string.split(daydata[16],"|")
moonicon=string.split(daydata[17],"|")

--set individual data points
now={con=now[1],tmp=now[2],flk=now[3],wch=now[4],cel=now[5],hid=now[6],vis=now[7],dpt=now[8],wsp=now[9],wdg=now[10],wdi=now[11],wgs=now[12],hum=now[13],prs=now[14],cd2=now[15]}
day1={day=day1[1],dat=day1[2],con=day1[3],hih=day1[4],low=day1[5],sri=day1[6],sst=day1[7],mri=day1[8],mst=day1[9],uvn=day1[10],uvt=day1[11],hum=day1[12],ppt=day1[13],snw=day1[14],cld=day1[15],mph=day1[16],wmh=day1[17],wkm=day1[18],wkt=day1[19],wdg=day1[20],wdi=day1[21],cd2=day1[22]}
day2={day=day2[1],dat=day2[2],con=day2[3],hih=day2[4],low=day2[5],sri=day2[6],sst=day2[7],mri=day2[8],mst=day2[9],uvn=day2[10],uvt=day2[11],hum=day2[12],ppt=day2[13],snw=day2[14],cld=day2[15],mph=day2[16],wmh=day2[17],wkm=day2[18],wkt=day2[19],wdg=day2[20],wdi=day2[21],cd2=day2[22]}
day3={day=day3[1],dat=day3[2],con=day3[3],hih=day3[4],low=day3[5],sri=day3[6],sst=day3[7],mri=day3[8],mst=day3[9],uvn=day3[10],uvt=day3[11],hum=day3[12],ppt=day3[13],snw=day3[14],cld=day3[15],mph=day3[16],wmh=day3[17],wkm=day3[18],wkt=day3[19],wdg=day3[20],wdi=day3[21],cd2=day3[22]}
day4={day=day4[1],dat=day4[2],con=day4[3],hih=day4[4],low=day4[5],sri=day4[6],sst=day4[7],mri=day4[8],mst=day4[9],uvn=day4[10],uvt=day4[11],hum=day4[12],ppt=day4[13],snw=day4[14],cld=day4[15],mph=day4[16],wmh=day4[17],wkm=day4[18],wkt=day4[19],wdg=day4[20],wdi=day4[21],cd2=day4[22]}
day5={day=day5[1],dat=day5[2],con=day5[3],hih=day5[4],low=day5[5],sri=day5[6],sst=day5[7],mri=day5[8],mst=day5[9],uvn=day5[10],uvt=day5[11],hum=day5[12],ppt=day5[13],snw=day5[14],cld=day5[15],mph=day5[16],wmh=day5[17],wkm=day5[18],wkt=day5[19],wdg=day5[20],wdi=day5[21],cd2=day5[22]}
day6={day=day6[1],dat=day6[2],con=day6[3],hih=day6[4],low=day6[5],sri=day6[6],sst=day6[7],mri=day6[8],mst=day6[9],uvn=day6[10],uvt=day6[11],hum=day6[12],ppt=day6[13],snw=day6[14],cld=day6[15],mph=day6[16],wmh=day6[17],wkm=day6[18],wkt=day6[19],wdg=day6[20],wdi=day6[21],cd2=day6[22]}
day7={day=day7[1],dat=day7[2],con=day7[3],hih=day7[4],low=day7[5],sri=day7[6],sst=day7[7],mri=day7[8],mst=day7[9],uvn=day7[10],uvt=day7[11],hum=day7[12],ppt=day7[13],snw=day7[14],cld=day7[15],mph=day7[16],wmh=day7[17],wkm=day7[18],wkt=day7[19],wdg=day7[20],wdi=day7[21],cd2=day7[22]}
day8={day=day8[1],dat=day8[2],con=day8[3],hih=day8[4],low=day8[5],sri=day8[6],sst=day8[7],mri=day8[8],mst=day8[9],uvn=day8[10],uvt=day8[11],hum=day8[12],ppt=day8[13],snw=day8[14],cld=day8[15],mph=day8[16],wmh=day8[17],wkm=day8[18],wkt=day8[19],wdg=day8[20],wdi=day8[21],cd2=day8[22]}
day9={day=day9[1],dat=day9[2],con=day9[3],hih=day9[4],low=day9[5],sri=day9[6],sst=day9[7],mri=day9[8],mst=day9[9],uvn=day9[10],uvt=day9[11],hum=day9[12],ppt=day9[13],snw=day9[14],cld=day9[15],mph=day9[16],wmh=day9[17],wkm=day9[18],wkt=day9[19],wdg=day9[20],wdi=day9[21],cd2=day9[22]}
day10={day=day10[1],dat=day10[2],con=day10[3],hih=day10[4],low=day10[5],sri=day10[6],sst=day10[7],mri=day10[8],mst=day10[9],uvn=day10[10],uvt=day10[11],hum=day10[12],ppt=day10[13],snw=day10[14],cld=day10[15],mph=day10[16],wmh=day10[17],wkm=day10[18],wkt=day10[19],wdg=day10[20],wdi=day10[21],cd2=day10[22]}
font={now=font[1],day1=font[2],day2=font[3],day3=font[4],day4=font[5],day5=font[6],day6=font[7],day7=font[8],day8=font[9],day9=font[10],day10=font[11]}
image={now=image[1],day1=image[2],day2=image[3],day3=image[4],day4=image[5],day5=image[6],day6=image[7],day7=image[8],day8=image[9],day9=image[10],day10=image[11]}
windfont={now=windfont[1],day1=windfont[2],day2=windfont[3],day3=windfont[4],day4=windfont[5],day5=windfont[6],day6=windfont[7],day7=windfont[8],day8=windfont[9],day9=windfont[10],day10=windfont[11]}
windicon={now=windicon[1],day1=windicon[2],day2=windicon[3],day3=windicon[4],day4=windicon[5],day5=windicon[6],day6=windicon[7],day7=windicon[8],day8=windicon[9],day9=windicon[10],day10=windicon[11]}
moonfont={day1=moonfont[1],day2=moonfont[2],day3=moonfont[3],day4=moonfont[4],day5=moonfont[5],day6=moonfont[6],day7=moonfont[7],day8=moonfont[8],day9=moonfont[9],day10=moonfont[10]}
moonicon={day1=moonicon[1],day2=moonicon[2],day3=moonicon[3],day4=moonicon[4],day5=moonicon[5],day6=moonicon[6],day7=moonicon[7],day8=moonicon[8],day9=moonicon[9],day10=moonicon[10]}
end--if data1==nil
return ""
--#########################################
end--weather data gathering function#######
--#########################################

--#############################################################
function conky_weather(conkydata,xpos,ypos,scale1,scale2)--####
--#############################################################
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)
cr = cairo_create(cs)
if xpos==nil then xpos=0 end
if ypos==nil then ypos=0 end
if scale1==nil then scale1=0 end
if scale2==nil then scale2=0 end

--[[data available
--current info.. use now.option
--options
con=conditions summary
cd2=conditions secondary
tmp=temperature
flk=Feels Like
wch=wind chill
cel=ceiling
hid=heat index
vis=visibility
dpt=dew point
wsp=wind speed (in mph)
wdg=wind direction in degrees
wdi=wind direction NSEW
wgs=wind gusts
hum=humidity
prs=pressure

--forecast information, 10 day
--use like this  dayX.option (where X=day number (1=today,2=tomorrow))
--options
day=forecast day
dat=forecast date
con=conditions summary
cd2=conditions secondary
hih=high temp
low=low temp
sri=sunrise
sst=sunset
mri=moon rise
mst=moon set
uvi=ultraviolet index
hum=humidity
ppt=chance of precipitation
snw=chance of snow
cld=cloud cover
mph=moon phase
wmh=wind speed in mph
wkm=wind speed in km/h
wkt=wind speed in knots
wdg=wind direction in degrees
wdi=wind direction in nesw

for weather images/icons

${lua weather image.now x y scalex scaley) for current
${lua weather image.dayX x y scalex scaley) where X = 1 to 10

for weather font

${lua weather font.now x y fontsize color) for current
${lua weather font.dayX x y fontsize color) where X = 1 to 10

for wind direction font

${lua weather windfont.now x y fontsize scaley) for current
${lua weather windfont.dayX x y fontsize color) where X = 1 to 10

for moon phase font

no moon phase for current conditions
${lua weather moonfont.dayX x y fontsize color) where X = 1 to 10
]]
---------------------------------------------
--moon font
if string.find(conkydata,"moonfont")~=nil then
local function rgb_to_r_g_b(color)
return ((color/0x10000) % 0x100)/255,((color/0x100) % 0x100)/255,(color % 0x100)/255,1
end
wfont="Moon Phases"
fsize=scale1
text=(loadstring("return "..conkydata)())
cairo_select_font_face (cr, wfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
cairo_set_source_rgba (cr ,rgb_to_r_g_b(scale2))
cairo_move_to (cr,xpos,ypos)
cairo_show_text (cr,text)
conkydata=""
end--moon font
--wind font
if string.find(conkydata,"windfont")~=nil then
local function rgb_to_r_g_b(color)
return ((color/0x10000) % 0x100)/255,((color/0x100) % 0x100)/255,(color % 0x100)/255,1
end
wfont="ConkyWindNESW"
fsize=scale1
text=(loadstring("return "..conkydata)())
cairo_select_font_face (cr, wfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
cairo_set_source_rgba (cr ,rgb_to_r_g_b(scale2))
cairo_move_to (cr,xpos,ypos)
cairo_show_text (cr,text)
conkydata=""
end--wind font
--weather font comes last as will match windfont and moonfont
if string.find(conkydata,"font")~=nil then
local function rgb_to_r_g_b(color)
return ((color/0x10000) % 0x100)/255,((color/0x100) % 0x100)/255,(color % 0x100)/255,1
end
wfont="ConkyWeather"
fsize=scale1
text=(loadstring("return "..conkydata)())
cairo_select_font_face (cr, wfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize)
cairo_set_source_rgba (cr ,rgb_to_r_g_b(scale2))
cairo_move_to (cr,xpos,ypos)
cairo_show_text (cr,text)
conkydata=""
end--weather font
--weather image
if string.find(conkydata,"image")~=nil then
file=weathericons..(loadstring("return "..conkydata)())..".png"
imageshow(file,xpos,ypos,scale1,scale2)
conkydata=""
end--weather image
---------------------------------------------
if (loadstring("return " .. conkydata)())~=nil then
output=(loadstring("return " .. conkydata)())
else
output=""
end
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return output
end--main function

function imageshow(file,center_x,center_y,w,h)
local show = imlib_load_image(file)
if show == nil then return end
imlib_context_set_image(show)
if tonumber(w)==0 then
width=imlib_image_get_width()
else
width=tonumber(w)
end
if tonumber(h)==0 then
height=imlib_image_get_height()
else
height=tonumber(h)
end
local iacross=center_x-(width/2)
local idown=center_y-(height/2)
imlib_context_set_image(show)
local scaled=imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), width, height)
imlib_free_image()
imlib_context_set_image(scaled)
imlib_render_image_on_drawable(iacross, idown)
imlib_free_image()
show=nil
end

Vert-Weather

conky.config = {
-- To use #! in a conky use: ${exec echo '#!'}
-- conky -c ~/wea_conky/Vert-Weather &
-- Created by Sector11 ###
--  Begin Window Settings  #
-- Create own window instead of using desktop (required in nautilus)
	own_window = true,
	own_window_type = 'normal',
	own_window_transparent = true,
	own_window_hints = 'undecorated,below,skip_taskbar,skip_pager',--sticky,
--own_window_colour black
	own_window_class = 'Forecast Conky',
	own_window_title = 'Forecast 6-2 by MrP',

-- Use the Xdbe extension? (eliminates flicker)
-- It is highly recommended to use own window with this one
-- so double buffer won't be so big.
	double_buffer = true,

-- ARGB can be used for real transparency
-- NOTE that a composite manager is required for real transparency.
-- This option will not work as desired (in most cases) in conjunction with
-- 'own_window_type override'
	own_window_argb_visual = true,

-- When ARGB visuals are enabled, this use this to modify the alpha value
-- Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
-- own_window_argb_value 0

	minimum_width = 195, minimum_height = 0,
	maximum_width = 195,

	gap_x = 10,
	gap_y = 10,

	alignment = 'bottom_right',
--  End Window Settings  #
--  Font Settings  #
-- Use Xft (anti-aliased font and stuff)
	use_xft = true,
	font = 'Anonymous Pro:size=9',

-- Alpha of Xft font. Must be a value at or between 1 and 0 #
	xftalpha = 0,
-- Force UTF8? requires XFT #
	override_utf8_locale = true,

	draw_shades = false,
	default_shade_color = 'black',

	draw_outline = false,
	default_outline_color = 'black',

	uppercase = false,
--  End Font Settings  #
--  Color Settings  #
	default_shade_color = 'grey',
	default_outline_color = 'black',

	default_color = '#DCDCDC',--Gainsboro
	color0 = '#778899',--LightSlateGrey
	color1 = '#BA55D3',--MediumOrchid
	color2 = '#7FFFD4',--Aquamarine
	color3 = '#C6FF8E',--Light Green
	color4 = '#F08080',--LightCoral
	color5 = '#FFDEAD',--NavajoWhite
	color6 = '#00BFFF',--DeepSkyBlue
	color7 = '#48D1CC',--MediumTurquoise
	color8 = '#FFFF00',--Yellow
	color9 = '#FF0000',--Red
--  End Color Settings  #
--  Borders Section  #
	draw_borders = false,
-- Stippled borders?
	stippled_borders = 0,
-- border margins
	border_inner_margin = 10,
	border_outer_margin = 0,
-- border width
	border_width = 0,
-- graph borders
	draw_graph_borders = false,
--  End Borders Secton  #
--  Miscellaneous Section  #

-- Boolean value, if true, Conky will be forked to background when started.
	background = false,

-- Adds spaces around certain objects to stop them from moving other things
-- around, this only helps if you are using a mono font
-- Options: right, left or none
	use_spacer = 'none',

	text_buffer_size = 256,

-- Subtract (file system) buffers from used memory?
	no_buffers = true,

-- change GiB to G and MiB to M
	short_units = true,

	pad_percents = 2,

--  End Miscellaneous Section  #
--  LUA Settings  #
	lua_load = '~/wea_conky/draw_bg.lua',

	lua_load = '~/wea_conky/forecast_VW.lua',
	lua_draw_hook_pre = 'weatherdata',
--  End LUA Settings  #

	update_interval = 2,

};

conky.text = [[
${lua conky_draw_bg 15 0 0 0 0 0x000000 0.4}${color6}${lua weather day1.day}${goto 100}${color2} Low ${lua weather day1.low}° ${font}${color white}/ ${color4}Hi ${lua weather day1.hih}°${color}
${goto 50}Now ${font Zekton:size=16}${color6}${lua weather now.tmp}° ${color5}/ ${voffset -10}${font}FL ${font Zekton:size=16}${color6}${lua weather now.flk}°${color}${font}\
${lua weather image.now 50 80 60 60}
${goto 100}${color7}  Humidity:${color} ${lua weather now.hum}%
${goto 100}${color7} Dew Point:${color} ${lua weather now.dpt}°
${goto 100}${color7}Wind Chill:${color} ${lua weather now.wch}°
${goto 100}${color7}Heat Index:${color} ${lua weather now.hid}°
${color7}Ceil:${color} ${lua weather now.cel}${goto 100}${color7}Visibility:${color} ${lua weather now.vis}
${color7}Wind:${color} ${lua weather now.wsp} mph ${color7}@${color} ${lua weather now.wdg}° ${color7}(${color}${lua weather now.wdi}${color7})${color}
${color7}Barometer:${color} ${lua weather now.prs} ${color7}Gusts:${color} ${lua weather now.wgs}${color}
${color7}Phase: ${color}${lua weather day1.mph}
${font Zekton:size=16}${color}${lua weather now.con}${font}
${color5}Today's Forecast ${hr}${color}${lua weather image.day1 30 240 35 35}
${goto 50}${color7}Precip:${color}${lua weather day1.ppt}% ${goto 130}${color7}Cloud: ${color}${lua weather day1.cld}%
${goto 55}${color7} UVI: ${color}${lua weather day1.uvn} (${lua weather day1.uvt})
${goto 55}${color7} Sun: ${color5}${lua weather day1.sri} ${color0}${lua weather day1.sst}
${goto 55}${color7}Moon: ${color5}${lua weather day1.mri} ${color0}${lua weather day1.mst}${color}
${lua weather moonfont.day1 20 280 20 0xFFFFFF}${goto 55}${color}${lua weather day1.mph}
${stippled_hr 2}
${color6}${lua weather day2.day}${goto 120}${lua weather day3.day}
${color2}${lua weather day2.low}° <${color4}> ${lua weather day2.hih}°${color}\
${goto 120}${color2}${lua weather day3.low}° <${color4}> ${lua weather day3.hih}°\
${lua weather image.day2 45 355 35 35}${lua weather image.day3 155 355 35 35}



${color6}${lua weather day4.day}${goto 120}${lua weather day5.day}
${color2}${lua weather day4.low}° <${color4}> ${lua weather day4.hih}°${color}\
${goto 120}${color2}${lua weather day5.low}° <${color4}> ${lua weather day5.hih}°\
${lua weather image.day4 45 425 35 35}${lua weather image.day5 155 425 35 35}



${color6}${lua weather day6.day}${goto 120}${lua weather day7.day}
${color2}${lua weather day6.low}° <${color4}> ${lua weather day6.hih}°${color}\
${goto 120}${color2}${lua weather day7.low}° <${color4}> ${lua weather day7.hih}°\
${lua weather image.day6 45 500 35 35}${lua weather image.day7 155 500 35 35}



${color6}${lua weather day8.day}${goto 120}${lua weather day9.day}
${color2}${lua weather day8.low}° <${color4}> ${lua weather day8.hih}°${color}\
${goto 120}${color2}${lua weather day9.low}° <${color4}> ${lua weather day9.hih}°\
${lua weather image.day8 45 575 35 35}${lua weather image.day9 155 575 35 35}



${color}${hr}
#${execpi 1800 conkyForecast -i --location=340044 --template=/media/DATEN/Abgleich/Conky/Sector11/wea_conky/vert.template}
#+- Updated: ${execpi 120 conkyForecast --datatype=LU}
#+- Fetched: ${execpi 120 conkyForecast --datatype=LF}

]];

draw_bg.lua

--[[Background originally by londonali1010 (2009)
    ability to set any size for background mrpeachy 2011
    ability to set variables for bg in conkyrc dk75

  the change is that if you set width and/or height to 0
  then it assumes the width and/or height of the conky window

so:

lua_load ~/wea_conky/draw_bg.lua
TEXT
${lua conky_draw_bg 20 0 0 0 0 0x000000 0.4}
  See below:        1  2 3 4 5 6        7 

${lua conky_draw_bg corner_radius x_position y_position width height color alpha}

covers the whole window and will change if you change the minimum_size setting

1 = 20             corner_radius
2 = 0             x_position
3 = 0             y_position
3 = 0             width
5 = 0             height
6 = 0x000000      color
7 = 0.4           alpha

]]

require 'cairo'
local    cs, cr = nil
function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
function conky_draw_bg(r,x,y,w,h,color,alpha)
if conky_window == nil then return end
if cs == nil then cairo_surface_destroy(cs) end
if cr == nil then cairo_destroy(cr) 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)
w=w
h=h
if w=="0" then w=tonumber(conky_window.width) end
if h=="0" then h=tonumber(conky_window.height) end
cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
-----------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_fill (cr)
------------------------------------------------------------
cairo_surface_destroy(cs)
cairo_destroy(cr)
return ""
end

Offline

#872 2018-02-12 11:37:55

TeoBigusGeekus
BL DieHard
From: /Greece/Kastoria
Registered: 2015-10-04
Posts: 1,195

Re: Show us your conky

My last one had too much empty space, so I made a new one.

paQDyETt.jpg


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#873 2018-02-12 17:25:33

Indian
Member
Registered: 2018-02-05
Posts: 23

Re: Show us your conky

Alpetjr wrote:

I made some headway on my weather conky but now I am stuck. It updates but I have error message that I don't know about. Any help would be very appreciated. Thanks

Do you have the images in ~/weathericons/?

Offline

#874 2018-02-12 18:49:49

Indian
Member
Registered: 2018-02-05
Posts: 23

Re: Show us your conky

Trying the lua script the problem could be that something in the weather page has changed.

Offline

#875 2018-02-12 20:59:44

Alpetjr
Member
Registered: 2018-01-11
Posts: 13

Re: Show us your conky

It updates fine and I do have the weather icons in ~/weathericons.

Offline

Board footer

Powered by FluxBB