You are not logged in.

#1 2020-08-27 02:58:50

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

Configurable Conky Clock

--- Edited to include "lua_startup_hook" ---

Say goodbye to lua hacking!   

BsNIOTqm.jpg

Create anything from a simple cairo "Air Clock", to a more complex 24hour layout. I thought of adding days and dates like on a wristwatch, but it is easier to write them using conky.text I reckon.

Multiple settings can be set in one config file, which is sourced by a lua script. The lua script doesn't need editing, since the path to the config just needs to be set in the conky with:

lua_startup_hook = 'conky_load_config /path/to/clock_settings',

IGxcvsQt.jpg is the result of:

clock_conky_110.conf

-- clock_conky_110.conf
-- by damo August 2020
------------------------------------------------------------------------

conky.config = {
    own_window = true,
    own_window_type = 'desktop',
    own_window_transparent = true,
    own_window_hints = 'undecorated,below,skip_taskbar,skip_pager,sticky',
    own_window_colour = '000000',
    own_window_class = 'Conky',
    own_window_title = 'Conky Clock',

    minimum_width = 200, minimum_height = 200,-- width | height
    maximum_width = 200,

    gap_x = 100,-- left | right
    gap_y = 100,-- up | down

    alignment = 'tl',-- tl, tm, tr, bl, bm, br, ml, mr

    use_xft = true,
    font = 'Sans-serif:size=10',
    xftalpha = 1,
    override_utf8_locale = true,
    uppercase = false,

    draw_shades = false,
    default_shade_color = '000000',
    draw_outline = false,-- amplifies text if true
    default_outline_color = '000000',
    default_color = '4b8bad', -- Lithium blue

    background = true,
    use_spacer = 'none',

    no_buffers = true,
    double_buffer = true,

    update_interval = 1,

    lua_load = '/home/user/path/to/clock_conky_110.lua',
-- set the path to the config file here:
    lua_startup_hook = 'conky_load_config /home/user/path/to/clock_settings',
    lua_draw_hook_pre = 'conky_clock',

};

conky.text = '';

------------------------------------------------------------------

clock_conky_110.lua

-- clock_conky_110.lua
-- by damo, August 2020
--
-- With inspiration from:
--      Air Clock by Alison Pitt (londonali1010) (2009)
--      seamod_rings.lua    http://custom-linux.deviantart.com/art/Conky-Seamod-v0-1-283461046
--      Boris Krinkel <olgmen>

-- to be used by clock_conky_110.conf
------------------------------------------------------------------------

require 'cairo'

-- called by "lua_startup_hook" in conky
-- "config" = /path/to/config file (set in conky)
function conky_load_config (config)
    if file_exists(config) then
        -- get clock settings from external config file
        clock_variables = loadfile(config)()
    else
        return
    end
end

function file_exists(name)
    local f=io.open(name,"r")
    if f~=nil then
        io.close(f) return true
    else
        print("Configuration file not found")
        return false
    end
end

-- called by "lua_draw_hook_pre" in conky
-- draw clock using settings from "config"
function conky_clock (config)

    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)

    -- allow conky window to be established before trying to draw clock
    local updates=conky_parse('${updates}')
    update_num=tonumber(updates)

    if update_num>1 then
        for i, cv in pairs(clock_vars) do
            check_settings (cv)
            cr = cairo_create (cs)
            display_clock (cv)
            cairo_destroy (cr)
        end
    end
end

