Conky thread, show your work!

how-to
conky

#238

I ‘mostly’ have the following Conky “text” working to report unseen email messages from numeros accounts (5). Can anyone here help review the code and let me know why I have a spurious character showing following the number of messages (digit)? Also, what execi value seems reasonable (I have 100 currently but that seems too infrequently).

The styling(?) is as follows:

use_xft yes
xftfont 123:size=8
xftalpha 0.1
update_interval 1
total_run_times 0

own_window yes
own_window_type normal
own_window_transparent no
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_colour 000000
own_window_argb_visual yes
own_window_argb_value 140

double_buffer yes
#minimum_size 250 5
#maximum_width 500
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color red
default_outline_color green
alignment middle_right
gap_x 345
gap_y -313
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 1
override_utf8_locale yes
use_spacer yes

minimum_size 320 0

The “text” along with a screenshot is posted here: Thunderbird to something else conversion?


#239

Hello, sorry for the late reply… Yes I run all conky separately… Here are the scripts along with the bash script that you can run at the system start -
https://mega.nz/#!GYgS0Cyb!SKQU2vGV6FAK4yeGj0FMXou5LNsYRFVaSgxbEpDsY2g

I am planning to add the album art of the current song in that media player box as well…


#240

Here is my simple conky:


#241

Simple, yet all info is present.


#242

If it’s not too much work, please share the .conkyrc so that we all can play with it :blush:


#243

Here is the conkyrc:

conky.config = {
    alignment = 'middle_right',
    border_width = 1,
    border_inner_margin = 10,
    cpu_avg_samples = 2,
	default_color = '#B7B7B7',
    default_outline_color = '#B7B7B7',
    default_shade_color = '#B7B7B7',
    draw_borders = true,
    draw_graph_borders = true,
    draw_shades = false,
	double_buffer = true,
    use_xft = true,
    font = 'Droid Sans Regular:size=11',
    gap_x = 30,
    gap_y = 5,
    minimum_height = 100,
	minimum_width = 240,
	maximum_width = 300,
    net_avg_samples = 2,
    no_buffers = true,
    out_to_console = false,
    out_to_stderr = false,
    extra_newline = false,
    own_window = true,
    own_window_class = 'Conky',
    own_window_type = 'desktop',
	own_window_colour = '#303030',
	own_window_argb_visual = true,
	own_window_argb_value = 190,
    update_interval = 1.0,
    uppercase = false,
    use_spacer = 'none',
    xftalpha = 0.8,
    times_in_seconds = true
}

