You are not logged in.

#1501 2021-04-09 14:39:37

ohnonot
...again
Registered: 2015-09-29
Posts: 5,568

Re: Show us your conky

sleekmason wrote:

Trying to get this to work.  Won't grab the colors.lua? ...

Opening conky in terminal shows no errors. (calling with both conky.conf, or renaming to "conky.lua" and calling with "conky -c conky.lua"

Here is what I have:

-- get current GTK theme
cmd = io.popen('grep "^[[:space:]]*gtk-theme-name" "$XDG_CONFIG_$HOME/.config/gtk-3.0/settings.ini" | cut -d\\= -f2')
theme = cmd:read('*a')
io.close(cmd)

-- try to find colors.lua in $HOME's GTK theme folder...
theme_file = os.getenv("HOME") .. '/.local/share/themes/' .. string.gsub(theme, '[\n]+', '') .. '/conky/colors.lua'
-- ...test if file exists and is readable
f = io.open(theme_file,"r")
if f~=nil then
    io.close(f)
    -- "source" it
    dofile(theme_file)
else
    -- fallback to default colors
    foreground = "CB0D09"
    -- ...
    white0     = "CB0D09"
    -- ...
    white1     = "CB0D09"
    -- etc. ...
end

-- more variables to be used inside conky.config
largefont = 'Cascadia Mono:style=ExtraLight:size=20'

conky.config = {

--  Window Settings
   own_window = true,
   own_window_type = 'desktop',
   own_window_hints = 'undecorated,below,skip_taskbar,skip_pager,sticky',
   own_window_colour = '#182423',
   own_window_class = 'Conky',
   own_window_transparent = true,
--   own_window_argb_visual = true,
--   own_window_argb_value = 1000,




    minimum_width = 180, minimum_height = 0, 
    maximum_width = 180,

    gap_x = 2,-- left | right
    gap_y = 28,-- up | down

    alignment = 'top_right',
    use_xft = true,

--font = 'DejaVu Sans regular:size=10',

    xftalpha = 1,

-- Force UTF8
    override_utf8_locale = true,

    uppercase = false,

    draw_shades = false,
    default_shade_color = '000000',

    draw_outline = false,
    default_outline_color = '000000',

 
 --default_color = '#617B80',
    draw_borders = false,
    stippled_borders = 0,
    border_inner_margin = 5,
    border_outer_margin = 0,
    border_width = 1,
    draw_graph_borders = true,
--default_graph_height = 15,
--default_graph_width = 40,
 
    background = true,
    use_spacer = 'none',

--text_buffer_size = 3114,
    no_buffers = true,
    short_units = true,

    imlib_cache_size = 0,
    double_buffer = true,

--max_user_text = 16384,

--temperature_unit = 'Fahrenheit',

-- Update interval in seconds
    update_interval = 1,

--  End Miscellaneous Section
};


conky.text = [[
${font Dejavu Sans:Book:size=12}${execi 999999 lsb_release -is} $alignr${time %T}
${hr}
${font Dejavu Sans:Book:size=10}Kernel${alignr}${kernel}
Governor: ${alignr}${execpi 120 $HOME/.config/conky/scripts/gov}
IO Sched: ${alignr}${ioscheduler /dev/sda}

Uptime:${alignr}${uptime}
Total Installed: ${alignr}${execpi 360 $HOME/.config/conky/scripts/apps}
Processes:${alignr}${processes}
CPU:${alignr}${cpu cpu0}%
${cpubar 4 ,60}

${color}Ram:${alignr}$mem  / $memmax
${membar 4} 
${color}Swap:${alignr}$swap  / $swapmax
${swapbar 4}

Root: $alignr ${fs_used /} / ${fs_size /}
${fs_bar 4 /}
Home: $alignr ${fs_used /home} / ${fs_size /home}
${fs_bar 4 /home}

Up: $alignr${upspeed wlp2s0}
$alignr${upspeedgraph wlp2s0 8,180}
Down: $alignr${downspeed wlp2s0}
$alignr${downspeedgraph wlp2s0 8,180}

Battery:$alignr${battery_percent BAT0}%
$alignr${battery_bar 4,180 BAT0}

${execi 3114 fortune -s | fold -s -w24}

${execpi 20 $HOME/.config/conky/scripts/drive}

${execpi 600 $HOME/.config/conky/scripts/bunsenweather.sh}
]];

And then made a folder:

/home/sleekmason/.local/share/themes/Lilidog-Clay/conky/colors.lua

Used the nordic colors you provided as a template, then changed the foreground/background to test.
Made everything executable.

Anyhow, I changed all colors to red to check both the colors.lua, and the fallback colors, but conky comes out "white" every time.

What am I missing?

Does it pick up the theme from ~/.config/gtk-3.0/settings.ini? Should be "Lilidog-Clay".

But more importantly, you aren't "injecting" the sourced colors anywhere.
See this bit:

conky.config = {
default_color = '#' .. foreground,
color0 = '#' .. white0,

Assuming colors.lua contains at least "foreground=..." and "color0=...".
These are just string variables, you have to tell conky, or rather lua, what to do with them. It doesn't somehow magically "understand" that they are supposed to be conky colors.

Last edited by ohnonot (2021-05-27 18:00:58)


Give to COVAX! Here or here. (explanation)
My Repos: notabug | framagit

Offline

#1502 2021-04-09 17:54:28

sleekmason
zoom
Registered: 2018-05-22
Posts: 653
Website

Re: Show us your conky

ohnonot wrote:

But more importantly, you aren't "injecting" the sourced colors anywhere.
See this bit from the article:

conky.config = {
default_color = '#' .. foreground,
color0 = '#' .. white0,

Assuming colors.lua contains at least "foreground=..." and "color0=...".
These are just string variables, you have to tell conky, or rather lua, what to do with them. It doesn't somehow magically "understand" that they are supposed to be conky colors.

---

Brilliant!  Adding the section above did the trick!  All is red now. Still have to theme and check:)  This is really cool.

Offline

#1503 2021-04-09 18:31:04

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,842

Re: Show us your conky

unklar wrote:

^^Yeah, I can only serve with this

ls /usr/bin/python*
/usr/bin/python3  /usr/bin/python3.9

look again on the top left in my picture...   big_smile

It looks like Debian 11 (Bullseye) still has access to python 2:

python-all (2.7.18-2)
    package depending on all supported Python2 runtime versions
python-all-dev (2.7.18-2)
    package depending on all supported Python2 development packages
python-apt-common (2.1.7)
    Python interface to libapt-pkg (locales)
python-apt-dev (2.1.7)
    Python interface to libapt-pkg (development files)
python-babel-localedata (2.8.0+dfsg.1-6)
    tools for internationalizing Python applications - locale data files

Try:

aptitude search python2

The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.
_______________________________
Debian 10 Buster = SharpBang ♯!

Offline

#1504 2021-04-10 08:21:47

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 1,619

Re: Show us your conky

You're right.  smile

sudo apt install -s python2
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
Die folgenden zusätzlichen Pakete werden installiert:
  libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib python2-minimal python2.7 python2.7-minimal
Vorgeschlagene Pakete:
  python2-doc python-tk python2.7-doc binutils binfmt-support
Die folgenden NEUEN Pakete werden installiert:
  libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib python2 python2-minimal python2.7 python2.7-minimal
0 aktualisiert, 7 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
Inst libpython2.7-minimal (2.7.18-6 Debian:testing [amd64])
Inst python2.7-minimal (2.7.18-6 Debian:testing [amd64])
Inst python2-minimal (2.7.18-2 Debian:testing [amd64])
Inst libpython2.7-stdlib (2.7.18-6 Debian:testing [amd64])
Inst python2.7 (2.7.18-6 Debian:testing [amd64])
Inst libpython2-stdlib (2.7.18-2 Debian:testing [amd64])
Conf libpython2.7-minimal (2.7.18-6 Debian:testing [amd64])
Conf python2.7-minimal (2.7.18-6 Debian:testing [amd64])
Conf python2-minimal (2.7.18-2 Debian:testing [amd64])
Inst python2 (2.7.18-2 Debian:testing [amd64])
Conf libpython2.7-stdlib (2.7.18-6 Debian:testing [amd64])
Conf python2.7 (2.7.18-6 Debian:testing [amd64])
Conf libpython2-stdlib (2.7.18-2 Debian:testing [amd64])
Conf python2 (2.7.18-2 Debian:testing [amd64])

Source

Offline

#1505 2021-04-10 12:23:10

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,842

Re: Show us your conky

unklar wrote:

You're right.  smile
{snip}
Source

Once - every now and then, on rare occasions, I am.  cool
But now that conky will|should|maybe|might work  smile  smile


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.
_______________________________
Debian 10 Buster = SharpBang ♯!

Offline

#1506 2021-04-10 13:24:39

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 1,619

Re: Show us your conky

I did without the python script and built in your calendar.  wink

The upper part was contaminated with ${offset's}, which caused the conky to "fidget" and could not keep its window stable.

before  OFAZ5Gqt.png  now  wdWB5obt.png

Offline

#1507 2021-04-10 13:47:49

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,842

Re: Show us your conky

OH! That calendar.  What is that one called? - if you didn't change the name I can find it..

I thought you were talking about Mrpeachy's YearClock.conky that I tweaked:
one
two

Black → Months
Grey → Days
White → Hours
Cyan → Minutes
Red → Seconds

My OOPS!


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.
_______________________________
Debian 10 Buster = SharpBang ♯!

Offline

#1508 2021-04-10 15:33:33

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 1,619

Re: Show us your conky

Sector11 wrote:

OH! That calendar.  What is that one called? - if you didn't change the name I can find it..

hm, I have changed it...  ops
maybe you find that after the date here (thanks to the wonderful right-click action, "Upload Image", this is no problem today)  big_smile

SehPovbt.jpg

Offline

#1509 2021-04-10 20:44:31

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,842

Re: Show us your conky

I will go looking.  The week number as the current day is a nice clue.


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.
_______________________________
Debian 10 Buster = SharpBang ♯!

Offline

#1510 2021-05-04 15:52:11

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 1,619

Re: Show us your conky

some distributions still use the conky v1.9 and offer the 1.10 as an alternative (conky-lua), like e.g. antiX

2021-05-03-16-29-06_scrot.th.pngthe difference makes the

draw_graph_borders yes  #no

or

draw_graph_borders = false,  --true,

   
2021-05-03-16-31-40_scrot.th.png

conky v1.9  wink

# pkill -xf "conky -c /path/to/conkyrc" &
# @unklar 2021-05-02
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
##  own_window_colour 000000
##  own_window_class Conky
##  own_window_title data_Conky
own_window_argb_visual yes
##  own_window_argb_value 120

minimum_size 160 240  ## w|h
maximum_width 160

gap_x 410 ## l|r
gap_y 45 ## u|d

alignment bottom_right

use_xft yes
xftfont monofur:bold:size=9
xftalpha 1
override_utf8_locale yes

draw_shades yes
default_shade_color 000000
draw_outline no
draw_graph_borders yes  ##no  <----
default_outline_color 000000

default_color DCDCDC #Gainsboro
color0 A9A9A9 #DarkGray
color1 778899 #LightSlateGray
color2 F5F5DC #Beige
color3 ff8c00 #dark orange  87CEFA  #LightSkyBlue
color4 00ffff #cain 48D1CC  #MediumTurquoise
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 B0E0E6 #PowderBlue
color8 FFD700 #Gold
color9 FFA07A #LightSalmon

border_inner_margin 5
border_outer_margin 0

background yes
use_spacer none
no_buffers yes
imlib_cache_size 0
double_buffer yes
## imlib_cache_flush_interval 900
max_user_text 48552

update_interval 1

## LUA ##
lua_load ~/LUA/draw-bg.lua
lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.35


TEXT
${alignc}[beryllium]  ${user_names}
${alignc}${kernel}
${alignc}${execi 86400 who -b | cut -c23-}

sdb8 ${alignc}${diskiograph 8,100 2E3440 A3BE8C -l}${alignr}${execi 600 hddtemp /dev/sdb | cut -c34-37}
${alignc}${font monofur:pixelsize=9}${fs_used /} / ${fs_size /} (${color2}${fs_free /})${font}

cpu  ${alignc}${cpugraph cpu0 8,100 33FF33 30A229 -l}${alignr}${hwmon 1 temp 3}°
gpu ${alignr}temp  ${color4}${if_match ${hwmon 2 temp 1} < 53}${hwmon 2 temp 1}°${else}${color3}${if_match ${hwmon 2 temp 1} > 53}${hwmon 2 temp 1}°${else}${hwmon 2 temp 1}°${endif}${endif}${color}
 
mem  ${alignc}${memgraph 8,100 EBCB8B BF616A -l}
${alignc} ${mem}  ${memmax}

net ${upspeedgraph enp2s0 8,60 FFFFF0 FF8800 -l}${alignr}${downspeedgraph enp2s0 8,60 FF8800 FFFFF0 -l}
${goto 30}up: ${upspeedf enp2s0}${goto 105}dl: ${downspeedf enp2s0}

conky v1.11   monkey

-- pkill -xf "conky -c /path/to/conkyrc" &
-- @unklar 2021-05-02
conky.config = {
own_window = true,
own_window_type = 'normal',
own_window_transparent = true, --false,
own_window_hints = 'undecorated,below,skip_taskbar,skip_pager',
--  own_window_colour = '#000000',
--  own_window_class = 'Conky',
--  own_window_title = 'data_Conky',
own_window_argb_visual = true,
--  own_window_argb_value = 120,

minimum_width = 160, minimum_height = 240,  -- w|h
maximum_width = 160,

gap_x = 10, -- l|r
gap_y = 45,  -- u|d

alignment = 'bottom_right',  --left',

use_xft = true,
font = 'monofur:bold:size=9',
xftalpha = 1,
override_utf8_locale = true,

draw_shades = true,
default_shade_color = '000000',
draw_outline = false,
draw_graph_borders = false,  --<---
default_outline_color = '000000',

default_color = 'DCDCDC', --Gainsboro
color0 = 'A9A9A9', --DarkGray
color1 = '778899', --LightSlateGray
color2 = 'F5F5DC', --Beige
color3 = 'ff8c00', --dark orange  87CEFA', --LightSkyBlue
color4 = '00ffff', --cain 48D1CC', --MediumTurquoise
color5 = 'FFDEAD', --NavajoWhite
color6 = '00BFFF', --DeepSkyBlue
color7 = 'B0E0E6', --PowderBlue
color8 = 'FFD700', --Gold
color9 = 'FFA07A', --LightSalmon

border_inner_margin = 5,
border_outer_margin = 0,

background = true,
use_spacer = 'none',
no_buffers = true,
imlib_cache_size = 0,
double_buffer = true,
--	imlib_cache_flush_interval =900,
max_user_text = 48552,

update_interval = 1, --0.5

-- LUA --	
lua_load = '~/WuPix/script/draw_bg.lua',
lua_draw_hook_pre = 'draw_bg 10 0 0 0 0 0x000000 0.35',

};

conky.text = [[
${alignc}[beryllium]  ${user_names}
${alignc}${kernel}
${alignc}${execi 86400 who -b | cut -c23-}

sdb8 ${alignc}${diskiograph 8,100 2E3440 A3BE8C -l}${alignr}${execi 600 hddtemp /dev/sdb | cut -c34-37}
${alignc}${font monofur:pixelsize=9}${fs_used /} / ${fs_size /} (${color2}${fs_free /})${font}

cpu  ${alignc}${cpugraph cpu0 8,100 33FF33 30A229 -l}${alignr}${hwmon 1 temp 3}°
gpu ${alignr}temp  ${color4}${if_match ${hwmon 2 temp 1} < 53}${hwmon 2 temp 1}°${else}${color3}${if_match ${hwmon 2 temp 1} > 53}${hwmon 2 temp 1}°${else}${hwmon 2 temp 1}°${endif}${endif}${color}
 
mem  ${alignc}${memgraph 8,100 EBCB8B BF616A -l}
${alignc} ${mem}  ${memmax}

net ${upspeedgraph enp2s0 8,60 FFFFF0 FF8800 -l}${alignr}${downspeedgraph enp2s0 8,60 FF8800 FFFFF0 -l}
${goto 30}up: ${upspeedf enp2s0}${goto 105}dl: ${downspeedf enp2s0}
 
]];

Offline

#1511 2021-05-04 17:23:02

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,842

Re: Show us your conky

AntiX: Is the conky-all v1.9.0-4 or 1.9.0-6

Asking for a friend.  hahahahaha


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.
_______________________________
Debian 10 Buster = SharpBang ♯!

Offline

#1512 2021-05-04 18:11:57

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 1,619

Re: Show us your conky

^You call the package conky-legacy-all  big_smile

conky-legacy-all:
  Installiert:           1:1.9.0-6
  Installationskandidat: 1:1.9.0-6
  Versionstabelle:
 *** 1:1.9.0-6 500
        500 http://ftp.halifax.rwth-aachen.de/mxlinux/packages/antix/buster buster/main amd64 Packages
        100 /var/lib/dpkg/status

My "old" antiX

$ inxi -S
System:
  Host: antix19 Kernel: 5.10.22-antix.1-amd64-smp x86_64 bits: 64 
  Desktop: Fluxbox 1.3.7 
  Distro: antiX-19_x64-full Marielle Franco 16 October 2019

This prevents the 1.9 package from being exchanged for the 1.10 package. tongue
You don't need to set the 1.9 to hold, ergo.

$ apt policy conky*
conky-all-dbg:
  Installiert:           (keine)
  Installationskandidat: 1.10.8-1+b1
  Versionstabelle:
     1.10.8-1+b1 500
        500 http://ftp.de.debian.org/debian buster/main amd64 Packages
conky-legacy-std:
  Installiert:           (keine)
  Installationskandidat: 1:1.9.0-6
  Versionstabelle:
     1:1.9.0-6 500
        500 http://ftp.halifax.rwth-aachen.de/mxlinux/packages/antix/buster buster/main amd64 Packages
conky-std-dbg:
  Installiert:           (keine)
  Installationskandidat: 1.10.8-1+b1
  Versionstabelle:
     1.10.8-1+b1 500
        500 http://ftp.de.debian.org/debian buster/main amd64 Packages
conky-all:
  Installiert:           (keine)
  Installationskandidat: 1.10.8-1+b1
  Versionstabelle:
     1.10.8-1+b1 500
        500 http://ftp.de.debian.org/debian buster/main amd64 Packages
conky-cli:
  Installiert:           (keine)
  Installationskandidat: 1.10.8-1+b1
  Versionstabelle:
     1.10.8-1+b1 500
        500 http://ftp.de.debian.org/debian buster/main amd64 Packages
conky:
  Installiert:           (keine)
  Installationskandidat: 1.10.8-1
  Versionstabelle:
     1.10.8-1 500
        500 http://ftp.de.debian.org/debian buster/main amd64 Packages
        500 http://ftp.de.debian.org/debian buster/main i386 Packages
conky-legacy:
  Installiert:           (keine)
  Installationskandidat: 1:1.9.0-6
  Versionstabelle:
     1:1.9.0-6 500
        500 http://ftp.halifax.rwth-aachen.de/mxlinux/packages/antix/buster buster/main amd64 Packages
        500 http://ftp.halifax.rwth-aachen.de/mxlinux/packages/antix/buster buster/main i386 Packages
conky-cli-dbg:
  Installiert:           (keine)
  Installationskandidat: 1.10.8-1+b1
  Versionstabelle:
     1.10.8-1+b1 500
        500 http://ftp.de.debian.org/debian buster/main amd64 Packages
conky-std:
  Installiert:           (keine)
  Installationskandidat: 1.10.8-1+b1
  Versionstabelle:
     1.10.8-1+b1 500
        500 http://ftp.de.debian.org/debian buster/main amd64 Packages
conky-legacy-std-dbgsym:
  Installiert:           (keine)
  Installationskandidat: 1:1.9.0-6
  Versionstabelle:
     1:1.9.0-6 500
        500 http://ftp.halifax.rwth-aachen.de/mxlinux/packages/antix/buster buster/main amd64 Packages
conky-legacy-all-dbgsym:
  Installiert:           (keine)
  Installationskandidat: 1:1.9.0-6
  Versionstabelle:
     1:1.9.0-6 500
        500 http://ftp.halifax.rwth-aachen.de/mxlinux/packages/antix/buster buster/main amd64 Packages
conky-legacy-all:
  Installiert:           1:1.9.0-6
  Installationskandidat: 1:1.9.0-6
  Versionstabelle:
 *** 1:1.9.0-6 500
        500 http://ftp.halifax.rwth-aachen.de/mxlinux/packages/antix/buster buster/main amd64 Packages
        100 /var/lib/dpkg/status
conky-legacy-cli:
  Installiert:           (keine)
  Installationskandidat: 1:1.9.0-6
  Versionstabelle:
     1:1.9.0-6 500
        500 http://ftp.halifax.rwth-aachen.de/mxlinux/packages/antix/buster buster/main amd64 Packages
conky-legacy-cli-dbgsym:
  Installiert:           (keine)
  Installationskandidat: 1:1.9.0-6
  Versionstabelle:
     1:1.9.0-6 500
        500 http://ftp.halifax.rwth-aachen.de/mxlinux/packages/antix/buster buster/main amd64 Packages

Offline

#1513 2021-05-07 15:32:04

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 1,619

Re: Show us your conky

hddtemp

I had already drawn attention to this here in the forum:

apt-listchanges wrote:

apt-listchanges: News
----------------------------

hddtemp (0.3-beta15-54) unstable; urgency=medium

  hddtemp has been dead upstream for many years and is therefore in a minimal
  maintenance mode. It will be shipped in the Debian Bullseye release, but
  will not be present in the Debian Bookworm release.

  Nowadays the 'drivetemp' kernel module is a better alternative. It uses the
  Linux Hardware Monitoring kernel API (hwmon), so the temperature is returned
  the same way and using the same tools as other sensors.

  Loading this module is as easy as creating a file in the /etc/modules-load.d
  directory:

    echo drivetemp > /etc/modules-load.d/drivetemp.conf

-- Aurelien Jarno <aurel32@debian.org>  Tue, 02 Feb 2021 20:27:44 +0100

In archlinux now in the last kernels these kernel modules "drivetemp" are activated and can be read with Conky in hwmon.
5jgGnPet.png

...
${goto 10}${color6}CPU${color}     ${hwmon 3 temp 2}°
${goto 10}${color6}MB ${color}     ${hwmon 2 temp 2}°
${goto 10}${color2}GPU${color}     ${hwmon 4 temp 1}°
${goto 10}${color6}sda${color}     ${hwmon 0 temp 1}°
${goto 10}${color6}sdb${color}     ${hwmon 1 temp 1}°
...
$ for m in /sys/class/hwmon/* ; do echo -n "$m = " ; cat $m/name ; done
/sys/class/hwmon/hwmon0 = drivetemp
/sys/class/hwmon/hwmon1 = drivetemp
/sys/class/hwmon/hwmon2 = atk0110
/sys/class/hwmon/hwmon3 = coretemp
/sys/class/hwmon/hwmon4 = radeon

Last edited by unklar (2021-05-07 15:41:27)

Offline

#1514 2021-06-23 14:43:15

dukechatwin
Member
Registered: 2021-06-23
Posts: 6

Re: Show us your conky

Hey guys so I'm constantly getting this error message when I try to run a downloaded lua script

conky: llua_do_call: function conky_setup execution failed: attempt to call a nil value
conky: llua_do_call: function conky_main execution failed: attempt to call a nil value

Does anyone has an idea how I can possibly solve this?

require "cairo" -- cairo graphic library

function set_color( num, alpha) 
	
	-- for white color num has no significance
	if color == "WHITE" then
		cairo_set_source_rgba(cr, 1, 1, 1, alpha);
	end

	-- for dark as well color has no significance
	if color == "DARK" then
		cairo_set_source_rgba(cr, 0, 0, 0, alpha);
	end

end

-- the funtion which paints the image in circle
function draw_image (ir,xc, yc, radius, path) 
	local w, h;

	cairo_arc (ir, xc, yc, radius, 0, 2*math.pi);
	cairo_clip (ir);
	cairo_new_path (ir); 


	local image = cairo_image_surface_create_from_png (path);
	w = cairo_image_surface_get_width (image);
	h = cairo_image_surface_get_height (image);


	cairo_scale (ir, 2*radius/w, 2*radius/h);
	w = cairo_image_surface_get_width (image);
	h = cairo_image_surface_get_height (image);

	cairo_set_source_surface (ir, image, xc*(1/(2*radius/w)) - w/2, yc*(1/(2*radius/h)) - h/2);
	cairo_paint (ir);

	cairo_surface_destroy (image);
	cairo_destroy(ir);
end


--  the funtion which will be called at the beginning of the run, used to setup a few global values
function conky_setup(  )

	-- getting the path of the conky
	local pathway = script_path()
	--print (pathway)
	
	-- opening the settings file for reading the variabes
	local file = io.open(pathway.."settings");
	local output = file:read("*a");
	io.close(file);
	
	-- reading the variables
	local nex = 0;
	-- dimensions
	_,nex,width = string.find(output,"WIDTH%s*=%s*(.-)%s*;", nex);
	_,nex,height = string.find(output,"HEIGHT%s*=%s*(.-)%s*;", nex);
	-- network
	_,nex,interface = string.find(output, "NETWORK%s*=%s*(.-)%s*;",nex);
	-- cpu
	_,nex,no_of_cores = string.find(output, "NO_OF_CORES%s*=%s*(.-)%s*;",nex);
	-- color style
	_,nex,color = string.find(output, "COLOR%s*=%s*(.-)%s*;",nex);
	-- gmail
	_,nex,mail = string.find(output, "MAIL%s*=%s*(.-)%s*;",nex);
	-- startup variables
	check_mail = 1;
	start = 1;

	-- checking for internet connection
	local file = io.popen("usr/sbin/route -n | grep -c '^0\.0\.0\.0'");
	internet = tonumber(file:read("*a"));
	io.close(file);

end



-- the function to get the absolute path where the conky is

function script_path()
   local str = debug.getinfo(2, "S").source:sub(2)
   return str:match("(.*/)")
end


function conky_main(  )
	
	-- if no conky window then exit
	if conky_window == nil then return end

	-- the number of update
	local updates = tonumber(conky_parse("${updates}"));
	-- if not third update exit
	if updates < 3 then return end	

	-- prepare cairo drawing surface
	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);

	-- for text extents
	local extents = cairo_text_extents_t:create();
	local text = "";

	-- few co-ordinates
	local centerx = width/2;
	local centery = height/2;

	-- getting the path of the conky
	local pathway = script_path()

	-- setup variables for web based content
	local min = tonumber(conky_parse('${time %M}'));
	local sec = tonumber(conky_parse('${time %S}'));
	local file = io.popen("usr/sbin/route -n | grep -c '^0\.0\.0\.0'");
	internet = tonumber(file:read("*a"));
	io.close(file);	


	-- the centered photo ------------------------------------------- the centered image -------------------------------------------------------

	local face_radius = 40;

	-- image
	local ir = cairo_create(cs);
	draw_image(ir, centerx, centery, face_radius, pathway.."linuxmint");
	--draw_image(ir, centerx, centery, face_radius, "ubuntu_1"); 
	--draw_image(ir, centerx, centery, face_radius, "ubuntu_2);
	--draw_image(ir, centerx, centery, face_radius, "linux_mint_1");
	--draw_image(ir, centerx, centery, face_radius, "linux_mint_2");
	--draw_image(ir, centerx, centery, face_radius, "linux_mint_3");
	--draw_image(ir, centerx, centery, face_radius, "ubuntu_1");

	-- color and other settings for outher boundary
	set_color(1,0.9);
	cairo_set_line_width(cr, 3);
	cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND);
	cairo_set_line_join(cr, CAIRO_LINE_JOIN_ROUND);

	-- outer boundary
	cairo_arc(cr, centerx , centery, face_radius, 0, 2*math.pi);
	cairo_stroke(cr);


	-- cpu stats ------------------------------------------------------------ cpu ----------------------------------------------------------------------------

	local angle = 10*math.pi/180;
	local item_startx = centerx + math.cos(angle) * face_radius;
	local item_starty = centery + math.sin(angle) * face_radius;
	local item_endx = centerx + math.cos(angle) * width/6;
	local item_endy = centery + math.sin(angle) * height/6;
	local item_curvex = centerx + math.cos(angle) * width/12;
	local item_curvey = centery + math.sin(angle) * height/12;
	local item_radius = 15;
	local item_centerx = item_endx + math.cos(angle) * (item_radius + 5);
	local item_centery = item_endy + math.sin(angle) * (item_radius + 5);
	local item_font_size = height/50;

	-- value of cpu
	local cpu = conky_parse("${cpu}");

	-- arrow to cpu
	cairo_move_to(cr, item_startx, item_starty);
	cairo_curve_to(cr, item_curvex, item_curvey, item_curvex, item_curvey-100, item_endx, item_endy);
	set_color(1,0.5);
	cairo_stroke(cr);

	-- background circle
	cairo_arc(cr, item_centerx, item_centery, item_radius+5,  0, 2*math.pi );
	set_color(1,0.4);
	if tonumber(cpu) > 10 then
		cairo_set_source_rgba(cr,0.64,0.67,0.5,0.4);
	end
	if tonumber(cpu) > 20 then
		cairo_set_source_rgba(cr,0.85,0.54,0.51,0.4);
	end
	if tonumber(cpu) > 30 then
		cairo_set_source_rgba(cr,0.57,1,0.5,0.4);
	end
	if tonumber(cpu) > 50 then
		cairo_set_source_rgba(cr,0,1,0.54,0.4);
	end
	if tonumber(cpu) > 70 then
		cairo_set_source_rgba(cr,1,0,0,0.4);
	end

	cairo_fill(cr);

	-- cpu image
	local ir = cairo_create(cs);
	local image_path = "cpu";
	if color == "WHITE" then
		image_path = pathway.."white/"..image_path
	end
	if color == "DARK" then
		image_path = pathway.."dark/"..image_path
	end
	draw_image(ir, item_centerx, item_centery, item_radius, image_path);

	-- outside boundry
	cairo_arc(cr, item_centerx, item_centery, item_radius + 5,  0, 2*math.pi );
	set_color(1,1);
	--if tonumber(cpu) > 50 then
	--	cairo_set_source_rgba(cr,1,0,0,1);
	--end
	--if you want to color the boundry too uncomment these
	--if tonumber(cpu) > 5 then
	--	cairo_set_source_rgba(cr,0.64,0.67,0.5,0.4);
	--end
	--if tonumber(cpu) > 10 then
	--	cairo_set_source_rgba(cr,0.85,0.54,0.51,0.4);
	--end
	--if tonumber(cpu) > 15 then
	--	cairo_set_source_rgba(cr,0.57,1,0.5,0.4);
	--end
	--if tonumber(cpu) > 20 then
	--	cairo_set_source_rgba(cr,0.33,0.93,0.54,0.4);
	--end
	--if tonumber(cpu) > 25 then
	--	cairo_set_source_rgba(cr,1,0,0,0.4);
	--end
	cairo_stroke(cr);

	-- font settings
	set_color(1,1);
	cairo_select_font_face(cr, "Inconsolata", 0 , 1);
	cairo_set_font_size(cr, item_font_size);

	-- name text
	text = "CPU";
	cairo_text_extents(cr, text, extents)
	cairo_move_to(cr, item_centerx - extents.width/2, item_centery - item_radius - 10);
	cairo_show_text(cr, text);

	-- value text
	text = cpu.."%";
	cairo_text_extents(cr, text, extents)
	cairo_move_to(cr, item_centerx - extents.width/2, item_centery + item_radius + item_font_size + 8);
	cairo_show_text(cr, text);	


	-- top 10 process ------------------------------------------------ top 10 process cpu -------------------------------------------------------------

	angle = angle - 10*(math.pi/180);
	item_startx = item_centerx + item_radius + 5;	
	item_starty = item_centery;
	item_endx = item_startx + math.cos(angle) * width/6;
	item_endy = item_starty + math.sin(angle) * height/6;
	item_curvex = item_startx + math.cos(angle) * width/12;
	item_curvey = item_starty + math.sin(angle) * height/12;
	-- print(item_startx.." "..item_starty.." "..item_endx.." "..item_endy.." "..item_curvex.." "..item_curvey)

	-- arrow
	cairo_move_to(cr, item_startx, item_starty);
	cairo_curve_to(cr, item_curvex, item_curvey, item_curvex, item_curvey-100, item_endx, item_endy);
	set_color(1,0.5);
	cairo_stroke(cr);

	-- label text
	set_color(1,1);
	cairo_select_font_face(cr, "Inconsolata", 0 , 1);
	cairo_set_font_size(cr, item_font_size);

	-- name text
	text = "Top 10 Process";
	cairo_text_extents(cr, text, extents)
	cairo_move_to(cr, item_endx - extents.width/2, item_endy + item_font_size+2);
	cairo_show_text(cr, text);

	-- the values
	set_color(1,0.7);
	cairo_select_font_face(cr,"Inconsolata",0,0);
	cairo_set_font_size(cr,item_font_size/1.4);
	for i = 1,10 do
		local addison = "                 ";
		local name = string.sub(conky_parse("${top name "..i.."}")..addison,1,15);
		local value = conky_parse("${top cpu "..i.."}");
		text = name.." "..value;
		--also works : text = string.format("%-10s %-8.2f", name , value)
		cairo_move_to(cr, item_endx - extents.width/2, item_endy + item_font_size/1.2 * (i+1) + 5);
		cairo_show_text(cr,text);
	end


	-- cpu cores ---------------------------------------------- cpu cores ---------------------------------------------------------
	angle = angle + 70*(math.pi/180);
	item_endx = item_startx + math.cos(angle) * width/6;
	item_endy = item_starty + math.sin(angle) * height/8;
	item_curvex = item_startx + math.cos(angle) * width/12;
	item_curvey = item_starty + math.sin(angle) * height/12;
	-- print(item_startx.." "..item_starty.." "..item_endx.." "..item_endy.." "..item_curvex.." "..item_curvey)

	-- arrow
	cairo_move_to(cr, item_startx, item_starty);
	cairo_curve_to(cr, item_curvex, item_curvey, item_curvex, item_curvey-100, item_endx, item_endy);
	set_color(1,0.5);
	cairo_stroke(cr);

	-- label text
	set_color(1,1);
	cairo_select_font_face(cr, "Inconsolata", 0 , 1);
	cairo_set_font_size(cr, item_font_size);

	-- name text
	text = "Cpu Cores";
	cairo_text_extents(cr, text, extents)
	cairo_move_to(cr, item_endx - extents.width/2, item_endy + item_font_size+2);
	cairo_show_text(cr, text);

	-- the values
	set_color(1,0.7);
	cairo_select_font_face(cr,"Inconsolata",0,0);
	cairo_set_font_size(cr,item_font_size/1.4);
	for i = 1,no_of_cores do
		local name = "CPU "..i;
		local value = conky_parse("${top cpu "..i.."}");
		text = name.."  "..value.."%";
		cairo_move_to(cr, item_endx - extents.width/2, item_endy + item_font_size/1.2 * (i+1) + 5);
		cairo_show_text(cr,text);
	end


	-- swap ------------------------------------------------------------ swap ----------------------------------------------------------------------------

	local angle = 35*math.pi/180;
	local item_startx = centerx + math.cos(angle) * face_radius;
	local item_starty = centery + math.sin(angle) * face_radius;
	local item_endx = centerx + math.cos(angle) * width/6;
	local item_endy = centery + math.sin(angle) * height/6
	local item_curvex = centerx + math.cos(angle) * width/12;
	local item_curvey = centery + math.sin(angle) * height/12;
	local item_radius = 15;
	local item_centerx = item_endx + math.cos(angle) * (item_radius + 5);
	local item_centery = item_endy + math.sin(angle) * (item_radius + 5);
	local item_font_size = height/50;

	-- value of cpu
	local swap = conky_parse("${swapperc}");
	if tonumber(swap) == nil then
		swap = 0;
	end

	-- arrow to swap
	cairo_move_to(cr, item_startx, item_starty);
	cairo_curve_to(cr, item_curvex, item_curvey, item_curvex-100, item_curvey+40, item_endx, item_endy);
	set_color(1,0.5);
	cairo_stroke(cr);

	-- background circle
	cairo_arc(cr, item_centerx, item_centery, item_radius+5,  0, 2*math.pi );
	set_color(1,0.4);
	cairo_fill(cr);

	-- swap image
	local ir = cairo_create(cs);
	image_path = "swap";
	if color == "WHITE" then
		image_path = pathway.."white/"..image_path
	end
	if color == "DARK" then
		image_path = pathway.."dark/"..image_path
	end
	draw_image(ir, item_centerx, item_centery, item_radius, image_path);

	-- outside boundry
	cairo_arc(cr, item_centerx, item_centery, item_radius + 5,  0, 2*math.pi );
	set_color(1,1);
	cairo_stroke(cr);

	-- font settings
	set_color(1,1);
	cairo_select_font_face(cr, "Inconsolata", 0 , 1);
	cairo_set_font_size(cr, item_font_size);

	-- name text
	text = "SWAP";
	cairo_text_extents(cr, text, extents);
	cairo_move_to(cr, item_centerx - extents.width/2, item_centery - item_radius - 10);
	cairo_show_text(cr, text);

	-- value text
	text = swap.."%";
	cairo_text_extents(cr, text, extents)
	cairo_move_to(cr, item_centerx - extents.width/2, item_centery + item_radius + item_font_size + 8);
	cairo_show_text(cr, text);


	-- uptime ------------------------------------------------------------ uptime ----------------------------------------------------------------------------

	local angle = 90*math.pi/180;
	local item_startx = centerx + math.cos(angle) * face_radius;
	local item_starty = centery + math.sin(angle) * face_radius;
	local item_endx = centerx + math.cos(angle) * width/6;
	local item_endy = centery + math.sin(angle) * height/6;
	local item_curvex = centerx + math.cos(angle) * width/12;
	local item_curvey = centery + math.sin(angle) * height/12;
	local item_radius = 15;
	local item_centerx = item_endx + math.cos(angle) * (item_radius + 5);
	local item_centery = item_endy + math.sin(angle) * (item_radius + 5);
	local item_font_size = height/50;

	-- value of uptime
	local uptime = conky_parse("${uptime}");

	-- arrow to uptime
	cairo_move_to(cr, item_startx, item_starty);
	cairo_curve_to(cr, item_curvex, item_curvey, item_curvex-100, item_curvey+100, item_endx, item_endy);
	set_color(1,0.5);
	cairo_stroke(cr);

	-- background circle
	cairo_arc(cr, item_centerx, item_centery, item_radius+5,  0, 2*math.pi );
	set_color(1,0.4);
	cairo_fill(cr);

	-- uptime image
	local ir = cairo_create(cs);
	image_path = "uptime";
	if color == "WHITE" then
		image_path = pathway.."white/"..image_path
	end
	if color == "DARK" then
		image_path = pathway.."dark/"..image_path
	end
	draw_image(ir, item_centerx, item_centery, item_radius, image_path);

	-- outside boundry
	cairo_arc(cr, item_centerx, item_centery, item_radius + 5,  0, 2*math.pi );
	set_color(1,1);
	cairo_stroke(cr);

	-- font settings
	set_color(1,1);
	cairo_select_font_face(cr, "Inconsolata", 0 , 1);
	cairo_set_font_size(cr, item_font_size);

	-- name text
	text = "UPTIME";
	cairo_text_extents(cr, text, extents)
	cairo_move_to(cr, item_centerx - extents.width/2, item_centery - item_radius - 10);
	cairo_show_text(cr, text);

	-- value text
	text = uptime;
	cairo_text_extents(cr, text, extents)
	cairo_move_to(cr, item_centerx - extents.width/2, item_centery + item_radius + item_font_size + 8);
	cairo_show_text(cr, text);


	-- Home file system ------------------------------------------------------------ hom fs ----------------------------------------------------------------------------

	local angle = 130*math.pi/180;
	local item_startx = centerx + math.cos(angle) * face_radius;
	local item_starty = centery + math.sin(angle) * face_radius;
	local item_endx = centerx + math.cos(angle) * width/6;
	local item_endy = centery + math.sin(angle) * height/6;
	local item_curvex = centerx + math.cos(angle) * width/12;
	local item_curvey = centery + math.sin(angle) * height/12;
	local item_radius = 15;
	local item_centerx = item_endx + math.cos(angle) * (item_radius + 5);
	local item_centery = item_endy + math.sin(angle) * (item_radius + 5);
	local item_font_size = height/50;

	-- value of free space and total space
	local free = "Free: "..conky_parse("${fs_free /home}");
	local total = "Total: "..conky_parse("${fs_size /home}");

	-- arrow to root
	cairo_move_to(cr, item_startx, item_starty);
	cairo_curve_to(cr, item_curvex, item_curvey, item_curvex, item_curvey+100, item_endx, item_endy);
	set_color(1,0.5);
	cairo_stroke(cr);

	-- background circle
	cairo_arc(cr, item_centerx, item_centery, item_radius+5,  0, 2*math.pi );
	set_color(1,0.4);
	cairo_fill(cr);

	-- root drive image
	local ir = cairo_create(cs);
	image_path = "root";
	if color == "WHITE" then
		image_path = pathway.."white/"..image_path
	end
	if color == "DARK" then
		image_path = pathway.."dark/"..image_path
	end
	draw_image(ir, item_centerx, item_centery, item_radius, image_path);

	-- outside boundry
	cairo_arc(cr, item_centerx, item_centery, item_radius + 5,  0, 2*math.pi );
	set_color(1,1);
	cairo_stroke(cr);

	-- font settings
	set_color(1,1);
	cairo_select_font_face(cr, "Inconsolata", 0 , 1);
	cairo_set_font_size(cr, item_font_size);

	-- name text
	text = "HOME";
	cairo_text_extents(cr, text, extents)
	cairo_move_to(cr, item_centerx - extents.width/2, item_centery - item_radius - 10);
	cairo_show_text(cr, text);

	-- value text
	text = free;
	cairo_text_extents(cr, text, extents)
	cairo_move_to(cr, item_centerx - extents.width/2, item_centery + item_radius + item_font_size + 8);
	cairo_show_text(cr, text);
	text = total;
	cairo_text_extents(cr, text, extents)
	cairo_move_to(cr, item_centerx - extents.width/2, item_centery + item_radius + item_font_size*2 + 8);
	cairo_show_text(cr, text);


	-- ram  ------------------------------------------------------------ ram ----------------------------------------------------------------------------

	local angle = 210*math.pi/180;
	local item_startx = centerx + math.cos(angle) * face_radius;
	local item_starty = centery + math.sin(angle) * face_radius;
	local item_endx = centerx + math.cos(angle) * width/6;
	local item_endy = centery + math.sin(angle) * height/6;
	local item_curvex = centerx + math.cos(angle) * width/12;
	local item_curvey = centery + math.sin(angle) * height/12;
	local item_radius = 15;
	local item_centerx = item_endx + math.cos(angle) * (item_radius + 5);
	local item_centery = item_endy + math.sin(angle) * (item_radius + 5);
	local item_font_size = height/50;

	-- value of ram
	local ram = conky_parse("${memperc}");

	-- arrow to ram
	cairo_move_to(cr, item_startx, item_starty);
	cairo_curve_to(cr, item_curvex, item_curvey, item_curvex, item_curvey-70, item_endx, item_endy);
	set_color(1,0.5);
	cairo_stroke(cr);

	-- background circle
	cairo_arc(cr, item_centerx, item_centery, item_radius+5,  0, 2*math.pi );
	set_color(1,0.4);
	cairo_fill(cr);

	-- root drive image
	local ir = cairo_create(cs);
	image_path = "ram";
	if color == "WHITE" then
		image_path = pathway.."white/"..image_path
	end
	if color == "DARK" then
		image_path = pathway.."dark/"..image_path
	end
	draw_image(ir, item_centerx, item_centery, item_radius, image_path);

	-- outside boundry
	cairo_arc(cr, item_centerx, item_centery, item_radius + 5,  0, 2*math.pi );
	set_color(1,1);
	cairo_stroke(cr);

	-- font settings
	set_color(1,1);
	cairo_select_font_face(cr, "Inconsolata", 0 , 1);
	cairo_set_font_size(cr, item_font_size);

	-- name text
	text = "RAM";
	cairo_text_extents(cr, text, extents)
	cairo_move_to(cr, item_centerx - extents.width/2, item_centery - item_radius - 10);
	cairo_show_text(cr, text);

	-- value text
	text = ram.."%";
	cairo_text_extents(cr, text, extents)
	cairo_move_to(cr, item_centerx - extents.width/2, item_centery + item_radius + item_font_size + 8);
	cairo_show_text(cr, text);


	-- top 10 process ------------------------------------------------ top 10 process ram -------------------------------------------------------------

	angle = angle + 20*(math.pi/180);
	item_startx = item_centerx - item_radius - 5;	
	item_starty = item_centery;
	item_endx = item_startx + math.cos(angle) * width/6;
	item_endy = item_starty + math.sin(angle) * height/6;
	item_curvex = item_startx + math.cos(angle) * width/12;
	item_curvey = item_starty + math.sin(angle) * height/12;
	-- print(item_startx.." "..item_starty.." "..item_endx.." "..item_endy.." "..item_curvex.." "..item_curvey)

	-- arrow
	cairo_move_to(cr, item_startx, item_starty);
	cairo_curve_to(cr, item_curvex, item_curvey, item_curvex, item_curvey-100, item_endx, item_endy);
	set_color(1,0.5);
	cairo_stroke(cr);

	-- label text
	set_color(1,1);
	cairo_select_font_face(cr, "Inconsolata", 0 , 1);
	cairo_set_font_size(cr, item_font_size);

	-- name text
	text = "Top 10 Process";
	cairo_text_extents(cr, text, extents)
	cairo_move_to(cr, item_endx - extents.width/2, item_endy + item_font_size+2);
	cairo_show_text(cr, text);

	-- the values
	set_color(1,0.7);
	cairo_select_font_face(cr,"Inconsolata",0,0);
	cairo_set_font_size(cr,item_font_size/1.4);
	for i = 1,10 do
		local addison = "                 ";
		local name = string.sub(conky_parse("${top_mem name "..i.."}")..addison,1,10);
		local value = conky_parse("${top_mem mem_res "..i.."}");
		text = name.." "..value;
		-- this works too : text = string.format("%-13s %-10s", name , value)
		cairo_move_to(cr, item_endx - extents.width/2, item_endy + item_font_size/1.2 * (i+1) + 5);
		cairo_show_text(cr,text);
	end


	-- disk input output  ------------------------------------------------------------ disk io ----------------------------------------------------------------------------

	local angle = 170*math.pi/180;
	local item_startx = centerx + math.cos(angle) * face_radius;
	local item_starty = centery + math.sin(angle) * face_radius;
	local item_endx = centerx + math.cos(angle) * width/6;
	local item_endy = centery + math.sin(angle) * height/6;
	local item_curvex = centerx + math.cos(angle) * width/12;
	local item_curvey = centery + math.sin(angle) * height/12;
	local item_radius = 15;
	local item_centerx = item_endx + math.cos(angle) * (item_radius + 5);
	local item_centery = item_endy + math.sin(angle) * (item_radius + 5);
	local item_font_size = height/50;

	-- value of disk io
	local diskio = conky_parse("${diskio}");

	-- arrow to disk io
	cairo_move_to(cr, item_startx, item_starty);
	cairo_curve_to(cr, item_curvex, item_curvey, item_curvex, item_curvey-40, item_endx, item_endy);
	set_color(1,0.4);
	cairo_stroke(cr);

	-- background circle
	cairo_arc(cr, item_centerx, item_centery, item_radius+5,  0, 2*math.pi );
	set_color(1,0.4);
	--cairo_set_source_rgba(cr,1,1,1,0.4);
	if string.match(diskio,'M') then
		diskio_nr = tonumber(string.sub(diskio, 1, -2));
		if tonumber(diskio_nr) > 10 then
			cairo_set_source_rgba(cr,0,1,0,0.4);
		end
		if tonumber(diskio_nr) > 20 then
			cairo_set_source_rgba(cr,1,0,0,0.4);
		end
	end
	cairo_fill(cr);


	-- root drive image
	local ir = cairo_create(cs);
	image_path = "root";
	if color == "WHITE" then
		image_path = pathway.."white/"..image_path
	end
	if color == "DARK" then
		image_path = pathway.."dark/"..image_path
	end
	draw_image(ir, item_centerx, item_centery, item_radius, image_path);

	-- outside boundry
	cairo_arc(cr, item_centerx, item_centery, item_radius + 5,  0, 2*math.pi );
	set_color(1,1);
	cairo_stroke(cr);

	-- font settings
	set_color(1,1);
	cairo_select_font_face(cr, "Inconsolata", 0 , 1);
	cairo_set_font_size(cr, item_font_size);

	-- name text
	text = "DISK I/O";
	cairo_text_extents(cr, text, extents)
	cairo_move_to(cr, item_centerx - extents.width/2, item_centery - item_radius - 10);
	cairo_show_text(cr, text);

	-- value text
	text = diskio;
	cairo_text_extents(cr, text, extents)
	cairo_move_to(cr, item_centerx - extents.width/2, item_centery + item_radius + item_font_size + 8);
	cairo_show_text(cr, text);
	


	-- disk read write ------------------------------------------------ read write -------------------------------------------------------------

	angle = angle + 10*(math.pi/180);
	item_startx = item_centerx - item_radius - 5;	
	item_starty = item_centery;
	item_endx = item_startx + math.cos(angle) * width/8;
	item_endy = item_starty + math.sin(angle) * height/6;
	item_curvex = item_startx + math.cos(angle) * width/12;
	item_curvey = item_starty + math.sin(angle) * height/12;
	-- print(item_startx.." "..item_starty.." "..item_endx.." "..item_endy.." "..item_curvex.." "..item_curvey)

	-- arrow
	cairo_move_to(cr, item_startx, item_starty);
	cairo_curve_to(cr, item_curvex, item_curvey, item_curvex, item_curvey-50, item_endx, item_endy);
	set_color(1,0.5);
	cairo_stroke(cr);

	-- label text
	set_color(1,1);
	cairo_select_font_face(cr, "Inconsolata", 0 , 1);
	cairo_set_font_size(cr, item_font_size);

	-- read
	text = "Read: "..conky_parse("${diskio_read}");
	cairo_text_extents(cr,text,extents);
	cairo_move_to(cr, item_endx - extents.width/2, item_endy+item_font_size+2);
	cairo_show_text(cr,text);

	-- write
	text = "Write: "..conky_parse("${diskio_write}");
	cairo_text_extents(cr,text,extents);
	cairo_move_to(cr, item_endx - extents.width/2, item_endy+item_font_size*2+2);
	cairo_show_text(cr,text);


	
	-- gmail --------------------------------------------------------------- gmail new message -------------------------------------------------------------

	if (min*60 + sec)%298 == 0 then
		check_mail = 1;
	end

	if (min%5 == 0 and check_mail == 1) or start == 1 then
	if internet == 1 then
			-- old code selection on fullcount no longer working due to gmail changes
			-- leaving code in for tutorial reasons and future change back?
			-- local val = conky_parse("${execi 300 curl -u "..mail.."}");
			--_,_,new_mail = string.find(val, "<fullcount>%s*(.-)%s*</fullcount>");

			--or solution via Gmail.py - fill login and password in at gmail.py in scripts/gmail folder
			--new_mail = conky_parse("${execi 300 python ~/.conky/Aurora/scripts/gmail/gmail.py}");
	
		--current solution
		--or solution via bash code
		--fill in login and password in gmail.sh in Octupi folder
		new_mail = conky_parse("${execi 300 bash "..pathway.."gmail.sh}");
				
		end
		check_mail = 0;
		start = 0;
	end

	if internet ~= 1 then
		new_mail = "No Network"
	end

	if new_mail == nil then
		new_mail = "Fill out settings!"
	end

	local angle = 300*math.pi/180;
	local item_startx = centerx + math.cos(angle) * face_radius;
	local item_starty = centery + math.sin(angle) * face_radius;
	local item_endx = centerx + math.cos(angle) * width/6;
	local item_endy = centery + math.sin(angle) * height/6;
	local item_curvex = centerx + math.cos(angle) * width/12;
	local item_curvey = centery + math.sin(angle) * height/12;
	local item_radius = 15;
	local item_centerx = item_endx + math.cos(angle) * (item_radius + 5);
	local item_centery = item_endy + math.sin(angle) * (item_radius + 5);
	local item_font_size = height/50;

	-- arrow to mail
	cairo_move_to(cr, item_startx, item_starty);
	cairo_curve_to(cr, item_curvex, item_curvey, item_curvex, item_curvey-70, item_endx, item_endy);
	set_color(1,0.5);
	cairo_stroke(cr);

	-- background circle
	cairo_arc(cr, item_centerx, item_centery, item_radius+5,  0, 2*math.pi );
	set_color(1,0.4);
	--cairo_set_source_rgba(cr,1,1,1,0.4);
	--if you want to color uncomment or comment these
if tonumber(new_mail) ~= nil then

	if tonumber(new_mail) > 0 then

		if tonumber(new_mail) > 10 then
		cairo_set_source_rgba(cr,0,1,0,0.4);
		end
		if tonumber(new_mail) > 30 then
		cairo_set_source_rgba(cr,1,0,0,0.6);
		end
	end

end

	cairo_fill(cr);

	-- image
	local ir = cairo_create(cs);
	image_path = "mail";
	if color == "WHITE" then
		image_path = pathway.."white/"..image_path
	end
	if color == "DARK" then
		image_path = pathway.."dark/"..image_path
	end
	draw_image(ir, item_centerx, item_centery, item_radius, image_path);

	-- outside boundry
	cairo_arc(cr, item_centerx, item_centery, item_radius + 5,  0, 2*math.pi );
	set_color(1,1);
	cairo_stroke(cr);

	-- font settings
	set_color(1,1);
	cairo_select_font_face(cr, "Inconsolata", 0 , 1);
	cairo_set_font_size(cr, item_font_size);

	-- name text
	text = "UNREAD";
	cairo_text_extents(cr, text, extents)
	cairo_move_to(cr, item_centerx - extents.width/2, item_centery - item_radius - 10);
	cairo_show_text(cr, text);

	-- value text
	text = new_mail;
	cairo_text_extents(cr, text, extents)
	cairo_move_to(cr, item_centerx - extents.width/2, item_centery + item_radius + item_font_size + 8);
	cairo_show_text(cr, new_mail);




	-- battery --------------------------------------------------- battery --------------------------------------------------------------------
	local angle = 240*math.pi/180;
	local item_startx = centerx + math.cos(angle) * face_radius;
	local item_starty = centery + math.sin(angle) * face_radius;
	local item_endx = centerx + math.cos(angle) * width/6;
	local item_endy = centery + math.sin(angle) * height/6;
	local item_curvex = centerx + math.cos(angle) * width/12;
	local item_curvey = centery + math.sin(angle) * height/12;
	local item_radius = 15;
	local item_centerx = item_endx + math.cos(angle) * (item_radius + 5);
	local item_centery = item_endy + math.sin(angle) * (item_radius + 5);
	local item_font_size = height/50;

	-- arrow to mail
	cairo_move_to(cr, item_startx, item_starty);
	cairo_curve_to(cr, item_curvex, item_curvey, item_curvex+50, item_curvey-70, item_endx, item_endy);
	set_color(1,0.5);
	cairo_stroke(cr);

	-- background circle
	cairo_arc(cr, item_centerx, item_centery, item_radius+5,  0, 2*math.pi );
	set_color(1,0.4);
	cairo_fill(cr);

	-- image
	local ir = cairo_create(cs);
	image_path = "battery";
	if color == "WHITE" then
		image_path = pathway.."white/"..image_path
	end
	if color == "DARK" then
		image_path = pathway.."dark/"..image_path
	end
	draw_image(ir, item_centerx, item_centery, item_radius, image_path);

	-- outside boundry
	cairo_arc(cr, item_centerx, item_centery, item_radius + 5,  0, 2*math.pi );
	set_color(1,1);
	cairo_stroke(cr);

	-- font settings
	set_color(1,1);
	cairo_select_font_face(cr, "Inconsolata", 0 , 1);
	cairo_set_font_size(cr, item_font_size);

	-- name text
	text = "POWER";
	cairo_text_extents(cr, text, extents)
	cairo_move_to(cr, item_centerx - extents.width/2, item_centery - item_radius - 10);
	cairo_show_text(cr, text);

	-- value text
	text = conky_parse("${battery_short}");
	if text == "U" then
		text=""
		-- image
		local ir = cairo_create(cs);
		image_path = "nobattery";
		if color == "WHITE" then
			image_path = pathway.."white/"..image_path
		end
		if color == "DARK" then
			image_path = pathway.."dark/"..image_path
		end
	draw_image(ir, item_centerx+2, item_centery+30, item_radius-4, image_path);
	end
	cairo_text_extents(cr, text, extents)
	cairo_move_to(cr, item_centerx - extents.width/2, item_centery + item_radius + item_font_size + 8);
	cairo_show_text(cr, text);


	-- time and date ------------------------------------------ time and date
	
	local hour = conky_parse('${time %H}');
	local minute = conky_parse('${time %M}');
	--local part = conky_parse('${time %p}');
	local day = conky_parse('${time %d}');
	local month = conky_parse('${time %B}');
	local year = conky_parse('${time %G}');

	-- time
	set_color(1,1);
	cairo_select_font_face(cr, "Feena Casual", 0,0.9);
	cairo_set_font_size(cr,height/8);
	--text = hour..":"..minute..part;
	text = hour..":"..minute;
	cairo_text_extents(cr,text,extents)
	cairo_move_to(cr, centerx-10 - extents.width/2,  height/6);
	cairo_show_text(cr, text);
	local time_height = height/5;

	-- date
	set_color(1,0.6);
	item_font_size = height/15;
	cairo_select_font_face(cr, "Knife Fight Ballet",0,0);
	cairo_set_font_size(cr, item_font_size)
	text = day.. "  "..month.."  "..year;
	cairo_text_extents(cr,text,extents)
	cairo_move_to(cr, centerx - extents.width/2,  time_height + height/30);
	cairo_show_text(cr, text);


	-- SPOTIFY ------------------------------------------------------------ SPOTIFY ----------------------------------------------------------------------------

	local angle = 60*math.pi/180;
	local item_startx = centerx + math.cos(angle) * face_radius;
	local item_starty = centery + math.sin(angle) * face_radius;
	local item_endx = centerx + math.cos(angle) * width/6;
	local item_endy = centery + math.sin(angle) * height/6;
	local item_curvex = centerx + math.cos(angle) * width/12;
	local item_curvey = centery + math.sin(angle) * height/10;
	local item_radius = 15;
	local item_centerx = item_endx + math.cos(angle) * (item_radius + 5);
	local item_centery = item_endy + math.sin(angle) * (item_radius + 5);
	local item_font_size = height/50;

	-- arrow to root
	cairo_move_to(cr, item_startx, item_starty);
	cairo_curve_to(cr, item_curvex, item_curvey, item_curvex, item_curvey+100, item_endx, item_endy);
	set_color(1,0.5);
	cairo_stroke(cr);

	-- background circle
	cairo_arc(cr, item_centerx, item_centery, item_radius+5,  0, 2*math.pi );
	set_color(1,0.4);
	cairo_fill(cr);

	-- root drive image
	local ir = cairo_create(cs);
	image_path = "spotify";
	if color == "WHITE" then
		image_path = pathway.."white/"..image_path
	end
	if color == "DARK" then
		image_path = pathway.."dark/"..image_path
	end
	draw_image(ir, item_centerx, item_centery, item_radius, image_path);

	-- outside boundry
	cairo_arc(cr, item_centerx, item_centery, item_radius + 5,  0, 2*math.pi );
	set_color(1,1);
	cairo_stroke(cr);

	-- font settings
	set_color(1,1);
	cairo_select_font_face(cr, "Inconsolata", 0 , 1);
	cairo_set_font_size(cr, item_font_size);

	-- name text
	text = "SPOTIFY";
	cairo_text_extents(cr, text, extents)
	cairo_move_to(cr, item_centerx - extents.width/2, item_centery - item_radius - 10);
	cairo_show_text(cr, text);


-- TEMP ------------------------------------------------------------ temp ----------------------------------------------------------------------------


	local angle = 270*math.pi/180;
	local item_startx = centerx + math.cos(angle) * face_radius;
	local item_starty = centery + math.sin(angle) * face_radius;
	local item_endx = centerx + math.cos(angle) * width/6;
	local item_endy = centery + math.sin(angle) * height/6;
	local item_curvex = centerx + math.cos(angle) * width/12;
	local item_curvey = centery + math.sin(angle) * height/12;
	local item_radius = 15;
	local item_centerx = item_endx + math.cos(angle) * (item_radius + 5);
	local item_centery = item_endy + math.sin(angle) * (item_radius + 5);
	local item_font_size = height/50;

	-- check your computer with command sensors to see if "Core 0" exists
	local temp = conky_parse("${execi 10 sensors | grep 'Core 0' | awk {'print $3'}}");


	-- arrow to temp
	cairo_move_to(cr, item_startx, item_starty);
	cairo_curve_to(cr, item_curvex, item_curvey, item_curvex, item_curvey-70, item_endx, item_endy);
	set_color(1,0.5);
	cairo_stroke(cr);

	-- background circle
	cairo_arc(cr, item_centerx, item_centery, item_radius+5,  0, 2*math.pi );
	set_color(1,0.4);
	--cairo_set_source_rgba(cr,1,1,1,0.4);
	
	--if you want to color uncomment or comment these
	--temp_to_number = tonumber(string.sub(temp,2,3))
	--if temp_to_number > 50 then
	--	cairo_set_source_rgba(cr,0,1,0,0.4);
	--end
	--if temp_to_number > 70 then
	--	cairo_set_source_rgba(cr,1,0,0,0.6);
	--end

	cairo_fill(cr);

	-- image
	local ir = cairo_create(cs);
	image_path = "temp";
	if color == "WHITE" then
		image_path = pathway.."white/"..image_path
	end
	if color == "DARK" then
		image_path = pathway.."dark/"..image_path
	end
	draw_image(ir, item_centerx, item_centery, item_radius, image_path);

	-- outside boundry
	cairo_arc(cr, item_centerx, item_centery, item_radius + 5,  0, 2*math.pi );
	set_color(1,1);
	cairo_stroke(cr);

	-- font settings
	set_color(1,1);
	cairo_select_font_face(cr, "Inconsolata", 0 , 1);
	cairo_set_font_size(cr, item_font_size);

	-- name text
	text = "TEMP";
	cairo_text_extents(cr, text, extents)
	cairo_move_to(cr, item_centerx - extents.width/2, item_centery - item_radius - 10);
	cairo_show_text(cr, text);

	-- value text
	text = temp;
	cairo_text_extents(cr, text, extents)
	cairo_move_to(cr, item_centerx - extents.width/2, item_centery + item_radius + item_font_size + 8);
	cairo_show_text(cr, temp);


-- network ----------------------------------------------------------------------- network -------------------------------------------------------------------------

	local angle = 330*math.pi/180;
	local item_startx = centerx + math.cos(angle) * face_radius;
	local item_starty = centery + math.sin(angle) * face_radius;
	local item_endx = centerx + math.cos(angle) * width/6;
	local item_endy = centery + math.sin(angle) * height/6;
	local item_curvex = centerx + math.cos(angle) * width/12;
	local item_curvey = centery + math.sin(angle) * height/12;
	local item_radius = 15;
	local item_centerx = item_endx + math.cos(angle) * (item_radius + 5);
	local item_centery = item_endy + math.sin(angle) * (item_radius + 5);
	local item_font_size = height/50;

	-- ip address interface enp2s0 or wlan0 is filled in settings
	local network = conky_parse("${addr "..interface.."}");

	-- arrow to network
	cairo_move_to(cr, item_startx, item_starty);
	cairo_curve_to(cr, item_curvex, item_curvey, item_curvex, item_curvey-70, item_endx, item_endy);
	set_color(1,0.5);
	cairo_stroke(cr);

	-- background circle
	cairo_arc(cr, item_centerx, item_centery, item_radius+5,  0, 2*math.pi );
	set_color(1,0.4);
	cairo_fill(cr);

	-- image
	local ir = cairo_create(cs);
	image_path = "network";
	if color == "WHITE" then
		image_path = pathway.."white/"..image_path
	end
	if color == "DARK" then
		image_path = pathway.."dark/"..image_path
	end
	draw_image(ir, item_centerx, item_centery, item_radius, image_path);

	-- outside boundry
	cairo_arc(cr, item_centerx, item_centery, item_radius + 5,  0, 2*math.pi );
	set_color(1,1);
	cairo_stroke(cr);

	-- font settings
	set_color(1,1);
	cairo_select_font_face(cr, "Inconsolata", 0 , 1);
	cairo_set_font_size(cr, item_font_size);

	-- name text
	text = "IP";
	cairo_text_extents(cr, text, extents)
	cairo_move_to(cr, item_centerx - extents.width/2, item_centery - item_radius - 10);
	cairo_show_text(cr, text);

	-- value text
	text = network;
	cairo_text_extents(cr, text, extents)
	cairo_move_to(cr, item_centerx - extents.width/2, item_centery + item_radius + item_font_size + 8);
	cairo_show_text(cr, text);


	-- network stats ------------------------------------------------ network stats -------------------------------------------------------------

	angle = angle - 10*(math.pi/180);
	item_startx = item_centerx + item_radius + 5;	
	item_starty = item_centery;
	item_endx = item_startx + math.cos(angle) * width/6;
	item_endy = item_starty + math.sin(angle) * height/6;
	item_curvex = item_startx + math.cos(angle) * width/12;
	item_curvey = item_starty + math.sin(angle) * height/12;
	-- print(item_startx.." "..item_starty.." "..item_endx.." "..item_endy.." "..item_curvex.." "..item_curvey)

	-- arrow
	cairo_move_to(cr, item_startx, item_starty);
	cairo_curve_to(cr, item_curvex, item_curvey, item_curvex, item_curvey-100, item_endx, item_endy);
	set_color(1,0.5);
	cairo_stroke(cr);

	set_color(1,1);
	cairo_move_to(cr,item_endx,item_endy+item_font_size+5);
	cairo_show_text(cr,"Upload");
	cairo_move_to(cr,item_endx + width/15,item_endy+item_font_size+5);
	cairo_show_text(cr,"Download");
	cairo_move_to(cr,item_endx - width/20,item_endy+item_font_size*2+5);
	cairo_show_text(cr, "Now");	
	
	cairo_select_font_face(cr,"Inconsolata",0,0)
	cairo_set_font_size(cr,item_font_size/1.4);
	set_color(1,0.6);
	text = conky_parse("${upspeed "..interface.."}");
	cairo_move_to(cr,item_endx  ,item_endy+item_font_size*2+5);
	cairo_show_text(cr, text);
	text = conky_parse("${downspeed "..interface.."}");
	cairo_move_to(cr,item_endx + width/15,item_endy+item_font_size*2+5);
	cairo_show_text(cr, text);	

	
	local month = conky_parse("${time %b}");
	local year = conky_parse("${time %y}");
	local stats = conky_parse("${execi 10 vnstat -i "..interface.."}");
	local ntotal_recieved, ntotal_trans, nmonth_received, nmonth_trans, ntoday_rec, ntoday_trans;
	-- print(stats);
	if(stats ~= "") then
		_,nex,ntotal_recieved = string.find(stats, "rx:%s*(.-)iB");
		if(ntotal_recieved ~= nil ) then
			total_recieved = ntotal_recieved;
		end
		-- print("tr: "..total_recieved.."iB");
		_,nex,ntotal_trans = string.find(stats, "tx:%s*(.-)iB",nex);
		if(ntotal_trans ~= nil) then
			total_trans = ntotal_trans;
		end
		-- print("tt: "..total_trans..'iB');

		_,nex,_ = string.find(stats, "monthly",nex);

		_,nex,nmonth_received = string.find(stats, month.."%s*\'"..year.."%s*(.-)iB",nex);
		if(nmonth_received ~= nil) then
			month_recieved = nmonth_received;
		end
		-- print("mr: "..month_recieved..'iB');

		_,nex,nmonth_trans = string.find(stats, "|%s*(.-)iB",nex);
		if(nmonth_trans ~= nil) then
			month_trans = nmonth_trans;
		end
		-- print("mt: "..month_trans..'iB');

		_,nex,ntoday_rec = string.find(stats, "today%s*(.-)iB",nex);
		if(ntoday_rec ~= nil) then
			today_rec = ntoday_rec;
		end
		-- print("tor: "..today_rec..'iB');

		_,nex,ntoday_trans = string.find(stats, "|%s*(.-)iB",nex);
		if(ntoday_trans ~= nil) then
			today_trans = ntoday_trans;
		end
		-- print("tot: "..today_trans..'iB');

		cairo_set_font_size(cr, item_font_size);
		cairo_select_font_face(cr, "Inconsolata",0,1);
		set_color(1,1);
		cairo_move_to(cr,item_endx-width/20 ,item_endy+item_font_size*3+5);
		cairo_show_text(cr,"Today");
		cairo_move_to(cr,item_endx-width/20 ,item_endy+item_font_size*4+5);
		cairo_show_text(cr,"Month");
		cairo_move_to(cr,200,220);
		cairo_move_to(cr,item_endx-width/20 ,item_endy+item_font_size*5+5);
		cairo_show_text(cr,"Total");

		cairo_select_font_face(cr,"Inconsolata",0,0)
		cairo_set_font_size(cr,item_font_size/1.4);
		set_color(1,0.6);
		cairo_move_to(cr,item_endx ,item_endy+item_font_size*3+5);
		cairo_show_text(cr,today_trans.."iB");
		cairo_move_to(cr,item_endx ,item_endy+item_font_size*4+5);
		cairo_show_text(cr,month_trans.."iB");
		cairo_move_to(cr,item_endx ,item_endy+item_font_size*5+5);
		cairo_show_text(cr,total_trans.."iB");


		cairo_move_to(cr,item_endx + width/15 ,item_endy+item_font_size*3+5);
		cairo_show_text(cr, today_rec.."iB");
		cairo_move_to(cr,item_endx + width/15 ,item_endy+item_font_size*4+5);
		cairo_show_text(cr,month_recieved.."iB");
		cairo_move_to(cr,item_endx + width/15 ,item_endy+item_font_size*5+5);
		cairo_show_text(cr,total_recieved.."iB");
	end





	-- destroying the cairo surface
	cairo_destroy(cr);
	cairo_surface_destroy(cs);
	cr=nil;
end

Last edited by dukechatwin (2021-06-24 14:00:17)

Offline

#1515 2021-06-23 16:01:47

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 1,619

Re: Show us your conky

dukechatwin wrote:

Hey guys so I'm constantly getting this error message when I try to run a downloaded lua script

conky: llua_do_call: function conky_setup execution failed: attempt to call a nil value
conky: llua_do_call: function conky_main execution failed: attempt to call a nil value

Does anyone has an idea how I can possibly solve this?

No.
No one here is clairvoyant. big_smile

Turn off the LUA in the conky or show the complete error message with the corresponding configuration file. Also you could ask the author of the script.

Offline

#1516 2021-06-23 16:41:38

dukechatwin
Member
Registered: 2021-06-23
Posts: 6

Re: Show us your conky

unklar wrote:
dukechatwin wrote:

Hey guys so I'm constantly getting this error message when I try to run a downloaded lua script

conky: llua_do_call: function conky_setup execution failed: attempt to call a nil value
conky: llua_do_call: function conky_main execution failed: attempt to call a nil value

Does anyone has an idea how I can possibly solve this?

No.
No one here is clairvoyant. big_smile

Turn off the LUA in the conky or show the complete error message with the corresponding configuration file. Also you could ask the author of the script.


OKAYYY you curmudgeon you decided to wake up and choose violence today anywayssssss... I tried contacting the creator of the project but it seems as though he is out of commission. There isn't an error with the configuration file it's just the conky and that error that I copy and pasted is the one that has been on loop in the terminal, also I did include a copy of the lua script below after I asked if anyone knows a way how I can solve this in hopes that someone with better knowledge and eyes than me could point it out respectfully lol.

Offline

#1517 2021-06-23 22:33:59

misko_2083
Member
Registered: 2016-05-24
Posts: 525

Re: Show us your conky

^My best guess after a quick look at the function conky_setup is the check gor internet connection.

		-- checking for internet connection
	local file = io.popen("/sbin/route -n | grep -c '^0\.0\.0\.0'");

Maybe route is not installed and this command returns nothing to lua.
Route command is in net-tools package in Debian.
https://packages.debian.org/search?sear … ords=route

I just checked conky_main function and route is called in there too.

Last edited by misko_2083 (2021-06-23 22:38:09)


They use force, to make you do, what the deciders, have decided you must do!

Offline

#1518 2021-06-24 03:58:37

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,842

Re: Show us your conky

Mod Hat ON

@ dukechatwin

First off there is NO reason to toss insults at someone trying to help you.
unklar is very good at helping people with conkys and scripts and a very active and respected member here.  There was not a hint of violence in anything unklar said.

1. you did not mention it was a LOOP error in a terminal

2. unklar asked about the corresponding file.  You know, like the conky file that called this script.  You did not include it.

3. unklar mentioned that "you could ask the author" about the script.  You did not supply the information that you had tried to do so originally.

4a.  if "route" was your problem as misko_2083 was talking about in his post.  Consider thanking him.

4a.  if "route" is not your problem consider showing us the conky that calls this script along with any other information you might deem important to fixing this for you

5. An apology to unklar for your outburst would be a nice thing to do.  I hope you choose that path.

Mod Hat OFF


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.
_______________________________
Debian 10 Buster = SharpBang ♯!

Offline

#1519 2021-06-24 06:45:11

damo
....moderator....
Registered: 2015-08-20
Posts: 6,732

Re: Show us your conky

@duke  The problem may also be in the cpu section. Check if your system requires cpu0 cpu1 etc, if you have more than 1 core


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#1520 2021-06-24 13:34:03

dukechatwin
Member
Registered: 2021-06-23
Posts: 6

Re: Show us your conky

dukechatwin wrote:
unklar wrote:
dukechatwin wrote:

Hey guys so I'm constantly getting this error message when I try to run a downloaded lua script

conky: llua_do_call: function conky_setup execution failed: attempt to call a nil value
conky: llua_do_call: function conky_main execution failed: attempt to call a nil value

Does anyone has an idea how I can possibly solve this?

No.
No one here is clairvoyant. big_smile

Turn off the LUA in the conky or show the complete error message with the corresponding configuration file. Also you could ask the author of the script.


OKAYYY you curmudgeon you decided to wake up and choose violence today anywayssssss... I tried contacting the creator of the project but it seems as though he is out of commission. There isn't an error with the configuration file it's just the conky and that error that I copy and pasted is the one that has been on loop in the terminal, also I did include a copy of the lua script below after I asked if anyone knows a way how I can solve this in hopes that someone with better knowledge and eyes than me could point it out respectfully lol.

unklar

I might've gotten off on the wrong foot and I'm deeply sorry for how I reacted. I am glad someone (@Sector11) called it out, my statement i.e. OKAYYY you curmudgeon you decided to wake up and choose violence today anywayssssss was in response to your statement being that no one is clairvoyant I am not entirely sure if you could well you can't but it was a joke. I am deeply humbled and grateful for taking the time out in assisting me on this endeavor and the next time we interact I will not be as harsh. Again @unklar I am sorry for any ill feelings I might have prompted.

Last edited by dukechatwin (2021-06-24 13:39:05)

Offline

#1521 2021-06-24 13:37:57

dukechatwin
Member
Registered: 2021-06-23
Posts: 6

Re: Show us your conky

misko_2083 wrote:

^My best guess after a quick look at the function conky_setup is the check gor internet connection.

		-- checking for internet connection
	local file = io.popen("/sbin/route -n | grep -c '^0\.0\.0\.0'");

Maybe route is not installed and this command returns nothing to lua.
Route command is in net-tools package in Debian.
https://packages.debian.org/search?sear … ords=route

I just checked conky_main function and route is called in there too.


You know I believe that this is the error oh my thanks for pointing it out. Hold on let me try something. I checked synaptic package manager and also the folder that the route command is in and they both show that route was installed but that's weird though hmm thanks for the suggestion.

Last edited by dukechatwin (2021-06-24 14:10:12)

Offline

#1522 2021-06-24 13:46:58

dukechatwin
Member
Registered: 2021-06-23
Posts: 6

Re: Show us your conky

unklar wrote:
dukechatwin wrote:

Hey guys so I'm constantly getting this error message when I try to run a downloaded lua script

conky: llua_do_call: function conky_setup execution failed: attempt to call a nil value
conky: llua_do_call: function conky_main execution failed: attempt to call a nil value

Does anyone has an idea how I can possibly solve this?

No.
No one here is clairvoyant. big_smile

Turn off the LUA in the conky or show the complete error message with the corresponding configuration file. Also you could ask the author of the script.

I am so sorry that I behaved in such a manner, I misunderstood what you were saying but I now know what you've been saying all along. This is the conky script that has called the lua:-
*NB: Also point to note when I run the conky script right it only outputs the dark background from the own_window_argb_value = 150, and occasionally displays dropbox. Additionally, I also got this error regarding the test for an internet connection: lua: main.lua:73: invalid escape sequence near '"/sbin/route -n | grep -c '^0\.' It is important to note that the necessary files such as the command file for route in the sbin is present but the lua is saying that there is an errorr. This was the line of code:-

usr/sbin/route -n | grep -c '^0\.0\.0\.0'"
conky.config = {

	--Various settings

	background = true, 							-- forked to background
	cpu_avg_samples = 2,
	diskio_avg_samples = 10,
	double_buffer = true,
	if_up_strictness = 'address',
	net_avg_samples = 2,
	no_buffers = true,
	temperature_unit = 'celsius',
	text_buffer_size = 2048,
	update_interval = 1,
	imlib_cache_size = 0,                       --spotify cover

	--Placement for 1920x1080

	alignment = 'middle_middle', 					--middle_middle if you have only one screen
	gap_x = 250,
	gap_y = 160,
	minimum_height = 748,
	minimum_width = 1366,
	maximum_width = 1366,

	--Graphical

	border_inner_margin = 10, 					-- margin between border and text
	border_outer_margin = 1, 					-- margin between border and edge of window
	border_width = 0, 							-- border width in pixels
	default_bar_width = 280,
	default_bar_height = 10,
	default_gauge_height = 25,
	default_gauge_width =40,
	default_graph_height = 40,
	default_graph_width = 153,
	default_shade_color = '#000000',
	default_outline_color = '#000000',
	draw_borders = false,						--draw borders around text
	draw_graph_borders = true,
	draw_shades = false,
	draw_outline = false,
	stippled_borders = 0,

	--Textual
	
	extra_newline = false,
	format_human_readable = true,
	font = 'SourceSansPro-ExtraLight:size=11:oblique',
	max_text_width = 0,
	max_user_text = 16384,
	override_utf8_locale = true,
	short_units = true,
	top_name_width = 21,
	top_name_verbose = false,
	uppercase = false,
	use_spacer = 'none',
	use_xft = true,
	xftalpha = 1,

	--Windows

	own_window = true,
	own_window_argb_value = 150,				-- put 0 to have no black background anymore
	own_window_argb_visual = true,
	own_window_class = 'Conky',
	own_window_colour = '#000000',
	own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
	own_window_transparent = no,
	own_window_title = 'system_conky',
	own_window_type = 'normal',-- # options are: normal/override/dock/desktop/panel
	

	--Colours

	default_color = '#000000',  				-- default color and border color
	color1 = '#FFFFFF', 
	color2 = '#AAAAAA', 
	color3 = '#888888', 
	color4 = '#BDBDBD',
	color5 = '#CCCCCC', 
	color6 = '#FFFFFF',

	--Signal Colours
	color7 = '#1F7411',  --green
	color8 = '#FFA726',  --orange
	color9 = '#F1544B',  --firebrick


	--Lua
	lua_load = '/home/duke/.config/conky/main.lua',
	lua_draw_hook_pre = 'main',
	lua_startup_hook = 'setup',
};

conky.text = [[
${color1}${font Inconsolata:light:size=8}Aureola Gambodekuno v2.0.3${font}

${font Inconsolata:bold:size=12}${color1}\
${color1}
${if_running spotify}\
${voffset 490}${goto 770}${execi 5 dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 1 "album"|egrep -v "album"|cut -b 44-|cut -d '"' -f 1|egrep -v ^$}
${voffset 00}${goto 770}${execi 5 dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 2 "artist"|egrep -v "artist"|egrep -v "array"|cut -b 27-|cut -d '"' -f 1|egrep -v ^$}
#${execi 5 dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 1 "title"|egrep -v "title"|cut -b 44-|cut -d '"' -f 1|egrep -v ^$}
${execi 6 ~/.config/conky/spotify-cover.sh}
${image ~/.config/conky/last_album_pic.png -p 760,580 -s 80x80  -f 5}${else}${endif}
]]

Last edited by dukechatwin (2021-06-24 15:46:55)

Offline

#1523 2021-06-24 14:51:38

damo
....moderator....
Registered: 2015-08-20
Posts: 6,732

Re: Show us your conky

damo wrote:

@duke  The problem may also be in the cpu section. Check if your system requires cpu0 cpu1 etc, if you have more than 1 core

Your lua error message is what would be produced if you have more than 1 cpu core (which is most hardware these days).


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#1524 2021-06-24 15:49:26

dukechatwin
Member
Registered: 2021-06-23
Posts: 6

Re: Show us your conky

damo wrote:
damo wrote:

@duke  The problem may also be in the cpu section. Check if your system requires cpu0 cpu1 etc, if you have more than 1 core

Your lua error message is what would be produced if you have more than 1 cpu core (which is most hardware these days).

Oh wow that's interesting thanks I did not know that. So does this effectively mean that there is no solution in my case? Oh and sorry that I didn't answer your previous question I have a 2 core machine and it is using cpu0

Last edited by dukechatwin (2021-06-24 15:55:35)

Offline

#1525 2021-06-24 17:07:53

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 1,619

Re: Show us your conky

dukechatwin wrote:

unklar

I might've gotten off on the wrong foot and I'm deeply sorry for how I reacted. I am glad someone (@Sector11) called it out, my statement i.e. OKAYYY you curmudgeon you decided to wake up and choose violence today anywayssssss was in response to your statement being that no one is clairvoyant I am not entirely sure if you could well you can't but it was a joke. I am deeply humbled and grateful for taking the time out in assisting me on this endeavor and the next time we interact I will not be as harsh. Again @unklar I am sorry for any ill feelings I might have prompted.
...
I am so sorry that I behaved in such a manner, I misunderstood what you were saying but I now know what you've been saying all along. This is the conky script that has called the lua:-
*NB: Also point to note when I run the conky script right it only outputs the dark background from the own_window_argb_value = 150, and occasionally displays dropbox. Additionally, I also got this error regarding the test for an internet connection: lua: main.lua:73: invalid escape sequence near '"/sbin/route -n | grep -c '^0\.' It is important to note that the necessary files such as the command file for route in the sbin is present but the lua is saying that there is an errorr. This was the line of code:-

No problem for me. Apology accepted! smile
I admit to sometimes being curmudgeon  big_smile

With the complete error message I meant e.g. this:

...
conky: llua_do_call: function conky_setup execution failed: /home/unklar/.config/conky/LUA/main.lua:52: attempt to index local 'file' (a nil value)
...
conky: llua_do_call: function conky_main execution failed: /home/unklar/.config/conky/LUA/main.lua:108: attempt to perform arithmetic on global 'width' (a nil value)

which I get when running your configuration.

This makes it much easier for the helper without having to go through the script line by line.
@misko_2083 did that and promptly found the error.
I was too lazy to do that yesterday. tongue

Finally, I can confirm @damo's solution, as I only have a Pentium4 available here.

Last edited by unklar (2021-06-24 17:09:17)

Offline

Board footer

Powered by FluxBB