conky-gtk_lua : update of conky-gtk to support new Lua syntax

Moderator: Forum moderators

Post Reply
User avatar
user1234
Posts: 415
Joined: Sat Feb 26, 2022 5:48 am
Location: Somewhere on earth
Has thanked: 156 times
Been thanked: 90 times

conky-gtk_lua : update of conky-gtk to support new Lua syntax

Post by user1234 »

This is an update of conky-gtk from F96-CE_4 to support the update of Fossa64's conkyrc I described here : viewtopic.php?t=10668.


I believe since conky-gtk can currently support only the default conkyrc (or otherwise one that is carefully made to support it), I have also provided the (updated) conkyrc inside this package.

Also, all bug reports / improvement ideas about the updated conkyrc, henceforth, should be posted on this thread only.


Here is the pet package:

Conky_GTK-lua_1.0.pet
Final revision of `v1.0`.
(7.23 KiB) Downloaded 31 times

Here is the display of what this conky-gtk can do:


NOTES:

  • This version is incompatible with older conkyrc syntax, so is the older conky-gtk's version with newer conkyrc syntax.

  • Both this version and the older version have the file /usr/bin/conky-gtk in common. So installing this version of conky-gtk will rewrite that file if you have the older conky-gtk installed already (so backup that file before installing).


UPDATES:

  1. Allow transparency (thanks to @rockedge!)

  2. Fix parsing error when double quotation marks are used instead of single ones for setting variables in conkyrc, and when single quotation marks are used instead of double ones for setting DISTRO_NAME in /etc/DISTRO_SPECS.

  3. Add icon and desktop file, and convert to pet package.

  4. Fix weather not showing on reboot.

  5. Final revision of v1.0. Merge all changes at https://github.com/puppylinux-woof-CE/woof-CE/pull/4239 in this revision.

Last edited by user1234 on Fri Mar 15, 2024 8:56 am, edited 7 times in total.

PuppyLinux 🐾 gives new life to old computers ✨

User avatar
Jasper
Posts: 2067
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 854 times
Been thanked: 480 times

Re: conky-gtk_lua : update of conky-gtk to support new Lua syntax

Post by Jasper »

@user1234

Works well :thumbup2:

Tested on FP95

Image

Image

User avatar
rockedge
Site Admin
Posts: 6551
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2757 times
Been thanked: 2627 times
Contact:

Re: conky-gtk_lua : update of conky-gtk to support new Lua syntax

Post by rockedge »

@user1234 I fixed the transparency with:

Code: Select all

conky.config = {
    use_xft = true, -- use xft?
    font = 'DejaVuSans:size=9', -- [font name]:size=[font size]
    xftalpha = 1,
    uppercase = false, -- all text in uppercase?
    pad_percents = 0,
    text_buffer_size = 2048,
    override_utf8_locale = true, -- Force UTF8? note that UTF8 support required XFT
    use_spacer = 'none', -- Add spaces to keep things from moving about?  This only affects certain objects.

update_interval = 1, -- Update interval in seconds
double_buffer = true, -- Use double buffering (reduces flicker, may not work for everyone)
total_run_times = 0, -- This is the number of times Conky will update before quitting. Set to zero to run forever.

-- background = true, -- Run in background (same as running conky &)

-- Create own window instead of using desktop (required in nautilus)
own_window = true,
own_window_class = 'Conky',
own_window_transparent = true,
own_window_argb_visual = false,
own_window_argb_value = 255,
own_window_type = 'override',
own_window_hints = 'undecorated,sticky,below,skip_taskbar,skip_pager',

-- Minimum size of text area
minimum_height = 50,
minimum_width = 280,

draw_shades = false, -- draw shades?
draw_outline = false, -- draw outlines?
draw_borders = false, -- draw borders around text?
draw_graph_borders = false, -- draw borders around graphs
stippled_borders = 0, -- stripled borders?

imlib_cache_size = 0, -- Imlib2 image cache size, in bytes. Increase this value if you use $image lots. Set to 0 to disable the image cache.

-- Gap between borders of screen and text. Same thing as passing -x at command line
gap_x = 90,
gap_y = 5,

alignment = 'middle_right', -- alignment on {y_axis}_{x_axis}

cpu_avg_samples = 2, -- number of cpu samples to average. set to 1 to disable averaging
net_avg_samples = 2, -- number of net samples to average. set to 1 to disable averaging

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

default_color = 'e0e0e0',
default_shade_color = '000000',
default_outline_color = '000000',

temperature_unit = 'celsius',

color1 = 'ff55ff', -- heading's color
color2 = 'ffffff', -- normal text's color

lua_load = CONKYRC_EXTRA_LUA_FILES_LOCATION .. '/show_mounts.lua',
};

Main changes are these:

Code: Select all

own_window = true,
own_window_class = 'Conky',
own_window_transparent = true,
own_window_argb_visual = false,
own_window_argb_value = 255,
own_window_type = 'override',
own_window_hints = 'undecorated,sticky,below,skip_taskbar,skip_pager',
Screenshot(9).jpg
Screenshot(9).jpg (42.04 KiB) Viewed 870 times
User avatar
user1234
Posts: 415
Joined: Sat Feb 26, 2022 5:48 am
Location: Somewhere on earth
Has thanked: 156 times
Been thanked: 90 times

Re: conky-gtk_lua : update of conky-gtk to support new Lua syntax

Post by user1234 »

rockedge wrote: Mon Feb 12, 2024 3:41 pm

@user1234 I fixed the transparency with:

Code: Select all