conky.text = [[
${font :size=40}${color #FFFFFF}${alignc}${time %H:%M}${font}
${voffset 10}${color #BFBFBF}${alignc}${time %A}, ${time %d}. ${time  %b} ${time %Y}
#${voffset 5}
${color #FFFFFF}${hr}
${font :bold}System
${font :normal}
${color #B7B7B7}Kernel: ${alignr}${kernel}${voffset 5}
Akku ${alignr}${format_time ${battery_time BAT0} "\hh \mm"} ${if_match "${acpiacadapter ADP1}" == "on-line"}bis geladen ${else}bis entladen ${endif} (${battery_percent BAT0}%)
${if_match ${battery_percent BAT0} <=20}${color #FF0000}${else}${if_match ${battery_percent BAT0} <=50}${color #FF8000}${else}${if_match ${battery_percent BAT0} <=70}${color #FAF151}${else}${color #01DF01}${endif}${endif}${endif}${battery_bar 5,290}
${color #B7B7B7}Prozessor ${alignr}${cpu cpu0}% | ${freq_g (1)} GHz
${color #FFFFFF}${alignr}${cpubar 5,290}
${color #B7B7B7}Ram ${alignr}${mem} ($memperc%) / ${memmax}
${color #FFFFFF}${membar 5,290}
#------------
${color #FFFFFF}${hr}
${font :bold}Partitionen${font :normal}${color #B7B7B7}${alignr}belegt (%) / max.

${color #B7B7B7}Swap ${alignr}${swap}($swapperc%) / ${swapmax}
${color #FFFFFF}${swapbar 5,290}
${color #B7B7B7}Boot ${alignr}${fs_used /boot} (${fs_used_perc /boot}%) / ${fs_size /boot}
${color #FFFFFF}${alignr}${fs_bar 5,290 /boot}
${color #B7B7B7}Root ${alignr}${fs_used /} (${fs_used_perc /}%) / ${fs_size /}
${color #FFFFFF}${alignr}${fs_bar 5,290 /}
${color #B7B7B7}Home ${alignr}${fs_used /home} (${fs_used_perc /home}%) / ${fs_size /home}
${color #FFFFFF}${fs_bar 5,290 /home}
#------------
${color #FFFFFF}${hr}
${font :bold}NAS
${font :normal}
#${color #B7B7B7}HDD 1 (1TB) ${offset 22}${execibar 3600 ssh root@172.16.1.5 df -h /dev/md0 | awk 'FNR==2 {print $5}'| tr -d "%"}
${color #B7B7B7}HDD 1 ${offset 25}${execi 3600 ssh root@172.16.1.5 df -h /dev/md0 | awk 'FNR==2 {print "max: "$2" frei: "$4}'}
#${color #B7B7B7}HDD 2 (2TB) ${offset 22}${execibar 3600 ssh root@172.16.1.5 df -h /dev/md1 | awk 'FNR==2 {print $5}'| tr -d "%"}
${color #B7B7B7}HDD 2 ${offset 25}${execi 3600 ssh root@172.16.1.5 df -h /dev/md1 | awk 'FNR==2 {print "max: "$2" frei: "$4}'} 

${color #B7B7B7}Temperatur${alignr}${texeci 3600 sh ~/.conky_scripts/nastemp.sh} °C
${color #B7B7B7}Uptime${alignr}${texeci 3600 sh ~/.conky_scripts/nasuptime.sh}
#------------
${color #FFFFFF}${hr}
${font :bold}Neue Mails (Inbox)
${font :normal}
${color #B7B7B7}GMail ${goto 200}${execpi 1800 python ~/.conky_scripts/gmail.py}
${color #B7B7B7}Hotmail ${goto 200}${execpi 1800 python ~/.conky_scripts/hotmail.py}
${color #B7B7B7}GMX ${goto 200}${execpi 1800 python ~/.conky_scripts/gmx.py}
${color #B7B7B7}Mailbox ${goto 200}${execpi 1800 python ~/.conky_scripts/mailbox.py}
#------------
${if_existing /proc/net/route wlp0s20u3}${color #FFFFFF}${hr}
${font :bold}WLAN
${font :normal}
${color #B7B7B7}IP:${alignr}${addr wlp0s20u3}
${color #B7B7B7}SSID:${alignr}${wireless_essid wlp0s20u3}
#${color #B7B7B7}Rate:${alignr}${wireless_bitrate wlp0s20u3}
${color #B7B7B7}TX Rate:${alignr}${execi 10 iw dev wlp0s20u3 link | grep bitrate | cut -d" " -f3} MBit/s
${color #B7B7B7}Linkqualität:${alignr}${wireless_link_qual_perc wlp0s20u3} %
${color #BFBFBF}Down:${alignr}${downspeedf wlp0s20u3} kb/s
${color #BFBFBF}Up:${alignr}${upspeedf wlp0s20u3} kb/s
${endif}
#------------
${if_existing /proc/net/route enp14s0}${voffset -20}${color #FFFFFF}${hr}
${font :bold}LAN
${font :normal}
${color #B7B7B7}IP-Adresse:${alignr}${addr enp14s0}
${color #B7B7B7}Download:${alignr}${downspeedf enp14s0} kb/s
${color #B7B7B7}Upload:${alignr}${upspeedf enp14s0} kb/s
${endif}
#------------
${color #B7B7B7}${voffset -20}${color #FFFFFF}${hr}
${font :bold}Fritzbox
${font :normal}
${color #B7B7B7}${texeci 7200 sh ~/.conky_scripts/fritzbox_values/getValues.sh}
]]

Here the mailscript, for GMail as an example:

# Author: Bhavik Shah
# Created: 3/5/09
# Description: Simple script that uses the python imap library
# to retrieve number of messages and unread messages from your
# imap email account.
# Script is free. Credit to bhaviksblog.com is appreciated =)
import imaplib
# Username should be your username with '@gmail.com' added
# I think the @gmail.com is required.
# If you're trying it with something other than gmail
# you should make the username the full email address
# example@domain.com
username = 'USER@gmail.com'
password = 'YOUR_PASSWORT' # your pw
mailbox = 'INBOX' # inbox is default
# only tested with gmail and my university email
# it should work with any imap server
# change mail server and port to match your server's info
mailserver = 'imap.gmail.com'
port = 993
# connect to gmail's server (uses SSL, port 993)
server = imaplib.IMAP4_SSL(mailserver,port)
# gmail uses ssl...if your imap mail server doesn't comment the above
# line and uncomment this one.
# server = imaplib.IMAP4(mailserver,port)
# login with the variables provided up top
server.login(username,password)
# select your mailbox
server.select(mailbox)
# pull info for that mailbox
data = str(server.status(mailbox, '(MESSAGES UNSEEN)'))
# print it all out
#print
tokens = data.split()
print(tokens[5].replace(')\'])',''),' von ', tokens[3])
# close the mailbox
server.close()
# logout of the server
server.logout()

#244

@pux If you really want to learn conky… one of the best ways is to install conky-manager (from AUR) and get teejeetech’s templates… there are dozens. Deviantart also provide numerous outstanding examples…


#245

Any chance you could post a link to them, I would be interested.

I have an idea in my head of what I want my concky to look like but just havent found the time/motivation to really research it and do it.

In the meantime, I would be greatly interested in checking out collections of pre-done concky configs to implement something close to what I want and then maybe tweaking it a little until I have time to really dive into it.

Other than this great thread, are there any other reliable resources for conky configs that you guys know of?


#246

@manyroads:
I agree conky-manager is a really nice tool and I use it fairly often for my experiments :boom::firecracker:
You can find some of them by searching this topic for my user name :wink:
Btw. conky-manager is in the community repo, maybe you mixed it up with the AUR?
Deviantart is awesome, thanks!

@Zer0Cool:
You could check out Erik Dubois Github for more inspiration, he makes really awesome conkys.


#247

Is it possible for conky to show CPU speeds (per core/thread) in real time vs % used? IE:

CPU0: 800Mhz
CPU1: 1.6Ghz
CPU2: 2.4Ghz
CPU3: 900Mhz


#248

${freq cpux} Frequency in MHz, x is CPU number, starting from 1.

${freq_g cpux} Frequency in GHz, x is as above.


#249

@Zer0Cool You really ought to spend time googling conky if you are truly interested in learning detailed in’s and outs. This stuff is not a closely held secret requiring a special handshake or anything… :wink:

https://www.linuxsecrets.com/archlinux-wiki/wiki.archlinux.org/index.php/Conky.html
https://kennyballou.com/blog/2017/10/conky-maildirs-config


http://www.ifxgroup.net/conky.htm#p2.


#250

Yea I started down that road about 6 months back but am studying for my RHCSA and intend to go back to college so time is at a premium. I ended up letting my desire to configure conky fall by the wayside and I guess now am really just hoping to use one thats mostly what I want and then maybe tweak it a little.

The posts here and the links provided have given me a good set of options to go with. Maybe after I fingers crossed pass my RHCSA ill be able to devote a weekend to working out conky.


#251
  • entropy_avail *Current entropy available for crypto freaks

  • entropy_bar *(height),(width) *Normalized bar of available entropy for crypto freaks

  • entropy_perc *Percentage of entropy available in comparison to the poolsize

  • entropy_poolsize * Total size of system entropy pool for crypto freaks

tail -n5 /var/log/pacman.log | fold -w100

[2018-09-27 16:07] [ALPM] running 'systemd-sysusers.hook'...
[2018-09-27 16:07] [ALPM] running 'systemd-tmpfiles.hook'...
[2018-09-27 16:07] [ALPM] running 'systemd-update.hook'...
[2018-09-27 16:07] [ALPM] running 'update-desktop-database.hook'...
[2018-09-27 16:07] [ALPM] running 'update-mime-database.hook'...


Savoury September (2018) Screenshots
#252

Simple


#253

Hello people.
So far this is my conky. I expect to learn watching other jobs.

Conky2

This is the conky.conf

--ARCHIVO DE CONFIGURACIÓN DE CONKY--
--En esta parte se configura el aspecto de la ventana--
conky.config = {
--Posición de la ventana--
    alignment = 'top_right',
--Provocar que conky trabaje en segundo plano--
    background = true,
--Bordes--
    border_inner_margin = 1,
    border_outer_margin = 1,
    border_width = 1,
--Lista de colores a usar en los textos--
    color1 = '18edd9',
    color2 = '33b658',
--Número de muestras para monitorizar la CPU--
    cpu_avg_samples = 2,
--Colores por defecto--
    default_color = 'white',
    default_outline_color = 'white',
    default_shade_color = 'white',
--Eliminar parpadeo--
    double_buffer = true,
--Dibujar bordes--
    draw_borders = false,
    draw_graph_borders = true,
    draw_outline = false,
    draw_shades = false,
--Put an extra newline at the end when writing to stdout--
    extra_newline = false,
--Tipo de fuente--
    font = 'capture it:size=12',
--Hueco entre la ventana y el borde de la pantalla--
    gap_x = 20,--Distancia con el borde derecho--
    gap_y = 40,--Distancia con el borde superior--
--Tamaño de la ventana--
    minimum_height = 5,
    minimum_width =  350,
    maximum_width =  350,
--Número de muestras para monitorizar los datos de red--
    net_avg_samples = 2,
--   --
    no_buffers = true,
    out_to_console = false,
    out_to_stderr = false,
--Propiedades de la ventana--
    own_window = false,
    own_window_class = 'Conky',
    own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
    own_window_transparent = true,
    own_window_argb_visual = true,
    own_window_type = 'desktop',
--   --
    stippled_borders = 0,
    update_interval = 1.0,
    uppercase = false,
    use_spacer = 'none',
    show_graph_scale = false,
    show_graph_range = false,
    use_xft = true
}

conky.text = [[
###Fecha y hora###
${color1}${font capture it:size=15}${time %A %d de %B}$alignr${time %Y}${font}
${color1}$alignc ${font capture it:size=30} ${time %H:%M}${font capture it:size=15} : ${time %S}${font}
###Nombre del sistema###
${color}$hr
${image ~/.config/conky/Manjaro.png -p 5,85 -s 45x45}
${voffset -15}${offset 80}${color}${font capture it:size=14}$nodename${color}
${voffset 3}${offset 80}${color}${font capture it:size=14}${kernel}${font}${color}
###CPU, RAM###
${color}$hr
${color black}Uptime:$color $alignr$uptime
${color black}Frequency (in GHz):$color $alignr$freq_g
${color black}${font capture it:size=12}CPU Temperature:$color $alignr ${hwmon 3 temp 1} C
${color black}CPU Usage:$color $alignr$cpu%
${cpubar 10}
#${color black}CPU 1$color  ${voffset 2}$alignr${cpu 1}% ${cpubar cpu1 12,210}
#${color black}CPU 2$color  ${voffset 2}$alignr${cpu 2}% ${cpubar cpu2 12,210}
#${color black}CPU 3$color  ${voffset 2}$alignr${cpu 3}% ${cpubar cpu3 12,210}
#${color black}CPU 4$color  ${voffset 2}$alignr${cpu 4}% ${cpubar cpu4 12,210}
${color black}RAM Usage:$color $alignr$mem/$memmax - $memperc%
${membar 10}
${color black}Swap Usage:$color $alignr$swap/$swapmax - $swapperc%
${swapbar 10}
###Sistema de archivos###
${color}$hr
${color1}File systems:$color
${color black}/ $color$alignr${fs_used /}/${fs_size /}
${fs_bar 10 /}
${color black}/home $color$alignr${fs_used /home}/${fs_size /home}
${fs_bar 10 /home}
###Red###
${color}$hr
${color1}Networking:
${voffset 20}${color black}Up:$color${offset 46}${upspeed wlp0s20f0u4}${voffset -20}${alignr}${upspeedgraph wlp0s20f0u4 45,220 0000ff ff0000}
${voffset 20}${color black}Down:$color${offset 20}${downspeed wlp0s20f0u4}${voffset -20}${alignr}${downspeedgraph wlp0s20f0u4 45,220 01df01 10fd10 }
###Procesos###
${color white}$hr
${color black}Processes:$color $processes  ${color black}Running:$color $running_processes
${color black}Name              PID   CPU%   MEM%
${color grey} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
${color grey} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${color grey} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${color grey} ${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}
${color white}$hr
###Audacious###
${if_running audacious}${color1}$alignc${font capture it:size=18}Audacious${font}
${color black}${font Sans:style=bold:size=10}Title:${font}  
   ${color}${font Ubuntu:size=15}${exec audtool --current-song-tuple-data title}${font}
${color black}${font Sans:style=bold:size=10}Artist:${font}
   ${color}${font Ubuntu:size=15}${exec audtool --current-song-tuple-data artist}${font}
${color black}${font Sans:style=bold:size=10}Album:${font}  
   ${color}${font Ubuntu:size=15}${exec audtool --current-song-tuple-data album}${font}
${exec cp /tmp/$(ls /tmp | grep audacious) ~/.config/conky/caratula_audacious.png}${image ~/.config/conky/caratula_audacious.png -p 250,820 -s 86x86 -f 2}
$endif
###Spotify###
${if_running spotify}${color1}$alignc${font capture it:size=18}Spotify${font}
${color black}${font Sans:style=bold:size=10}Title:${font}
   ${color}${font Ubuntu:size=15}${exec ~/.config/conky/conky-spotify/scripts/title.sh}${font}
${color black}${font Sans:style=bold:size=10}Artist:${font}
   ${color}${font Ubuntu:size=15}${exec ~/.config/conky/conky-spotify/scripts/artist.sh}${font}
${color black}${font Sans:style=bold:size=10}Album:${font}
   ${color}${font Ubuntu:size=15}${exec ~/.config/conky/conky-spotify/scripts/album.sh}${font}
${exec ~/.config/conky/conky-spotify/scripts/cover.sh}
${if_running audacious}${image ~/.config/conky/conky-spotify/current/current.jpg -p 250,1000 -s 86x86 -f 2}
${else}${image ~/.config/conky/conky-spotify/current/current.jpg -p 250,825 -s 86x86 -f 2}
$endif
$endif
]]

This link is to download the needed scripts for spotify

I downloaded the conky-spotify scripts from here I just used the code and changed some paths.


#254

I am using Manjaro XFCE. I have a Conky that is set up to pull information from Pithos (Pandora desktop program) like song title, artist, and album. It was working and then it just stopped. I was pgrepping pithos but that stopped so I changed it to pgrep python which worked for a while but then that stopped. I would appreciate any thoughts on what might be going wrong with it. It will display the labels but no content.

I am getting the following errors when run from the terminal:

conky -c ~/.conky/pithos2/pithosrc
conky: Syntax error (/home/lagarto/.conky/pithos2/pithosrc:1: '=' expected near 'yes') while reading config file. 
conky: Assuming it's in old syntax and attempting conversion.
conky: desktop window (e00003) is subwindow of root window (6b9)
conky: window type - desktop
conky: drawing to created window (0x5000002)
conky: drawing to double buffer
conky: forked to background, pid is 459

Error org.freedesktop.DBus.Error.ServiceUnknown: The name net.kevinmehall.Pithos 
was not provided by any .service files

Here is the Conky file:

background yes
update_interval 1

cpu_avg_samples 2
net_avg_samples 2
temperature_unit celsius

double_buffer yes
no_buffers yes
text_buffer_size 2048

#gap_x 1590 #left-right
gap_x 20 #left-right
gap_y -110
minimum_size 250 250
maximum_width 250
own_window yes
own_window_type desktop
own_window_argb_visual yes
own_window_transparent yes
own_window_hints undecorated,skip_taskbar,skip_pager,below
border_inner_margin 0
border_outer_margin 0
alignment bl

draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no

override_utf8_locale yes
use_xft yes
#xftfont caviar dreams:size=8
xftfont Droid Sans:size=10
xftalpha 0.5
uppercase no

# TEXT code block 6: START
############################################################################################
#                                                                                          #
#  Sixth TEXT code block displays Music info from Pithos:                                  #
#   -> Requires installation of pithos and php5-cli to run a php script                    #
#        http://kevinmehall.net/p/pithos/                                                  #
#        sudo apt-get install php5-cli                                                     #
#                                                                                          #
#  Current version of PHP on Manjaro XFCE is:                                              #
#  PHP 7.2.11 (cli) (built: Oct  9 2018 18:14:59) ( NTS )                                  #
#                                                                                          #
############################################################################################
#
default_color grey
color1 grey
color1 grey

TEXT
${color}${if_empty ${exec pgrep python}}${else}
${voffset 10}${font Roboto Condensed:size=12}PANDORA RADIO${voffset -4}
${color1}${font Roboto Condensed:size=12}
${color1}Title:${color} ${execp php ~/.conky/scripts/pithos.php 'title'}${voffset 4}
${color1}Artist:${color} ${execp php ~/.conky/scripts/pithos.php 'artist'}${voffset 4}
${color1}Album:${color} ${execp php ~/.conky/scripts/pithos.php 'album'}
${endif}

This is the PHP file:

#!/usr/bin/php
<?php

$song=`dbus-send --print-reply --dest=net.kevinmehall.Pithos /net/kevinmehall/Pithos net.kevinmehall.Pithos.GetCurrentSong`;

$matches = array();

switch($argv[1]) {
    case 'album':
        $pattern = '~"album".*?"(.*?)".*~s';
        break;
    case 'title':
        $pattern = '~"title".*?"(.*?)".*~s';
        break;
    case 'artist':
        $pattern = '~"artist".*?"(.*?)".*~s';
        break;
    default:
        exit;
}

preg_match($pattern, $song, $matches);

if($matches) {
    echo $matches[1];
}
?>

#256

I’m using the clock from @vlkon and created a new conky with a small system monitor and weather information (taken from openweathermap.org). It is using the 'ConkyColors and ConkyColorsWeather fonts for the icons.

Screenshot_20181105_121836

Files (create the ‘openweathermap_error.conf’ in the same directory as the scripts):

conky_clock:

 -- conky_clock.conf
--
-- author        : vlkon
-- version       : 20180805_01
-- conky version : conky 1.10.6_pre compiled Thu Dec 29 16:29:51 UTC 2016 for Linux 4.1.37-1-MANJARO x86_64
--
-- license:
--
--    This program is free software: you can redistribute it and/or modify
--    it under the terms of the GNU General Public License as published by
--    the Free Software Foundation, either version 3 of the License, or
--    (at your option) any later version.
--
--    This program is distributed in the hope that it will be useful,
--    but WITHOUT ANY WARRANTY; without even the implied warranty of
--    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--    GNU General Public License for more details.
--
--    You should have received a copy of the GNU General Public License
--    along with this program.  If not, see <https://www.gnu.org/licenses/>.
--
-------------------------------------------------------------------------------

conky.config = {
--  This is a comment

-- Create own window instead of using desktop
    own_window = true,
    own_window_type = 'normal',
    own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
    own_window_colour = '000000',   -- 000000 is black
    own_window_transparent = false, -- set transparency level to 0 (redundant with argb value 0)
    own_window_argb_visual = true,  -- use transparency
    own_window_argb_value = 0,      -- transparency level (0-255 -> 0%-100%)
    double_buffer = true,           -- eliminates flicker

--Window size
    minimum_width = 450,
    maximum_width = 450,
    minimum_height = 300,

-- Window position
    alignment = 'top_left',
-- Gap between borders of screen and text
    gap_x = 0,
    gap_y = 0,

--Window borders
    draw_borders = false,
    stippled_borders = 1,           -- border dash legth (pixel)
    border_width = 2,               -- border dash width (pixel)
--Border margins (offset)
    border_inner_margin = 0,
    border_outer_margin = 0,

-- Font - not really necessary since everything is in a lua script
    use_spacer = 'none',
    use_xft = true,                 -- anti-aliased font and stuff
    xftalpha = 1.0,                 -- value between 0.0 and 1.0
    font = 'Liberation Sans:pixelsize=12',

    draw_outline = false,           -- amplifies text if yes
    draw_shades = false,
    uppercase = false,              -- set to yes if you want all text to be in uppercase
    pad_percents = 3,               -- fix percents to 3 digits (keep format)
    format_human_readable = false,  -- volumes are in KiB, MiB or GiB - keep 'false' for lua script
    override_utf8_locale = true,

-- Update interval in seconds
    update_interval = 1.0,
--  update_interval_on_battery 5.0, -- only for laptop

-- Misc
    total_run_times = 0,            -- 0=run forever
--  text_buffer_size = 256,         -- default buffer size
    temperature_unit = 'celsius',
    no_buffers = true,              -- memory usage doesn't contain cache and buffers -- keep for lua script
    if_up_strictness = 'link',      -- 'up', 'link' or 'address' -- keep for lua script

-- Number of samples to average - set to 1 to disable averaging
    cpu_avg_samples = 1,
    diskio_avg_samples = 1,
    net_avg_samples = 1,

--Graph setting
    draw_graph_borders = false,
    show_graph_range = false,       -- time range
    show_graph_scale = false,       -- max graph value

--Colors
    default_color = 'FFFFFF',       -- default text color
    default_shade_color = '000000',
    default_outline_color = '000000',

--Templates

--Lua scripts
    lua_load = '~/.conky/conky_openweather/scripts/conky_clock.lua',
    lua_draw_hook_post = 'conky_main'
};

conky.text = [[#This is comment and everything else is in the lua script]];

conky_clock.lua:

 -- conky_clock.lua
--
-- author        : vlkon
-- version       : 20180805_01
-- conky version : conky 1.10.6_pre compiled Thu Dec 29 16:29:51 UTC 2016 for Linux 4.1.37-1-MANJARO x86_64
--
-- license:
--
--    This program is free software: you can redistribute it and/or modify
--    it under the terms of the GNU General Public License as published by
--    the Free Software Foundation, either version 3 of the License, or
--    (at your option) any later version.
--
--    This program is distributed in the hope that it will be useful,
--    but WITHOUT ANY WARRANTY; without even the implied warranty of
--    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--    GNU General Public License for more details.
--
--    You should have received a copy of the GNU General Public License
--    along with this program.  If not, see <https://www.gnu.org/licenses/>.
--
-------------------------------------------------------------------------------

require 'cairo'

master_settings = {
    clock = {status = 1,    x = 200.0,      y = 80.0},      -- origin position - in this case it is bottom-center of the clock ":"
    date =  {status = 1,    x = 300.0,      y = 100.0},     -- origin position - top-right corner of day number
    weather =  {status = 1,    x = 60.0,      y = 200.0,    path_conf = "~/.conky/conky_openweather/scripts"},     -- origin position - top-right corner of day number
    system =  {status = 1,    x = 250.0,      y = 180.0},
    scale = {               x = 1.0,        y = 1.0}        -- scale from top-left corner
}


-------------------------------------------------------------------------------
-- Slightly finer adjustment of each visual
-------------------------------------------------------------------------------

clock = {
    x_offset = 12.0,                                        -- offset hours and minutes from the center
    y_offset = 7.0,                                         -- offset colon ":" along y-direction from the center
    size = 100.0,
    font = 'Alex Brush',
    slant = CAIRO_FONT_SLANT_NORMAL,
    weight = CAIRO_FONT_WEIGHT_NORMAL,
    rgb = 0xFFFFFF,
    alpha = 0.6
}

date = {
    day = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = -15.0,            y_offset = 0.0,             -- offset from origin (top-right corner of a day number)
        size = 52.0,                                        -- font size
        font = 'Alex Brush',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0x34be5b,
        alpha = 0.8,
        text = '${time %_d}',
        x_align = 'RIGHT'                                   -- 'LEFT', 'RIGHT' x-alignment of the text
    },
    month = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = -7.0,         y_offset = 0.0,             -- offset from origin (top-right corner of a day number)
        size = 28.0,                                        -- font size
        font = 'Petit Formal Script',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0xFFFFFF,
        alpha = 0.6,
        text = '${time %B}',
        x_align = 'LEFT'                                    -- 'LEFT', 'RIGHT' x-alignment of the text
    },
    year = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = 40.0,            y_offset = 30.0,                -- offset from origin (top-right corner of a day number)
        size = 26.0,                                        -- font size
        font = 'Alex Brush',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0x34be5b,
        alpha = 0.8,
        text = '${time %Y}',
        x_align = 'LEFT'                                    -- 'LEFT', 'RIGHT' x-alignment of the text
    },
    wday = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = 40.0,         y_offset = 55.0,                -- offset from origin (top-right corner of a day number)
        size = 20.0,                                        -- font size
        font = 'Petit Formal Script',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0xD0D0D0,
        alpha = 0.8,
        text = '${time %A}',
        x_align = 'RIGHT'                                   -- 'LEFT', 'RIGHT' x-alignment of the text
    },
    }
weather = {
    weatlogo = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = 0.0,         y_offset = 0.0,                -- offset from origin (top-right corner of a day number)
        size = 60.0,                                        -- font size
        font = 'ConkyColorsWeather',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0xD0D0D0,
        alpha = 0.8,
        text = string.format('${execi 300 %s/openweathermap.sh}',master_settings.weather.path_conf),
        x_align = 'RIGHT'                                   -- 'LEFT', 'RIGHT' x-alignment of the text
    },
    weattext = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = 5.0,         y_offset = 3.0,                -- offset from origin (top-right corner of a day number)
        size = 20.0,                                        -- font size
        font = 'Petit Formal Script',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0xD0D0D0,
        alpha = 0.8,
        text = string.format("${exec cat %s/openweathermap.conf | grep temp_cond | cut -d';' -f 2}",master_settings.weather.path_conf),
        x_align = 'LEFT'                                   -- 'LEFT', 'RIGHT' x-alignment of the text
    },
    wind_logo = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = 17.0,         y_offset = 27.0,                -- offset from origin (top-right corner of a day number)
        size = 25.0,                                        -- font size
        font = 'ConkyColorsWeather',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0xD0D0D0,
        alpha = 0.8,
        text = '8',
        x_align = 'LEFT'                                   -- 'LEFT', 'RIGHT' x-alignment of the text
    },
    windtext = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = 32.0,         y_offset = 40.0,                -- offset from origin (top-right corner of a day number)
        size = 12.0,                                        -- font size
        font = 'Liberation Serif',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0xD0D0D0,
        alpha = 0.8,
        text = string.format("${exec cat %s/openweathermap.conf | grep wind_speeddir | cut -d';' -f 2}",master_settings.weather.path_conf),
        x_align = 'LEFT'                                   -- 'LEFT', 'RIGHT' x-alignment of the text
    },
    cloud_logo = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = 71.0,         y_offset = 32.0,                -- offset from origin (top-right corner of a day number)
        size = 20.0,                                        -- font size
        font = 'ConkyColorsWeather',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0xD0D0D0,
        alpha = 0.8,
        text = string.format("${exec cat %s/openweathermap.conf | grep cloud_icon | cut -d';' -f 2}",master_settings.weather.path_conf),
        x_align = 'LEFT'                                   -- 'LEFT', 'RIGHT' x-alignment of the text
  },
    cloudtext = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = 90.0,         y_offset = 40.0,                -- offset from origin (top-right corner of a day number)
        size = 12.0,                                        -- font size
        font = 'Liberation Serif',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0xD0D0D0,
        alpha = 0.8,
        text = string.format("${exec cat %s/openweathermap.conf | grep cloud_cover | cut -d';' -f 2}",master_settings.weather.path_conf),
        x_align = 'LEFT'                                   -- 'LEFT', 'RIGHT' x-alignment of the text
    },
    pressure_logo = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = 15.0,         y_offset = 57.0,                -- offset from origin (top-right corner of a day number)
        size = 16.0,                                        -- font size
        font = 'ConkyColors',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0xD0D0D0,
        alpha = 0.8,
        text = 'l',
        x_align = 'LEFT'                                   -- 'LEFT', 'RIGHT' x-alignment of the text
  },
    pressuretext = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = 32.0,         y_offset = 65.0,                -- offset from origin (top-right corner of a day number)
        size = 12.0,                                        -- font size
        font = 'Liberation Serif',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0xD0D0D0,
        alpha = 0.8,
        text = string.format("${exec cat %s/openweathermap.conf | grep pressure_hpa | cut -d';' -f 2}",master_settings.weather.path_conf),
        x_align = 'LEFT'                                   -- 'LEFT', 'RIGHT' x-alignment of the text
    },
    humidity_logo = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = 73.0,         y_offset = 57.0,                -- offset from origin (top-right corner of a day number)
        size = 15.0,                                        -- font size
        font = 'ConkyColors',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0xD0D0D0,
        alpha = 0.8,
        text = 'm',
        x_align = 'LEFT'                                   -- 'LEFT', 'RIGHT' x-alignment of the text
  },
    humiditytext = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = 90.0,         y_offset = 65.0,                -- offset from origin (top-right corner of a day number)
        size = 12.0,                                        -- font size
        font = 'Liberation Serif',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0xD0D0D0,
        alpha = 0.8,
        text = string.format("${exec cat %s/openweathermap.conf | grep humidity_perc | cut -d';' -f 2}",master_settings.weather.path_conf),
        x_align = 'LEFT'                                   -- 'LEFT', 'RIGHT' x-alignment of the text
    },
    sunrise_sun_logo = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = 131.0,         y_offset = 30.0,                -- offset from origin (top-right corner of a day number)
        size = 18.0,                                        -- font size
        font = 'ConkyColorsWeather',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0xD0D0D0,
        alpha = 0.8,
        text = 'a',
        x_align = 'LEFT'                                   -- 'LEFT', 'RIGHT' x-alignment of the text
  },
  sunrise_arrow_logo = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = 131.0,         y_offset = 32.0,                -- offset from origin (top-right corner of a day number)
        size = 7.0,                                        -- font size
        font = 'ConkyColors',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0xD0D0D0,
        alpha = 0.8,
        text = 'x',
        x_align = 'LEFT'                                   -- 'LEFT', 'RIGHT' x-alignment of the text
  },
    sunrisetext = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = 148.0,         y_offset = 40.0,                -- offset from origin (top-right corner of a day number)
        size = 12.0,                                        -- font size
        font = 'Liberation Serif',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0xD0D0D0,
        alpha = 0.8,
        text = string.format("${exec cat %s/openweathermap.conf | grep sunrise_time | cut -d';' -f 2}",master_settings.weather.path_conf),
        x_align = 'LEFT'                                   -- 'LEFT', 'RIGHT' x-alignment of the text
    },
  sunset_sun_logo = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = 131.0,         y_offset = 55.0,                -- offset from origin (top-right corner of a day number)
        size = 18.0,                                        -- font size
        font = 'ConkyColorsWeather',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0xD0D0D0,
        alpha = 0.8,
        text = 'a',
        x_align = 'LEFT'                                   -- 'LEFT', 'RIGHT' x-alignment of the text
  },
  sunset_arrow_logo = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = 131.0,         y_offset = 57.0,                -- offset from origin (top-right corner of a day number)
        size = 7.0,                                        -- font size
        font = 'ConkyColors',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0xD0D0D0,
        alpha = 0.8,
        text = 'w',
        x_align = 'LEFT'                                   -- 'LEFT', 'RIGHT' x-alignment of the text
  },
    sunsettext = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = 148.0,         y_offset = 65.0,                -- offset from origin (top-right corner of a day number)
        size = 12.0,                                        -- font size
        font = 'Liberation Serif',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0xD0D0D0,
        alpha = 0.8,
        text = string.format("${exec cat %s/openweathermap.conf | grep sunset_time | cut -d';' -f 2}",master_settings.weather.path_conf),
        x_align = 'LEFT'                                   -- 'LEFT', 'RIGHT' x-alignment of the text
    },
    update_logo = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = -33.0,         y_offset = 60.0,                -- offset from origin (top-right corner of a day number)
        size = 10.0,                                        -- font size
        font = 'ConkyColors',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0xD0D0D0,
        alpha = 0.8,
        text = 'y',
        x_align = 'LEFT'                                   -- 'LEFT', 'RIGHT' x-alignment of the text
  },
    updatetext = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = -24.0,         y_offset = 60.0,                -- offset from origin (top-right corner of a day number)
        size = 10.0,                                        -- font size
        font = 'Liberation Serif',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0xD0D0D0,
        alpha = 0.8,
        text = string.format("${exec cat %s/openweathermap.conf | grep last_update | cut -d';' -f 2}",master_settings.weather.path_conf),
        x_align = 'LEFT'                                   -- 'LEFT', 'RIGHT' x-alignment of the text
    },
}

system = {
    
    cpu_logo = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = 2.0,         y_offset = 0.0,                -- offset from origin (top-right corner of a day number)
        size = 13.0,                                        -- font size
        font = 'ConkyColors',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0xD0D0D0,
        alpha = 0.8,
        text = 'e',
        x_align = 'LEFT'                                   -- 'LEFT', 'RIGHT' x-alignment of the text
    },
    cputext = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = 14.0,         y_offset = 10.0,                -- offset from origin (top-right corner of a day number)
        size = 10.0,                                        -- font size
        font = 'Liberation Serif',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0xD0D0D0,
        alpha = 0.8,
        text = "${cpu cpu0}%",
        x_align = 'LEFT'                                   -- 'LEFT', 'RIGHT' x-alignment of the text
    },
    ram_logo = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = 45.0,         y_offset = 0.0,                -- offset from origin (top-right corner of a day number)
        size = 15.0,                                        -- font size
        font = 'ConkyColors',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0xD0D0D0,
        alpha = 0.8,
        text = 'f',
        x_align = 'LEFT'                                   -- 'LEFT', 'RIGHT' x-alignment of the text
    },
    ramtext = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = 59.0,         y_offset = 10.0,                -- offset from origin (top-right corner of a day number)
        size = 10.0,                                        -- font size
        font = 'Liberation Serif',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0xD0D0D0,
        alpha = 0.8,
        text = "${memperc}%",
        x_align = 'LEFT'                                   -- 'LEFT', 'RIGHT' x-alignment of the text
    },
    battery_logo = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = 90.0,         y_offset = 0.0,                -- offset from origin (top-right corner of a day number)
        size = 15.0,                                        -- font size
        font = 'ConkyColors',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0xD0D0D0,
        alpha = 0.8,
        text = '5',
        x_align = 'LEFT'                                   -- 'LEFT', 'RIGHT' x-alignment of the text
    },
    batterytext = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = 104.0,         y_offset = 10.0,                -- offset from origin (top-right corner of a day number)
        size = 10.0,                                        -- font size
        font = 'Liberation Serif',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0xD0D0D0,
        alpha = 0.8,
        text = "${battery_percent BAT1}%",
        x_align = 'LEFT'                                   -- 'LEFT', 'RIGHT' x-alignment of the text
    },
    wifi_logo = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = 135.0,         y_offset = 0.0,                -- offset from origin (top-right corner of a day number)
        size = 15.0,                                        -- font size
        font = 'ConkyColors',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0xD0D0D0,
        alpha = 0.8,
        text = 'k',
        x_align = 'LEFT'                                   -- 'LEFT', 'RIGHT' x-alignment of the text
    },
    wifitext = {
        status = 1,                                         -- 1:ON, 0:OFF
        x_offset = 147.0,         y_offset = 10.0,                -- offset from origin (top-right corner of a day number)
        size = 10.0,                                        -- font size
        font = 'Liberation Serif',
        slant = CAIRO_FONT_SLANT_NORMAL,
        weight = CAIRO_FONT_WEIGHT_NORMAL,
        rgb = 0xD0D0D0,
        alpha = 0.8,
        text = "${if_up wlp5s0}${wireless_link_qual_perc wlp5s0}%${else}offline${endif}",
        x_align = 'LEFT'                                   -- 'LEFT', 'RIGHT' x-alignment of the text
    },
}


-------------------------------------------------------------------------------
-- Functions start here
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
-- converts color in hex to decimal R,G,B values and pass along alpha value
function convert_rgba_split(rgb, alpha)
    return ((rgb / 0x10000) % 0x100) / 255.0, ((rgb / 0x100) % 0x100) / 255.0, (rgb % 0x100) / 255.0, alpha
end


-------------------------------------------------------------------------------
-- print clock in 24h format "HH:MM" with fixed position of ":"
function draw_clock(cr)

    if master_settings.clock.status == 0 then return end    -- no date visualisation

    local x_org = master_settings.clock.x       -- clock origin
    local y_org = master_settings.clock.y
    local x, y = 0, 0               -- generic position variables

    local fe=cairo_font_extents_t:create()
    tolua.takeownership(fe)     -- garbage collection - don't know if used correctly or if it is even needed

    local te=cairo_text_extents_t:create()
    tolua.takeownership(te)     -- garbage collection - don't know if used correctly or if it is even needed

    -- get current time
    local hour = conky_parse('${time %0H}')
    local minute = conky_parse('${time %0M}')
        -- string.format('%02d', tonumber(conky_parse('${time %H}')))   -- possible formating

    cairo_set_font_size(cr, clock.size)
    cairo_set_source_rgba (cr,convert_rgba_split(clock.rgb, clock.alpha))
    cairo_select_font_face (cr, clock.font, clock.slant, clock.weight)

    cairo_font_extents (cr, fe)

    -- print ":"
    cairo_text_extents (cr, ':', te)
    x = x_org - te.x_bearing - te.width / 2
    y = y_org  - fe.ascent/2 + te.height/2 + clock.y_offset
    cairo_move_to (cr, x, y)
    cairo_show_text (cr, ':')

    -- print hours
    cairo_text_extents (cr, hour, te)
    x = x_org - te.x_bearing - te.width - clock.x_offset
    y = y_org
    cairo_move_to (cr, x, y)
    cairo_show_text (cr, hour)

    --print minutes
    cairo_text_extents (cr, minute, te)
    x = x_org - te.x_bearing + clock.x_offset
    y = y_org
    cairo_move_to (cr, x, y)
    cairo_show_text (cr, minute)
    
end


-------------------------------------------------------------------------------
-- draw each element present in date
function date_part(cr, x_org, y_org, setting)
    if setting.status == 0 then return end  -- no date element visualisation

    local text = conky_parse(setting.text)

    local fe=cairo_font_extents_t:create()
    tolua.takeownership(fe)     -- garbage collection - don't know if used correctly or if it is even needed

    local te=cairo_text_extents_t:create()
    tolua.takeownership(te)     -- garbage collection - don't know if used correctly or if it is even needed

    cairo_set_font_size(cr, setting.size)
    cairo_set_source_rgba (cr,convert_rgba_split(setting.rgb, setting.alpha))
    cairo_select_font_face (cr, setting.font, setting.slant, setting.weight)

    cairo_font_extents (cr, fe)

    cairo_text_extents (cr, text, te)

        if setting.x_align == 'RIGHT' then
            x = x_org - te.x_bearing  - te.width + setting.x_offset
        elseif setting.x_align == 'LEFT' then
            x = x_org - te.x_bearing + setting.x_offset
        else
            return      -- error in config
        end
    y = y_org + fe.ascent + setting.y_offset    --"+fe.ascent" instead of "-te.y_bearing" also possible but it holds different values depending on the text

    cairo_move_to (cr, x, y)
    cairo_show_text (cr, text)

end


-------------------------------------------------------------------------------
-- main date procedure
function draw_date(cr)

    if master_settings.date.status == 0 then return end -- no date visualisation

    for iii in pairs(date)  do
        date_part(cr, master_settings.date.x, master_settings.date.y, date[iii])
    end
end

-------------------------------------------------------------------------------
-- draw each element present in weather
function weather_part(cr, x_org, y_org, setting)
    if setting.status == 0 then return end  -- no weather element visualisation

    local text = conky_parse(setting.text)

    local fe=cairo_font_extents_t:create()
    tolua.takeownership(fe)     -- garbage collection - don't know if used correctly or if it is even needed

    local te=cairo_text_extents_t:create()
    tolua.takeownership(te)     -- garbage collection - don't know if used correctly or if it is even needed

    cairo_set_font_size(cr, setting.size)
    cairo_set_source_rgba (cr,convert_rgba_split(setting.rgb, setting.alpha))
    cairo_select_font_face (cr, setting.font, setting.slant, setting.weight)

    cairo_font_extents (cr, fe)

    cairo_text_extents (cr, text, te)

        if setting.x_align == 'RIGHT' then
            x = x_org - te.x_bearing  - te.width + setting.x_offset
        elseif setting.x_align == 'LEFT' then
            x = x_org - te.x_bearing + setting.x_offset
        else
            return      -- error in config
        end
    y = y_org + fe.ascent + setting.y_offset    --"+fe.ascent" instead of "-te.y_bearing" also possible but it holds different values depending on the text

    cairo_move_to (cr, x, y)
    cairo_show_text (cr, text)
    

end


-------------------------------------------------------------------------------
-- main weather procedure
function draw_weather(cr)

    if master_settings.weather.status == 0 then return end -- no weather visualisation

    for iii in pairs(weather)  do
        weather_part(cr, master_settings.weather.x, master_settings.weather.y, weather[iii])
    end
end

-------------------------------------------------------------------------------
-- draw each element present in system
function system_part(cr, x_org, y_org, setting)
    if setting.status == 0 then return end  -- no system element visualisation

    local text = conky_parse(setting.text)

    local fe=cairo_font_extents_t:create()
    tolua.takeownership(fe)     -- garbage collection - don't know if used correctly or if it is even needed

    local te=cairo_text_extents_t:create()
    tolua.takeownership(te)     -- garbage collection - don't know if used correctly or if it is even needed

    cairo_set_font_size(cr, setting.size)
    cairo_set_source_rgba (cr,convert_rgba_split(setting.rgb, setting.alpha))
    cairo_select_font_face (cr, setting.font, setting.slant, setting.weight)

    cairo_font_extents (cr, fe)

    cairo_text_extents (cr, text, te)

        if setting.x_align == 'RIGHT' then
            x = x_org - te.x_bearing  - te.width + setting.x_offset
        elseif setting.x_align == 'LEFT' then
            x = x_org - te.x_bearing + setting.x_offset
        else
            return      -- error in config
        end
    y = y_org + fe.ascent + setting.y_offset    --"+fe.ascent" instead of "-te.y_bearing" also possible but it holds different values depending on the text

    cairo_move_to (cr, x, y)
    cairo_show_text (cr, text)
    

end


-------------------------------------------------------------------------------
-- main system procedure
function draw_system(cr)

    if master_settings.system.status == 0 then return end -- no system visualisation

    for iii in pairs(system)  do
        system_part(cr, master_settings.system.x, master_settings.system.y, system[iii])
    end
end


-------------------------------------------------------------------------------
-- Main function called by conky
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
-- Main function called by conky
function conky_main()
    if conky_window == nil then
        return
    end

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

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

    cairo_save (cr)
    cairo_scale (cr, master_settings.scale.x, master_settings.scale.y)  -- If you don't want to use a amagnifying glass this scales everything

    if updates > 3 then

        draw_clock(cr)
        draw_date(cr)
        draw_weather(cr)
        draw_system(cr)

    end

    cairo_restore(cr)                                                   -- restore scale setting to 1.0,1.0
    
    
    cairo_destroy(cr)
    cairo_surface_destroy(cs)
    cr=nil
    
end

openweather.sh:

#!/bin/sh

#-------------------------------------------
# SETTINGS (use "openweathermap.org" for city-id and APPID (free account for current weather))
path_conf=~/.conky/conky_openweather/scripts #use the same path as in 'openweathermap.lua'
path_tz=Europe/Amsterdam
language='nl'
city_id='0000000'
appid_key='11112222333344445555666677778888'
#-------------------------------------------

out=`curl -s --connect-timeout 30 http://api.openweathermap.org/data/2.5/weather\?id\=${city_id}\&lang=${language}\&units\=metric\&mode\=xml\&APPID\=${appid_key}`


time_now=$(date +%F\ %H:%M)

time_compare=$(date +%H%M)

temp_now=`echo $out | perl -ne 'if (/temperature/) {chomp;/\<temperature value="(.*)?\" min.*<\/temperature\>/; print "$1"; }' | cut -d'.' -f 1`
if [ -z $temp_now ]; then
    temp_now=`echo $out | perl -ne 'if (/temperature/) {chomp;/\<temperature value="(.*)?\" min.*<\/temperature\>/; print "$1"; }'`
fi

cond=`echo $out | perl -ne 'if (/weather/) {chomp;/\<weather .* value="(.*)?\" icon.*<\/weather\>/; print "$1"; }'`

icon=`echo $out | perl -ne 'if (/weather/) {chomp;/\<weather number="(.*)?\" value.*<\/weather\>/; print "$1"; }'`

humidity=`echo $out | perl -ne 'if (/humidity/) {chomp;/\<humidity value="(.*)?\" unit.*<\/humidity\>/; print "$1"; }'`

pressure=`echo $out | perl -ne 'if (/pressure/) {chomp;/\<pressure value="(.*)?\" unit.*<\/pressure\>/; print "$1"; }'`

wind_speed=`echo $out | perl -ne 'if (/speed/) {chomp;/\<speed value="(.*)?\" name.*<\/speed\>/; print "$1"; }'  | cut -d'.' -f 1`
if [ -z $wind_speed ]; then
    wind_speed=`echo $out | perl -ne 'if (/speed/) {chomp;/\<speed value="(.*)?\" name.*<\/speed\>/; print "$1"; }'`
fi

wind_direction=`echo $out | perl -ne 'if (/direction/) {chomp;/\<direction .* code="(.*)?\" name.*<\/direction\>/; print "$1"; }'`

cloud_cover=`echo $out | perl -ne 'if (/clouds/) {chomp;/\<clouds value="(.*)?\" name.*<\/clouds\>/; print "$1"; }'`


last_update_utc=`echo $out | perl -ne 'if (/lastupdate/) {chomp;/\<lastupdate value=.*T(.*)?\"><\/lastupdate\>/; print "$1"; }' | cut -c 1-5`
last_update=$( TZ=$path_tz date -d "$last_update_utc UTC" +%H:%M )


sun_rise_utc=`echo $out | perl -ne 'if (/sun/) {chomp;/\<sun rise=".*T(.*)?\" set.*<\/sun\>/; print "$1"; }' | cut -c 1-5`
sun_rise=$( TZ=$path_tz date -d "$sun_rise_utc UTC" +%H:%M )


sun_set_utc=`echo $out | perl -ne 'if (/sun/) {chomp;/\<sun .* set=".*T(.*)?\"><\/sun\>/; print "$1"; }' | cut -c 1-5`
sun_set=$( TZ=$path_tz date -d "$sun_set_utc UTC" +%H:%M )


sun_rise_hour=`echo $sun_rise | cut -d':' -f 1`
sun_rise_minute=`echo $sun_rise | cut -d':' -f 2`

sun_set_hour=`echo $sun_set | cut -d':' -f 1`
sun_set_minute=`echo $sun_set | cut -d':' -f 2`

sun_rise_compare=`echo "$sun_rise_hour$sun_rise_minute"`
sun_set_compare=`echo "$sun_set_hour$sun_set_minute"`


if [ $time_compare -lt $sun_rise_compare ];then
    icon_day=0
elif [ $time_compare -lt $sun_set_compare ];then
    icon_day=1
else
    icon_day=0
fi

if [ ! -z $wind_speed ]; then
    if [ $wind_speed -lt 1 ]; then
        wind_bft="0"
    elif [ $wind_speed -lt 2 ]; then
        wind_bft="1"
    elif [ $wind_speed -lt 3 ]; then
        wind_bft="2"
    elif [ $wind_speed -lt 5 ]; then
        wind_bft="3"
    elif [  $wind_speed -lt 8 ]; then
        wind_bft="4"
    elif [ $wind_speed -lt 10 ]; then
        wind_bft="5"
    elif [ $wind_speed -lt 13 ]; then
        wind_bft="6"
    elif [ $wind_speed -lt 17 ]; then
        wind_bft="7"
    elif [ $wind_speed -lt 20 ]; then
        wind_bft="8"
    elif [ $wind_speed -lt 24 ]; then
        wind_bft="9"
    elif [ $wind_speed -lt 28 ]; then
        wind_bft="10"
    elif [ $wind_speed -lt 32 ]; then
        wind_bft="11"
    else
        wind_bft="12"
    fi
else
    wind_bft="0"
fi

if [ $cloud_cover -lt 40 ]; then
    if [ $icon_day -eq 1 ]; then
        icon_cloud='b'
    else
        icon_cloud='C'
    fi
elif [ $cloud_cover -lt 60 ]; then
    if [ $icon_day -eq 1 ]; then
        icon_cloud='c'
    else
        icon_cloud='C'
    fi
elif [ $cloud_cover -lt 80 ]; then
    icon_cloud='e'
else
    icon_cloud='f'
fi

echo "temp_cond;"$temp_now"°C, "$cond > $path_conf/openweathermap.conf
echo "wind_speeddir;"$wind_bft" "$wind_direction >> $path_conf/openweathermap.conf
echo "sunrise_time;"$sun_rise >> $path_conf/openweathermap.conf
echo "sunset_time;"$sun_set >> $path_conf/openweathermap.conf
echo "cloud_cover;"$cloud_cover"%" >> $path_conf/openweathermap.conf
echo "cloud_icon;"$icon_cloud >> $path_conf/openweathermap.conf
echo "pressure_hpa;"$pressure >> $path_conf/openweathermap.conf
echo "humidity_perc;"$humidity"%" >> $path_conf/openweathermap.conf
echo "last_update;"$last_update >> $path_conf/openweathermap.conf


case "$icon" in

'200')
    if [ $icon_day -eq 1 ]; then
        echo -e "k"
    else
        echo -e "K"
    fi
;;
'201')
    echo -e "m"
;;
'202')
    echo -e "n"
;;
'210')
    echo -e "l"
;;
'211')
    echo -e "l"
;;
'212')
    echo -e "l"
;;
'221')
    echo -e "m"
;;
'230')
    echo -e "m"
;;
'231')
    echo -e "n"
;;
'232')
    echo -e "n"
;;
'300')
    echo -e "s"
;;
'301')
    echo -e "t"
;;
'302')
    echo -e "t"
;;
'310')
    echo -e "u"
;;
'311')
    echo -e "u"