function rgb_to_r_g_b(colour,alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

function check_settings (t) -- lua doesn't have a case/switch statement:
    -- set default values if necessary
    if t.x == nil then  -- if x,y,radius = "nil", set up clock relative to conky window.
        t.x = conky_window.width/2
    elseif t.y == nil then
        t.y = t.x
    elseif t.radius == nil then
        t.radius = t.x*0.95     -- so it fits inside conky window
    elseif t.border == nil then
        t.border = false
    elseif t.border_out == nil then
        t.border = false
    elseif t.color == nil then
        t.color = 0xffffff
    elseif t.alpha == nil then
        t.alpha = 1
    elseif t.line_width == nil then
        t.line_width = 2
    elseif t.border_width == nil then
        t.border_width = t.line_width
    elseif t.hours_num == nil then
        t.hours_num = 12
    elseif t.color_hands == nil then
        t.color_hands = t.color
    elseif t.alpha_hands == nil then
        t.alpha_hands = 1
    elseif t.color_sec  == nil then
        t.color_sec = t.color
    elseif t.alpha_sec  == nil then
        t.alpha_sec = t.alpha
    elseif t.color_face == nil then
        t.color_face = 0xffffff
    elseif t.alpha_face == nil then
        t.alpha_face = 0.5
    elseif t.color_marks == nil then
        t.color_marks = t.color
    elseif t.alpha_marks == nil then
        t.alpha_marks = t.alpha
    elseif t.color_center == nil then
        t.color_center = t.color
    elseif t.alpha_center == nil then
        t.alpha_center = 1
    elseif t.numerals == nil then
        t.numerals = false
    elseif t.text_radius == nil then
        t.text_radius = 0.75
    elseif t.font_name   == nil then
        t.font_name = "Noto Sans"
    elseif t.font_size == nil then
        t.font_size = 12
    elseif t.italic == nil then
        t.italic = false
    elseif t.oblique == nil then
        t.oblique = false
    elseif t.bold == nil then
        t.bold = false
    elseif t.font_color == nil then
        t.font_color = t.color
    elseif t.font_alpha == nil then
        t.font_alpha = t.alpha
    elseif t.clock_face == nil then
        t.clock_face = false
    elseif t.hours_marks == nil then
        t.hours_marks = true
    elseif t.minutes_marks == nil then
        t.minutes_marks = false
    elseif t.clock_center == nil then
        t.clock_center = false
    elseif t.clock_center_radius == nil then
        t.clock_center_radius = 0.1
    elseif t.marks_radius_mins == nil then
        t.marks_radius_mins = 0.95
    elseif t.marks_radius_hrs == nil then
        t.marks_radius_hrs = 0.9
    elseif t.hour_radius == nil then
        t.hour_radius = 0.65
    elseif t.minute_radius == nil then
        t.minute_radius = 0.8
    elseif t.seconds_radius == nil then
        t.seconds_radius = 0.9
    elseif hour_hand_width == nil then
        hour_hand_width = 6
    elseif minute_hand_width == nil then
        minute_hand_width = 4
    elseif seconds_hand_width == nil then
        seconds_hand_width = 2
    elseif t.hand_style == nil then
        t.hand_style = 1
    end
end

function display_clock (t)
    local slant = CAIRO_FONT_SLANT_NORMAL
    local weight =CAIRO_FONT_WEIGHT_NORMAL

    if t.italic then slant = CAIRO_FONT_SLANT_ITALIC end
    if t.bold then weight = CAIRO_FONT_WEIGHT_BOLD end

    cairo_select_font_face(cr, t.font_name, slant, weight)
    cairo_set_font_size(cr, t.font_size)
    te=cairo_text_extents_t:create()
    cairo_text_extents (cr,t.text,te)

    -- make sure clock radius has been set before drawing:
    if t.radius then
        -- draw border ring
        if t.border then
            cairo_set_source_rgba(cr, rgb_to_r_g_b(t.color, t.alpha))
            cairo_set_line_width(cr, t.border_width)
            if t.border_out then -- draw border ring outside clock radius
                cairo_arc (cr, t.x, t.y,t.radius+t.border_width/2, 0, 2*math.pi)
            else
                cairo_arc (cr, t.x, t.y, t.radius-t.border_width/2, 0, 2*math.pi)
            end
            cairo_stroke (cr)
        end

        --  Set clock face
        if t.clock_face then
            if t.color_face then
                cairo_set_source_rgba(cr,rgb_to_r_g_b(t.color_face,t.alpha_face))
                cairo_arc(cr,t.x,t.y,t.radius,0,2*math.pi)
                cairo_fill(cr)
            end
        end

        --  draw hour marks
        if t.hours_marks then
            if t.color_marks then
                cairo_set_source_rgba(cr,rgb_to_r_g_b(t.color_marks,t.alpha_marks))
            end
            cairo_set_line_width(cr, t.line_width)

            local i = 0

            -- is clock 12H or 24H?
            if t.hours_num == 12 then
                num_hours = 11
                angle_hours = math.rad(30)
            else
                num_hours = 23
                angle_hours = math.rad(15)
            end

            local num = num_hours
            local angle = angle_hours

            for i= 0, num, 1 do
                cairo_move_to(cr, t.x - math.sin(angle*i)*t.radius, t.y - math.cos(angle*i)*t.radius)
                cairo_line_to(cr, t.x - math.sin(angle*i)*(t.radius*t.marks_radius_hrs), t.y - math.cos(angle*i)*(t.radius*t.marks_radius_hrs))
                cairo_stroke (cr)
            end
        end

        -- draw minute marks
        if t.minutes_marks then
            if t.hours_num == 24 then
                num_mins = 119
                angle_mins = math.rad(3)
            else
                num_mins = 59
                angle_mins = math.rad(6)
            end
            local num = num_mins
            local angle = angle_mins

            cairo_set_line_width(cr, t.line_width*0.5)

            for i=0, num, 1 do
                cairo_move_to(cr, t.x - math.sin(angle * i) * t.radius, t.y - math.cos(angle * i) * t.radius)
                cairo_line_to(cr, t.x - math.sin(angle * i) * (t.radius * t.marks_radius_mins), t.y - math.cos(angle * i) * (t.radius*t.marks_radius_mins))
                cairo_stroke (cr)
            end
        end
        --  numbers radius,color,alpha
        if t.numerals then
            cairo_save (cr)
            cairo_translate(cr, t.x, t.y)
            mx, my = 0, 0
            local i = 0

            -- is clock 12H or 24H?
            if t.hours_num == 24 then
                num_hours = 24
                angle_hours = math.rad(15)
            else
                 num_hours = 12
                 angle_hours = math.rad(30)
            end

            local num = num_hours
            local angle = angle_hours

            for i = 1, num, 1 do
                mov_x = math.sin(angle*i)*(t.radius*t.text_radius)
                mov_y = math.cos(angle*i)*(t.radius*t.text_radius)
                te=cairo_text_extents_t:create()
                cairo_text_extents (cr,i,te)
                if t.font_color then
                    cairo_set_source_rgba(cr, rgb_to_r_g_b(t.font_color, t.font_alpha))
                end
                mx = -te.width/2
                my = -te.height/2-te.y_bearing
                cairo_move_to(cr, mx + mov_x, my - mov_y)
                cairo_show_text(cr, i)
            end
            cairo_restore (cr)
        end -- end of numerals test


        local hours = os.date("%I")
        local mins = os.date("%M")
        local secs = os.date("%S")
        secs_arc = (2*math.pi/60)*secs
        mins_arc = (2*math.pi/60)*mins
        hours_arc = (2*math.pi/12)*hours + mins_arc/12

        --  hour and minute hand color
        if t.color_hands then
            cairo_set_source_rgba(cr, rgb_to_r_g_b(t.color_hands, t.alpha_hands))
            if t.hand_style == 0 then   -- set line end cap shape
                cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND)
            else
                cairo_set_line_cap(cr, CAIRO_LINE_CAP_BUTT)
            end
            --  draw hour hand
            xh = t.x + t.hour_radius*t.radius*math.sin(hours_arc)
            yh = t.y - t.hour_radius*t.radius*math.cos(hours_arc)
            cairo_set_line_width(cr, t.hour_hand_width)
            cairo_move_to(cr, t.x, t.y)
            cairo_line_to(cr, xh, yh)
            cairo_stroke(cr)

            --  draw minute hand
            xm = t.x + t.minute_radius*t.radius*math.sin(mins_arc)
            ym = t.y - t.minute_radius*t.radius*math.cos(mins_arc)
            cairo_set_line_width(cr, t.minute_hand_width)
            cairo_move_to(cr, t.x, t.y)
            cairo_line_to(cr, xm, ym)
            cairo_stroke(cr)

            --  draw seconds hand
            -- set color for seconds hand
            if t.color_sec then
                cairo_set_source_rgba(cr, rgb_to_r_g_b(t.color_sec, t.alpha_sec))
                xs = t.x + t.seconds_radius*t.radius*math.sin(secs_arc)
                ys = t.y - t.seconds_radius*t.radius*math.cos(secs_arc)
                cairo_set_line_width(cr, t.seconds_hand_width)
                cairo_move_to(cr, t.x, t.y)
                cairo_line_to(cr,xs,ys)
                cairo_stroke (cr)
            end
        end

        --  draw centre on top of hands
        if t.clock_center then
            if t.color_center then
                cairo_set_source_rgba(cr,rgb_to_r_g_b(t.color_center,t.alpha_center))
                cairo_arc(cr,t.x,t.y,t.radius*t.clock_center_radius,0,2*math.pi)
                cairo_fill(cr)
            end
        end
    end -- end of radius test