conky.config = {
    use_xft = true, -- use xft?
    font = 'DejaVuSans:size=9', -- [font name]:size=[font size]
    xftalpha = 1,
    uppercase = false, -- all text in uppercase?
    pad_percents = 0,
    text_buffer_size = 2048,
    override_utf8_locale = true, -- Force UTF8? note that UTF8 support required XFT
    use_spacer = 'none', -- Add spaces to keep things from moving about?  This only affects certain objects.

update_interval = 1, -- Update interval in seconds
double_buffer = true, -- Use double buffering (reduces flicker, may not work for everyone)
total_run_times = 0, -- This is the number of times Conky will update before quitting. Set to zero to run forever.

-- background = true, -- Run in background (same as running conky &)

-- Create own window instead of using desktop (required in nautilus)
own_window = true,
own_window_class = 'Conky',
own_window_transparent = true,
own_window_argb_visual = false,
own_window_argb_value = 255,
own_window_type = 'override',
own_window_hints = 'undecorated,sticky,below,skip_taskbar,skip_pager',

-- Minimum size of text area
minimum_height = 50,
minimum_width = 280,

draw_shades = false, -- draw shades?
draw_outline = false, -- draw outlines?
draw_borders = false, -- draw borders around text?
draw_graph_borders = false, -- draw borders around graphs
stippled_borders = 0, -- stripled borders?

imlib_cache_size = 0, -- Imlib2 image cache size, in bytes. Increase this value if you use $image lots. Set to 0 to disable the image cache.

-- Gap between borders of screen and text. Same thing as passing -x at command line
gap_x = 90,
gap_y = 5,

alignment = 'middle_right', -- alignment on {y_axis}_{x_axis}

cpu_avg_samples = 2, -- number of cpu samples to average. set to 1 to disable averaging
net_avg_samples = 2, -- number of net samples to average. set to 1 to disable averaging

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

default_color = 'e0e0e0',
default_shade_color = '000000',
default_outline_color = '000000',

temperature_unit = 'celsius',

color1 = 'ff55ff', -- heading's color
color2 = 'ffffff', -- normal text's color

lua_load = CONKYRC_EXTRA_LUA_FILES_LOCATION .. '/show_mounts.lua',
};

Main changes are these:

Code: Select all

own_window = true,
own_window_class = 'Conky',
own_window_transparent = true,
own_window_argb_visual = false,
own_window_argb_value = 255,
own_window_type = 'override',
own_window_hints = 'undecorated,sticky,below,skip_taskbar,skip_pager',

Screenshot(9).jpg

Thanks, that worked like charm! Specifically, the updated lines were:

Code: Select all

    own_window_argb_visual = false,
    own_window_type = 'override',

This works in Jammy64 too! I have added this fix to the archive I originally posted. Also, I forgot to add that DISTRO_NAME fix in the earlier version. The same problem can occur when a user sets color1/color2 with double quotes instead of single quotes; I will fix it in the next version.

PuppyLinux 🐾 gives new life to old computers ✨

Clarity
Posts: 3842
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1632 times
Been thanked: 525 times

Re: conky-gtk_lua : update of conky-gtk to support new Lua syntax

Post by Clarity »

Should this update be forwarded to WoofCE team (aka GIT)?

No response expected to this question. Its the intent that I focus toward. I see this, BTOP, and TLDR as updated quality modern tools users and admins, alike, find value is viewing system performance at a glance.

Just thoughts...

User avatar
user1234
Posts: 415
Joined: Sat Feb 26, 2022 5:48 am
Location: Somewhere on earth
Has thanked: 156 times
Been thanked: 90 times

Re: conky-gtk_lua : update of conky-gtk to support new Lua syntax

Post by user1234 »

Clarity wrote: Mon Feb 12, 2024 5:19 pm

Should this update be forwarded to WoofCE team (aka GIT)?

No response expected to this question. Its the intent that I focus toward. I see this, BTOP, and TLDR as updated quality modern tools users and admins, alike, find value is viewing system performance at a glance.

Just thoughts...

Yes, I'll open a PR creating a conky-gtk package inside woof-CE. I'll also add btop, but tldr - I had worked on using tldr-py instead if it; it was running just fine, but never approved (being a python package, maintenance of that petbuild was the real issue) - so I am afraid, tldr will not be included by default in Jammy64 (at least I won't make those changes, and would suggest everyone else to do the same). Though tldr can be installed manually by running apt update && apt install tldr -y. Note that it requires git - that is the reason why I don't want it to include in default Jammy - increases ISO size by a lot.


BTW, I have uploaded a new version fixing the single/double quotes problem while parsing {DISTRO_NAME in conkyrc, {default_color*, default_font*} in conky-gtk}. @rockedge, please check if the fix works for you.

Any other problems... please report :thumbup:

Thanks who all tested this!

PuppyLinux 🐾 gives new life to old computers ✨

User avatar
user1234
Posts: 415
Joined: Sat Feb 26, 2022 5:48 am
Location: Somewhere on earth
Has thanked: 156 times
Been thanked: 90 times

Re: conky-gtk_lua : update of conky-gtk to support new Lua syntax

Post by user1234 »

I've updated this again. Bug fix in update 4 (weather not showing on reboot since we were trying to load weather info from internet before our network devices got in UP state).

PuppyLinux 🐾 gives new life to old computers ✨

User avatar
rockedge
Site Admin
Posts: 6551
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2757 times
Been thanked: 2627 times
Contact:

Re: conky-gtk_lua : update of conky-gtk to support new Lua syntax

Post by rockedge »

@user1234 I just installed the latest PET version on my main F96-CE_4 system and it seems to be working as expected!! Nice work! :thumbup2:

Post Reply

Return to “Eye Candy”