;;
'312')
    echo -e "u"
;;
'313')
    echo -e "u"
;;
'314')
    echo -e "u"
;;
'321')
    echo -e "j"
;;
'500')
    if [ $icon_day -eq 1 ];then
        echo -e "g"
    else
        echo -e "G"
    fi
;;
'501')
    if [ $icon_day -eq 1 ];then
        echo -e "g"
    else
        echo -e "G"
    fi
;;
'502')
    echo -e "h"
;;
'503')
    echo -e "i"
;;
'504')
    echo -e "j"
;;
'511')
    echo -e "y"
;;
'520')
    echo -e "i"
;;
'521')
    echo -e "i"
;;
'522')
    echo -e "j"
;;
'531')
    echo -e "j"
;;
'600')
    if [ $icon_day -eq 1 ];then
        echo -e "o"
    else
        echo -e "O"
    fi
;;
'601')
    echo -e "p"
;;
'602')
    echo -e "q"
;;
'611')
    echo -e "v"
;;
'612')
    echo -e "v"
;;
'615')
    echo -e "x"
;;
'616')
    echo -e "x"
;;
'620')
    echo -e "x"
;;
'621')
    echo -e "x"
;;
'622')
    echo -e "x"
;;
'701')
    echo -e "9"
;;
'711')
    echo -e "9"