end

----------------------------------------------------

clock_settings

-- config file to be sourced by clock_conky_110.lua
-- by damo August 2020
------------------------------------------------------------------------

-- if "nil" value is used, then a default value is set by the script
-- Default value in comments is "[value]"

clock_vars = {
  {
    -- if x,y = "nil", clock size is relative to conky window
    x = nil,                  -- x and y coords (center), relative to the top left
    y = nil,                  --  corner of conky, in px [conky_window.width/2]
    radius = nil,             -- [x*0.95] (to fit conky window)

    border = true,            -- draw clock border  [false]
    border_width = 2,         -- border width in px [line_width]
    border_out = false,       --iIf "true", border is drawn outside clock radius [false]
    line_width = 2,           -- used for marks, and default border width [2]
    color = 0x000000,         -- border color. [0xffffff]
    alpha = 0.5,              -- border alpha [1]

    hours_num = 12,           -- options: "12" or "24" [12]
    color_hands = nil,        -- hour and minute hands color [color]
    alpha_hands = 0.5,        -- hour and minute hands alpha [1]
    color_sec = 0xff0000,     -- seconds hand color [color]
    alpha_sec = 0.5,          -- seconds hand alpha [1]
    color_face = nil,         -- clock face color [0xffffff]
    alpha_face = 0.25,        -- clock face alpha [0.5]
    color_marks = nil,        -- hour and minute marks color [color]
    alpha_marks = nil,        -- hour and minute marks alpha [alpha]
    color_center = nil,       -- center spot color [color]
    alpha_center = nil,       -- center spot alpha [1]

    numerals = true,          -- write hour numerals    [false]
    text_radius = 0.8,        -- % radius of numerals from center [0.75]
    font_name = "Raleway",    -- ["Noto Sans"]
    font_size = 14,           -- [12]
    font_color = nil,         -- [color]
    font_alpha = 0.5,         -- [alpha]
    italic = false,           -- [false]
    oblique = false,          -- [false]
    bold = true,              -- [false]

    clock_face = false,           -- draw background clock face [false]
    hours_marks = true,           -- draw hours marks   [true]
    minutes_marks = true,         -- draw minutes marks [false]
    clock_center = true,          -- draw center spot   [false]
    clock_center_radius = 0.08,   -- % radius of clock of center spot [0.1]
    marks_radius_mins = 0.95,     -- % radius of clock of start of mark [0.95]
    marks_radius_hrs = 0.9,       -- % radius of clock of start of mark [0.9]
    hour_radius = 0.55,           -- % radius of clock of hour hand     [0.65]
    minute_radius = 0.65,         -- % radius of clock of minute hand   [0.8]
    seconds_radius = 0.7,         -- % radius of clock of seconds hand  [0.9]
    hour_hand_width = 8,          -- hour hand thickness, px    [6]
    minute_hand_width = 6,        -- minute hand thickness, px  [4]
    seconds_hand_width = 2,       -- seconds hand thickness, px [2]
    hand_style = 0,               -- cap shape of hands, 0="round" or 1="square" [1]
  },
}

