Decided to start a conky thread since there are at least three of us working with conky and KF5.
I took my working conky install, commented the heck out of it so folks could see different sections and get some ideas on their own. This commented config *has not been tested* but should be pretty close to what I'm running and will share how to put text inside of graphs, how to change color based on conditionals and how to break up long lines. Posting this now, but when I get home I'll test it, make sure it works the way it's supposed to and then post a final and a screen recording so you guys can see it - but there's lots of ideas here:
edit: Tested code above at home, made a couple changes and it works as designed - gif below is running the code in the code block. Lotsa comments in there
edit v2.0: And the screenshot. Note that while making this gif I mounted an external drive which showed up after mounting and unplugged power to the laptop, forcing cpu governor to powersave. You can see conky's display change with the additional drive and slower CPU speed.
I took my working conky install, commented the heck out of it so folks could see different sections and get some ideas on their own. This commented config *has not been tested* but should be pretty close to what I'm running and will share how to put text inside of graphs, how to change color based on conditionals and how to break up long lines. Posting this now, but when I get home I'll test it, make sure it works the way it's supposed to and then post a final and a screen recording so you guys can see it - but there's lots of ideas here:
Code:
-- -- Starting with version 1.10, conky config is following lua format; there are several changes. -- all configuration items end with a trailing comma. -- all string variables are enclosed in single quotes. -- all boolean responses are now true/false instead of yes/no -- also notice that comments are two dashes and a space -- until you get into the text area, where # still works. -- here we go... conky.config = { -- conky setup update_interval = 0.5, update_interval_on_battery = 3, background = true, total_run_times = 0, cpu_avg_samples = 1, no_buffers = true, text_buffer_size = 8192, temperature_unit = 'celsius', -- -- needed if you want to display degree symbols -- override_utf8_locale = true, -- set up window alignment = 'top_right', gap_x = 20, gap_y = 72, maximum_width = 198, double_buffer = true, background = true, own_window = true, own_window_transparent = true, -- -- for most installations own_window type will be 'normal' or 'desktop'. -- to function correctly in KDE own_window_type must be 'dock'. -- own_window_type = 'dock', own_window_argb_visual = true, -- -- own_window_hints: -- undecorated = no window decorations -- below = keep below other windows -- sticky = show on all desktops -- skip_taskbar, skip_pager prevents a taskbar icon or an alt-tab switch to conky. -- own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager', draw_borders = false, draw_shades = false, draw_outline = false, use_xft = true, font = 'Arial:size=11', uppercase = false, short_units = true, -- colors -- -- you can assign colors here and then just refer to them in the text section. -- Note they're string variables without a leading # -- color0 = '68696b', -- bar/graph color color1 = 'cccccc', -- text color color7 = '4dff4d', -- green color8 = 'ffff4d', -- yellow color9 = 'ff4d4d', -- red } -- text conky.text = [[ # # anything after here uses a hashtag to comment instead of double dashes. # # date and time display # ${font Arial:size=24}${color1}${alignc}${time %l:%M %P}${font} ${font Arial:size=9}${alignc} ${time %A}, ${time %B} ${time %e}${font} # # cpu frequency. Note cpu freq is green unless running at less than max speed. # ${voffset 10}${color1}cpu freq:${alignr}${color7}${if_match ${freq 1} < 1734}${color8}${endif}${freq 1}${color1} mhz # # cpu temperature. Colors change to yellow at 75°C and red at 90°C. # ${color1}cpu temp:${alignr}${color7}${if_match ${i8k_cpu_temp} > 75}${color8}${endif}${if_match ${i8k_cpu_temp} > 90}${color9}${endif}${i8k_cpu_temp}°C # # 1m, 5m and 15m cpu load. Note color changes as load increases. # ${voffset 12}${color1}${alignc}1m: ${if_match ${loadavg 1} < 0.70}${color7}${endif}${if_match ${loadavg 1} >= 0.70}${color8}${endif}${if_match ${loadavg 1} >= 2.00}${color9}${endif}${loadavg 1}${color1} 5m: ${if_match ${loadavg 2} < 0.70}${color7}${endif}${if_match ${loadavg 2} >= 0.70}${color8}${endif}${if_match ${loadavg 2} >= 2.00}${color9}${endif}${loadavg 2}${color1} 15m: ${if_match ${loadavg 3} < 0.70}${color7}${endif}${if_match ${loadavg 3} >= 0.70}${color8}${endif}${if_match ${loadavg 3} >= 2.00}${color9}${endif}${loadavg 3} # # cpu graph. # ${font Arial:size=9}${voffset -10}${color0}${cpugraph cpu0 4dff4d ff4d4d -t -l} # # text inside cpu graph. Note color changes here also. # Also, you can use a backslash to break up long lines. This is handy. # ${color1}${goto 36}${voffset -28}cpu load: ${goto 156}${if_match ${cpu cpu0} >= 3}${color7}${endif}\ ${if_match ${cpu cpu0} >= 20}${color8}${endif}${if_match ${cpu cpu0} >= 90}${color9}${endif}${cpu cpu0}% # # Individual CPU indicators - cpu 0-3 # # cpu0 - note that conky starts numbering cores at 1 instead of zero. With conky, cpu0 = all cores. # ${color0}${voffset -2}${if_match ${cpu cpu1} >= 3}${color7}${endif}\ ${if_match ${cpu cpu1} >= 20}${color8}${endif}${if_match ${cpu cpu1} >= 90}${color9}${endif}${cpugraph cpu1 22,46}\ # # cpu1 # ${color0} ${if_match ${cpu cpu2} >= 3}${color7}${endif}${if_match ${cpu cpu2} >= 20}${color8}${endif}\ ${if_match ${cpu cpu2} >= 90}${color9}${endif}${cpugraph cpu2 22,46}\ # # cpu2 # ${color0} ${if_match ${cpu cpu3} >= 3}${color7}${endif}${if_match ${cpu cpu3} >= 20}${color8}${endif}\ ${if_match ${cpu cpu3} >= 90}${color9}${endif}${cpugraph cpu3 22,46}\ # # cpu3 # ${color0} ${if_match ${cpu cpu4} >= 3}${color7}${endif}${if_match ${cpu cpu4} >= 20}${color8}${endif}\ ${if_match ${cpu cpu4} >= 90}${color9}${endif}${cpugraph cpu4 22,46} # # cpu load numbers for first four indicators. These go inside the indicators :) # ${font Arial:size=7}\ # # cpu0 # ${color1}${voffset -27}${goto 26}${if_match ${cpu cpu1} >= 20}${color8}${endif}${if_match ${cpu cpu1} >= 90}${color9}${endif}${cpu cpu1}%\ # # cpu1 # ${goto 72}${if_match ${cpu cpu2} >= 20}${color8}${endif}${if_match ${cpu cpu2} >= 90}${color9}${endif}${cpu cpu2}%\ # # cpu2 # ${goto 120}${if_match ${cpu cpu3} >= 20}${color8}${endif}${if_match ${cpu cpu3} >= 90}${color9}${endif}${cpu cpu3}%\ # # cpu 3 # ${goto 172}${if_match ${cpu cpu4} >= 20}${color8}${endif}${if_match ${cpu cpu4} >= 90}${color9}${endif}${cpu cpu4}% # # Individual CPU indicators - cpu 4-7 # # cpu4 # ${color0}${voffset 12}${if_match ${cpu cpu5} >= 3}${color7}${endif}${if_match ${cpu cpu5} >= 20}${color8}${endif}\ ${if_match ${cpu cpu5} >= 90}${color9}${endif}${cpugraph cpu5 22,46}\ # # cpu5 # ${color0} ${if_match ${cpu cpu6} >= 3}${color7}${endif}${if_match ${cpu cpu6} >= 20}${color8}${endif}\ ${if_match ${cpu cpu6} >= 90}${color9}${endif}${cpugraph cpu6 22,46}\ # # cpu6 # ${color0} ${if_match ${cpu cpu7} >= 3}${color7}${endif}${if_match ${cpu cpu7} >= 20}${color8}${endif}\ ${if_match ${cpu cpu7} >= 90}${color9}${endif}${cpugraph cpu7 22,46}\ # # cpu7 # ${color0} ${if_match ${cpu cpu8} >= 3}${color7}${endif}${if_match ${cpu cpu8} >= 20}${color8}${endif}\ ${if_match ${cpu cpu8} >= 90}${color9}${endif}${cpugraph cpu8 22,46} # # cpu load numbers for the last four indicators. These go inside the indicators :) # # cpu4 # ${color1}${voffset -22}${goto 26}${if_match ${cpu cpu5} >= 20}${color8}${endif}${if_match ${cpu cpu5} >= 90}${color9}${endif}${cpu cpu5}%\ # # cpu5 # ${goto 72}${if_match ${cpu cpu6} >= 20}${color8}${endif}${if_match ${cpu cpu6} >= 90}${color9}${endif}${cpu cpu6}%\ # # cpu6 # ${goto 120}${if_match ${cpu cpu7} >= 20}${color8}${endif}${if_match ${cpu cpu7} >= 90}${color9}${endif}${cpu cpu7}%\ # # cpu7 # ${goto 172}${if_match ${cpu cpu8} >= 20}${color8}${endif}${if_match ${cpu cpu8} >= 90}${color9}${endif}${cpu cpu8}%${font} # # memory bar. Note conditional at the end of the line. # ${color1}${voffset 24}memory:${alignr}$mem / $memmax ${color0}${goto 6}${membar} ${if_existing /proc/swaps partition} # # swapbar only displays if there is a swap partition activated. See conditional above. # ${color1}swap:${alignr}$swap / $swapmax ${color0}${goto 6}${swapbar}${endif} # # simple filesystem bar. This one is for / # ${color1}root:${alignr}${fs_used /} / ${fs_size /} ${color0}${goto 6}${fs_bar /} # # and another filesystem bar for /home # ${color1}/home:${alignr}${fs_used /home} / ${fs_size /home} ${color0}${goto 6}${fs_bar /home}${if_existing /mnt/external/archive} # # This filesystem bar only displays if a specific external drive is mounted. # ${color1}external:${alignr}${fs_used /mnt/external} / ${fs_size /mnt/external} ${color0}${goto 6}${fs_bar /mnt/external}${endif} # # disk i/o numbers # ${color0}${voffset 6}${alignc}disk i/o: ${color1}${alignc}${diskio} # # wireless information. only displays if wireless is connected. # ${color1}${if_existing /proc/net/route wlan0} ${color1}${voffset -34}wlan:${alignr}${wireless_link_qual_perc wlan0}% ${color0}${goto 6}${wireless_link_bar wlan0} ${alignc}${color0}${voffset 8}dn: ${color1}${downspeedf wlan0}${color0} kbps ${alignc}up: ${color1}${upspeedf wlan0}${color0} kbps${endif} # # battery indicator. Outside border of battery bar turns yellow or red depending on battery percentage. # ${color1}${voffset -10}battery:${alignr}${battery_percent}% ${color0}${goto 6}${battery_bar}${if_match ${battery_percent} <= 99}${color8}${goto 6}${execbar echo 0}${endif}${if_match ${battery_percent} <= 10}${color9}${goto 6}${execbar echo 0}${endif} ${font Arial:size=9}${alignc}${voffset -6}${battery_time} # # nodename, uptime, kernel version # ${font Arial:size=11}${color0}${alignc}${voffset -12}${nodename} ${color1}${alignc}uptime: ${uptime} ${color0}${alignc}kernel: ${kernel} # # and we end things with a couple of square brackets # ]]
edit v2.0: And the screenshot. Note that while making this gif I mounted an external drive which showed up after mounting and unplugged power to the laptop, forcing cpu governor to powersave. You can see conky's display change with the additional drive and slower CPU speed.
Comment