;;
'721')
    echo -e "9"
;;
'731')
    echo -e "8"
;;
'741')
    echo -e "0"
;;
'751')
    echo -e "8"
;;
'761')
    echo -e "8"
;;
'762')
    echo -e "8"
;;
'771')
    echo -e "8"
;;
'781')
    echo -e "8"
;;
'800')
    if [ $icon_day -eq 1 ];then
        echo -e "a"
    else
        echo -e "A"
    fi
;;
'801')
    if [ $icon_day -eq 1 ];then
        echo -e "b"
    else
        echo -e "C"
    fi
;;
'802')
    if [ $icon_day -eq 1 ];then
        echo -e "c"
    else
        echo -e "C"
    fi
;;
'803')
    echo -e "e"
;;
'804')
    echo -e "f"
;;
*)
    if [ $icon_day -eq 1 ];then
        echo -e "c"
    else
        echo -e "C"
    fi
    
    if [ -z "$temp_now" ]; then
        echo "temp_cond;No information" > $path_conf/openweathermap.conf
    else
        echo "no icon: $icon, $cond, $time_now" >> $path_conf/openweathermap_error.conf
    fi
esac

exit 1

#257

Using conky for the first time. Took a while to edit :smiley:

System info

conky.config = {
	alignment = 'top_right',
	background = true,
	color2 = '00b386',
	cpu_avg_samples = 2,
	default_color = '1ed1b1',
	double_buffer = true,
	font = 'Noto Sans Mono:size=10',
	draw_shades = false,
	gap_x = 25,
	gap_y = 45,
	minimum_width = 250,
	no_buffers = true,
	own_window = true,
	own_window_class = "Conky",
	own_window_type = 'desktop',
	own_window_transparent = true,
	update_interval = 2.0,
	use_xft = true,
}
conky.text = [[
${voffset 8}${color2}${font Noto Sans Mono:size=16}${time %A}$font${voffset -8}$alignr$color${font Noto Sans Mono:size=38}${time %e}$font
$color${voffset -30}$color${font Noto Sans Mono:size=18}${time %b}$font${voffset -3} $color${font Noto Sans Mono:size=20}${time %Y}$font${color2}${voffset 2}$hr${color}

${font Noto Sans Mono:size=12}SYSTEM${font} ${hr}
Host${alignr}${color2}${nodename}${color}
Kernel${alignr}${color2}${exec uname -r}${color}
Uptime${alignr}${color2}${uptime}${color}
CPU Frequency${alignr}${color2}${freq_g} GHz${color}
CPU Temperature$alignr${color2}${hwmon temp 1} Degrees${color}

${font Noto Sans Mono:size=12}DISK USAGE${font} ${hr}
Root${alignr}${color2}${fs_used /} of ${fs_size /}${color}
$fs_used_perc% ${color2}${fs_bar 4 /}${color}

${font Noto Sans Mono:size=12}CPU${font} ${hr}
$cpu% ${color2}${cpubar 4}${color}
${top name 1}$alignr${color2}${top cpu 1}%${color}
${top name 2}$alignr${color2}${top cpu 2}%${color}
${top name 3}$alignr${color2}${top cpu 3}%${color}
${top name 4}$alignr${color2}${top cpu 4}%${color}

${font Noto Sans Mono:size=12}MEMORY${font} ${hr}
RAM${alignr}${color2}${mem} of ${memmax}${color}
$memperc% ${color2}$membar${color}
Swap${alignr}${color2}${swap} of ${swapmax}${color}
$swapperc% ${color2}$swapbar${color}
${top_mem name 1}${alignr}${color2}${top_mem mem_res 1}${color}
${top_mem name 2}${alignr}${color2}${top_mem mem_res 2}${color}
${top_mem name 3}${alignr}${color2}${top_mem mem_res 3}${color}
${top_mem name 4}${alignr}${color2}${top_mem mem_res 4}${color}
]];