Last edited by damo (2020-08-28 15:36:24)


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

#2 2020-08-27 05:30:32

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

Re: Configurable Conky Clock

These types of clocks have been around for years.
Examples:
2012: by Phyllinux
2012: The Chronograph by Sector11
2013: by: ansem of nexus


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

Offline

#3 2020-08-27 12:48:03

ceeslans
Member
Registered: 2015-09-30
Posts: 94

Re: Configurable Conky Clock

Thnx damo, was looking for a good analogue clock script. feedback in a couple of days...

Offline

#4 2020-08-27 12:58:31

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

Re: Configurable Conky Clock

Sector11 wrote:

These types of clocks have been around for years.
Examples:
2012: by Phyllinux
2012: The Chronograph by Sector11
2013: by: ansem of nexus

Yeah, I've used many of them. The point was to have a single file to put multiple settings in, instead of hacking the scripts themselves.

I'd like to do something similar for lua gauges as well, but that is a lot more complicated hmm


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

#5 2020-08-27 16:42:42

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

Re: Configurable Conky Clock

So you took a conky.file + lua.script concept

Changed it to:  conky.file + lua.script + lua.config.file

and now instead of "hacking the lua script" it's "hack the lua.config.file"

I fail to see how it is better.

Also if I want two different clocks on different desktops, in different positions, because I use a script to have different wallpapers on different desktops:

conky.file + lua.script + lua.config.file
conky.file2 + lua.script + lua.config.file2

6 files vs 4 files