Shortcut Keys

conky.config = {
	alignment = 'bottom_right',
	background = true,
	color2 = '00b386',
	cpu_avg_samples = 2,
	default_color = '1ed1b1',
	double_buffer = true,
	font = 'Noto Sans Mono:size=10',
	draw_shades = false,
	gap_x = 25,
	gap_y = 45,
	minimum_width = 250,
	no_buffers = true,
	own_window = true,
	own_window_class = "Conky",
	own_window_type = 'desktop',
	own_window_transparent = true,
	update_interval = 2.0,
	use_xft = true,
}
conky.text = [[
${font Noto Sans Mono:size=12}Shortcut Keys$font
${color2}${hr}${color}
[PrtSc]${alignr}${color2}Screenshot${color}
[Ctrl] + Space${alignr}${color2}Synapse${color}
[Super] + Space${alignr}${color2}Openbox Menu${color}
[Alt] + Space${alignr}${color2}Window Menu${color}
[Alt] + F1${alignr}${color2}JG Menu${color}
[Alt] + F2${alignr}${color2}Rofi Launcher${color}
[Super] + [Enter]${alignr}${color2}Terminal${color}
[Super] + e${alignr}${color2}Text Editor${color}
[Super] + f${alignr}${color2}File Manager${color}
[Super] + m${alignr}${color2}Music Player${color}
[Super] + w${alignr}${color2}Web Browser${color}
[Super] + v${alignr}${color2}Audio Control${color}
[Super] + s${alignr}${color2}Window Switcher${color}
[Ctrl] + [Alt] + L${alignr}${color2}Lock${color}
[Ctrl] + [Alt] + [Delete]${alignr}${color2}Logout${color}
]];

Neverending November (2018) Screenshots
#258

My tiny conky panel saves a lot of screen space.

Conky Code
conky.config = {
    alignment = 'top_right',
    background = true,
    border_width = 1,
    cpu_avg_samples = 2,
	default_color = 'white',
    default_outline_color = 'black',
    default_shade_color = 'black',
	color1 = '#32c05c', -- Green
	color2 = '#1793d1', -- Blue
	color3 = '#ffa300', -- Orange
	color4 = '#9a9d9f', -- Light Gray
    draw_borders = false,
    draw_graph_borders = true,
    draw_outline = false,
    draw_shades = false,
    use_xft = true,
    font = 'Cantarell:size=8',
    gap_x = 5,
    gap_y = 0,
    minimum_height = 1080,
	maximum_height = 1080,
	minimum_width = 50,
	maximum_width = 50,
    net_avg_samples = 2,
    no_buffers = true,
    double_buffer = true,
    out_to_console = false,
    out_to_stderr = false,
    extra_newline = false,
    own_window = true,
	own_window_colour = '#13191c', -- Dark Gray
    own_window_transparent = false,
    own_window_argb_visual = true,
    own_window_argb_value = 255,
    own_window_type = 'desktop',
    own_window_class = 'Conky',
    stippled_borders = 0,
    update_interval = 2.0,
    uppercase = false,
    use_spacer = 'none',
    show_graph_scale = false,
    show_graph_range = false
}