The "lua.config.file" could have been a very well documented, which it is, section directly in the lua.script file, and it would have been the same result.

I really envy your scripting ability please understand that, along with londonali1010, mrpeachy, falldown, easysid, wlourf and a world of others.  All I can do is bend fold and mutilate them.  And I have been very successful at that I'd like to think.

2020-08-27_122446_S11.th.jpg
Some of my 100 plus "lua clocks" here, the weather scripts fail due to updates not done, and some sensors fail due to equipment upgrades, but the lua clocks still work.  Different lua scripts themselves number over 300 here.


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

Offline

#6 2020-08-27 17:10:07

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

Re: Configurable Conky Clock

Sector11 wrote:

So you took a conky.file + lua.script concept

Changed it to:  conky.file + lua.script + lua.config.file

and now instead of "hacking the lua script" it's "hack the lua.config.file"

I fail to see how it is better.
....

Because if I can get it figured how to pass a script argument to the lua in conky (eg with the path to the config file), then you can have 100 clock configs and only 1 lua script. Which is only 1 more file than before, with the benefit that you can't inadvertently mess up the script with tpyos.


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

#7 2020-08-27 17:19:31

ceeslans
Member
Registered: 2015-09-30
Posts: 94

Re: Configurable Conky Clock

damo wrote:

Because if I can get it figured how to pass a script argument to the lua in conky (eg with the path to the config file), then you can have 100 clock configs and only 1 lua script. Which is only 1 more file than before, with the benefit that you can't inadvertently mess up the script with tpyos.

^That. I always mess these lua scripts up. So I rather prefer this extra settings file.
The script itself is rock solid. And no error messages flooding xsession-errors file...

Offline

#8 2020-08-27 18:54:22

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

Re: Configurable Conky Clock

100 clock configs = 100 lua scripts

I can mess up a config script as easy as a lua script

I have all the original lua scripts untouched because I mess up everything sooner or later being the Tpyo Knig.

OK, I leave in peace.
Good luck


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

Offline

#9 2020-08-27 20:08:38

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

Re: Configurable Conky Clock

ceeslans wrote:

...
The script itself is rock solid. And no error messages flooding xsession-errors file...

Good to hear. I spent a lot of time chasing down errors due to variables not being set to defaults immediately. They didn't stop the script from working, but as you say they can choke xsession-errors. That is why there are so many "if var then" tests!


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

#10 2020-08-27 22:40:34

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

Re: Configurable Conky Clock

damo wrote:

...
Because if I can get it figured how to pass a script argument to the lua in conky (eg with the path to the config file), then you can have 100 clock configs and only 1 lua script. Which is only 1 more file than before, with the benefit that you can't inadvertently mess up the script with tpyos.

Done! Just pass the name of the config file in the conky lua section:

lua_startup_hook = 'conky_load_config /home/user/path/to/clock_settings',

So one unhacked lua script can be used for multiple clock configurations cool

NB The lua script above has been edited accordingly.

Last edited by damo (2020-08-28 15:38:07)


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

#11 2020-08-28 10:16:29

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

Re: Configurable Conky Clock

that does not work here:

lua_startup_hook = 'conky_load_config /path/to/clock_settings',
conky: desktop window (6b4) is root window
conky: window type - normal
conky: drawing to created window (0x4200001)
conky: drawing to double buffer
conky: forked to background, pid is 14207

Configuration file not found
conky: llua_do_call: function conky_clock execution failed: /home/unklar/.conky/damo_uhren/clock_conky_110.lua:48: bad argument #1 to 'pairs' (table expected, got nil)
...

but this works correctly. Thanks!   smile

lua_startup_hook = 'conky_load_config path/to/clock_settings',

Offline

#12 2020-08-28 13:56:16

DeepDayze
Like sands through an hourglass...
From: In Linux Land
Registered: 2017-05-28
Posts: 1,035

Re: Configurable Conky Clock

Think that's due to Lua script being called using relative path?


Real Men Use Linux

Offline

#13 2020-08-28 14:51:12

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

Re: Configurable Conky Clock

^ and ^^  Noted, thanks. Fullpath is safest: /home/user/path/to/clock_settings

Last edited by damo (2020-08-28 15:35:39)


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

#14 2020-08-28 15:38:23

Nili
Member
From: $HOME/♫♪
Registered: 2015-09-30
Posts: 981
Website

Re: Configurable Conky Clock

Sector11 wrote:

These types of clocks have been around for years.
Examples:
2012: by Phyllinux
2012: The Chronograph by Sector11
2013: by: ansem of nexus