conky.text = [[
##########################
# OS Section
##########################
${voffset 5}${alignc}$color2${font Cantarell:size=16:weight:Bold}$nodename
${font Cantarell:size=10}${color1}Manjaro
${voffset 5}${alignr}$color4${font}Version
${alignr}${font Cantarell:size=10}${color}${execi 10000 awk -F= '/EASE=/ {printf $2}' /etc/lsb-release}
${alignr}$color4${font}Code
${alignr}${font Cantarell:size=10}${color}${execi 10000 awk -F= '/NAME/ {print $2}' /etc/lsb-release}
${alignr}$color4${font}Kernel
${font Cantarell:size=10}${color}$kernel
${alignr}$color4${font}Cinnamon
${alignr}${font Cantarell:size=10}${color}${execi 10000 cinnamon --version | sed 's/.* //'}
${alignr}$color4${font}Branch
${alignr}${font Cantarell:size=10}${color}${execi 300 pacman-mirrors --api --get-branch}
${alignr}$color4${font}Packages
${alignr}${font Cantarell:size=10}${color}${execi 300 pacman -Qq | wc -l}
${alignr}$color4${font}Updates
${alignr}${font Cantarell:size=10}${color}${execi 100 checkupdates | wc -l}
##########################
# CPU Section
##########################
${voffset 5}$color2${font Cantarell:weight=Bold:size=12}CPU
${voffset 5}${alignr}$color3${font Cantarell:size=12:weight:Bold}${cpu cpu0}%
$color4${font}Core
${voffset -8}$color4$hr
${color}${font Cantarell:size=10}1${alignr}${cpu cpu1}%
2${alignr}${cpu cpu2}%
3${alignr}${cpu cpu3}%
4${alignr}${cpu cpu4}%
5${alignr}${cpu cpu5}%
6${alignr}${cpu cpu6}%
7${alignr}${cpu cpu7}%
8${alignr}${cpu cpu8}%
${voffset -6}$color4$hr
${alignr}$color4${font}Speed
${alignr}$font$color${freq_g 1} GHz
${alignr}$color4${font}Temp.
${alignr}${font Cantarell:size=9}$color${hwmon 1 temp 1} °C
${voffset -5}$color4$hr
$color4${alignr}Tasks
$color$processes ${color4}total
##########################
# RAM Section
##########################

$color2${font Cantarell:weight=Bold:size=12}RAM
# Ram used in % | RAM used / installed RAM
${alignr}${font Cantarell:size=11:weight:Bold}$color3$memperc%
${alignr}$color4${font}Usage
${font Cantarell:size=10}${alignr}$color$mem
${voffset 5}${alignr}$color4${font}Installed
${font Cantarell:size=10}${alignr}$color$memmax

##########################
# Disk Section
##########################
$color2${font Cantarell:weight=Bold:size=12}DISK
${alignr}$color4${font}Read
${alignr}$color${font Cantarell:size=9}$diskio_read
${voffset 5}${alignr}$color4${font}Write
${alignr}$color${font Cantarell:size=9}$diskio_write
##########################
# Network Section
##########################

$color2${font Cantarell:weight=Bold:size=12}LAN
${alignr}$color4${font}Receive
${alignr}$color${font Cantarell:size=9}${downspeed enp0s31f6}
${alignr}$color${font Cantarell:size=9}${totaldown enp0s31f6}
${voffset 5}${alignr}$color4${font}Send
${alignr}$color${font Cantarell:size=9}${upspeed enp0s31f6}
${alignr}$color${font Cantarell:size=9}${totalup enp0s31f6}
##########################
# Volume Section
##########################

$color2${font Cantarell:weight=Bold:size=12}VOL
${voffset 5}${alignr}${font Cantarell:size=11:weight:Bold}$color3${execi 5 pulsemixer --get-volume | sed 's/.* //'}%
${voffset -8}$color4$hr
]]