Nostalgia to me, the above were just a few among many others that made me very interested in the world of conky.

Nowdays there are all kinds of methods to extract the data, but i'll never forget Yo S11, #!-conky thread, VinDsl that were my primary target. I had so much fun to "conky.pitstop.free.fr". It was a pleasant time.


OS: Devuan GNU/Linux 4 (chimaera/ceres)
WM: CWM

Studio Ghibli

Offline

#15 2020-08-28 17:09:16

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

Re: Configurable Conky Clock

damo wrote:

^ and ^^  Noted, thanks. Fullpath is safest: /home/user/path/to/clock_settings

Sorry, the lua_startup_hook behaves so clearly not.  hmm
I have tested this again.

ok

lua_startup_hook = 'conky_load_config .conky/damo_uhren/clock_settings',

lua_startup_hook = 'conky_load_config /home/unklar/.conky/damo_uhren/clock_settings',

not ok

lua_startup_hook = 'conky_load_config ~/.conky/damo_uhren/clock_settings',

lua_startup_hook = 'conky_load_config $HOME/.conky/damo_uhren/clock_settings',

8pbe9Mrt.png

Offline

#16 2020-08-28 17:22:44

DeepDayze
Like sands through an hourglass...
From: In Linux Land
Registered: 2017-05-28
Posts: 1,035

Re: Configurable Conky Clock

damo wrote:

^ and ^^  Noted, thanks. Fullpath is safest: /home/user/path/to/clock_settings

Don't think $HOME will expand to user's home dir so yes full path is the safest bet to avoid errors and ambiguities caused by partial paths in the function call within the main script.


Real Men Use Linux

Offline

#17 2020-08-28 17:24:47

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

Re: Configurable Conky Clock

^ But doesn't that demonstrate that both the fullpath and the correct relative path work?

"~/" works for lua_load, but not lua_startup_hook, which is why I think that using fullpath is safest for all the paths.


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

#18 2020-08-28 18:44:46

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

Re: Configurable Conky Clock

Hi Nili

Yea we had a time didn't we.
I'm a has-been now though, a relic from the past.

Tis OK, I had a good run.


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

Offline

#19 2020-08-28 20:27:45

Nili
Member
From: $HOME/♫♪
Registered: 2015-09-30
Posts: 981
Website

Re: Configurable Conky Clock

An unforgettable time for sure. #!, respected teamwise members, interesting topics, old conky versions, systemd free, club-100, And endlessly waiting for Janice 12 to come out.

.conkyrc before lua was the best, so kudos to 1.9 legacy.
When i saw those clocks, they reminded me of many good things from 2008-2015. So, I'm glad you guys did some revisits of those conky.

Me too had a good ride.


OS: Devuan GNU/Linux 4 (chimaera/ceres)
WM: CWM

Studio Ghibli

Offline

#20 2020-08-29 03:18:31

DeepDayze
Like sands through an hourglass...
From: In Linux Land
Registered: 2017-05-28
Posts: 1,035

Re: Configurable Conky Clock

Nili wrote:

An unforgettable time for sure. #!, respected teamwise members, interesting topics, old conky versions, systemd free, club-100, And endlessly waiting for Janice 12 to come out.

.conkyrc before lua was the best, so kudos to 1.9 legacy.
When i saw those clocks, they reminded me of many good things from 2008-2015. So, I'm glad you guys did some revisits of those conky.

Me too had a good ride.

I preferred the old syntax as well...so much easier and cleaner. Made it easy to debug.

Would be cool if there's a 1.9 version that still compiles on Buster.

Last edited by DeepDayze (2020-08-29 03:19:37)


Real Men Use Linux

Offline

#21 2020-08-29 04:39:03

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

Re: Configurable Conky Clock

DeepDayze wrote:
Nili wrote:

An unforgettable time for sure. #!, respected teamwise members, interesting topics, old conky versions, systemd free, club-100, And endlessly waiting for Janice 12 to come out.

.conkyrc before lua was the best, so kudos to 1.9 legacy.
When i saw those clocks, they reminded me of many good things from 2008-2015. So, I'm glad you guys did some revisits of those conky.

Me too had a good ride.

I preferred the old syntax as well...so much easier and cleaner. Made it easy to debug.

Would be cool if there's a 1.9 version that still compiles on Buster.

Yupper ... and I'm still a conky v1.9er.  big_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

Board footer

Powered by FluxBB