Conky Showoff thread

Add functionality to your desktop
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
jsocoinac

Re: Conky Showoff thread

Post by jsocoinac »

My pleasure! Here you go. Note, though, that the code is designed for my 1280 x 800 screen, and that I have had to use some hacks to get the positioning right - and so you might have to fiddle with the positioning stuff. Also, I use some particular fonts . .

I tried attaching the files and it didn't work. So I will have to paste them here. First, the .conkyrc file:

Code: Select all

-- |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-- ||																	||
-- || 							C O N K Y 							||
-- ||																	||
-- ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||


conky.config = {

-- ////////////////////////////////////////////
-- 	Update settings
-- ////////////////////////////////////////////

-- Update interval in seconds
update_interval = 1.2,
-- Cf. stuff on CPU samples, below.
update_interval_on_battery = 1.4,
-- This is the number of times Conky will update before quitting.
-- Set to zero to run forever.
total_run_times = 0,

-- ////////////////////////////////////////////
-- 	Window settings
-- ////////////////////////////////////////////

default_color = grey, 
-- Meant to set border colour too. Yet, default_color does not seem to work. But, no display if do not set!
-- Create own window instead of using desktop (required in Nemo)
own_window = true,
own_window_hints = "undecorated,sticky,skip_taskbar,below",
-- If have 'below' in own_window_hints, then conky excludes icons. (Cf. *minimum_height, below.*)
-- am trying without 'skip_pager' - in case it causes problems for Cinnamon.
own_window_transparent = true,
own_window_type = "desktop",
-- Use double buffering (reduces flicker, mayn't work for everyone)
double_buffer = true,
-- Minimum size of text area. NB: Changes require a LOGOUT - or perhaps kill conky with xkill & restart.
minimum_height = 45,
minimum_width = 1270,
-- 1275 seems max width that allows borders to show. EDIT: no, currently 1270. (But) depends on 'x' value.
-- NB: alignr and alignc command seem to work only if text that follows them contains no {offset} commands.
-- Draw borders around text. Useful for troubleshooting.
draw_borders = false,
-- stippled_borders = 10,
-- border_inner_margin = 2,
-- border_outer_margin = 2,
-- border_width = 1,
-- Gap between borders of screen and text. Equivalent to passing -x at command line.
gap_x = 1,
gap_y = 2,
alignment = "top_middle",
--alignment = "top_left",
--alignment = "top_right",
--alignment = "top_middle",
--alignment = "bottom_left",
--alignment = "bottom_right",
-- etc.


-- ////////////////////////////////////////////
-- 	Font stuff
-- ////////////////////////////////////////////

use_xft = true,
font = "Noto Sans UI:size=12",
--xftalpha = 0,
--uppercase = false,
-- Draw shades? = add slight shadow to text. If comment out this variable, get bad, strange effect!
draw_shades = false,
-- default_shade_color = grey,
draw_outline = false,
-- default_outline_color = grey,
-- Default colors. Can use program gColor2 to get numbers for subtle colours.
-- Force UTF8? Note that UTF8 support required XFT
-- override_utf8_locale = true,
-- Add spaces to keep things from moving about?  Only helps if you are using a mono font, such as DejaVu Sans Mono.
-- use_spacer = left,

-- /////////////////////////////////////////////////////////////////
-- 	Measuring/reporting options
-- /////////////////////////////////////////////////////////////////

-- short_units = true,
-- Shortens units to a single character (kiB->k, GiB->G, etc.). Default is false. 
-- Subtract file system buffers from used memory?
no_buffers = true,
-- number of cpu samples to average
-- set to 1 to disable averaging
cpu_avg_samples = 2,
-- number of net samples to average - unsure whether applies to wifi strength
-- set to 1 to disable averaging
net_avg_samples = 3,
--pad_percents - number of digits in percentages (to determine whether get 1, [space]1, [space][space]1, etc.)
pad_percents = 3,
top_name_width = 50,
-- top_name_width truncates string variable output for the 'top' command.
--text_buffer_size = 2048,
-- Size of the standard text buffer (default is 306 bytes). This buffer is used for intermediary text, such as individual lines, output from $exec vars, and various other variables. Increasing the size of this buffer can drastically reduce Conky's performance, but will allow for more text display per variable. The size of this buffer cannot be smaller than the default value of 306 bytes.

}

-- /////////////////////////////////////////////////////////////////////////////////////////////////////////////
-- 	LUA SCRIPT stuff (goes here, after the config section)
-- /////////////////////////////////////////////////////////////////////////////////////////////////////////////

-- lua_load  = "~/.conky/round.lua"
-- ${if_match ${cpu cpu0}>4}${voffset 3}${alignc}${font Sans UI: size=11.5}${color pink}${top name 1}${alignr}${offset -550}${lua conky_round ${top cpu 1}}%${font}${endif}]]
-- Previous last line of text below:
-- ${if_match ${cpu cpu0}>65}${alignc}${voffset 4.5}CPU loader: ${top name 1}${endif}
--${outlinecolor #B47474


-- ===============================================================================
--
--				****** Conky MAIN TEXT follows *****
--
--	Within that section - in the 'conky.text' section - and *only* here, comments are preceded by hashes.
--	Can use \ at end of line to separate code lines without visible line-break; but tabs tend to get printed.
--	Also: if end with a blank line, that gets printed. And can't end with a hash.
--
-- ==============================================================================

conky.text =
[[
#
#
# -------------------------------------------------------------
# 	DISC SPACE USAGE & RAM & CPU
# -------------------------------------------------------------
#
${offset 25}system${offset 7}${voffset 4}${fs_bar 8, 35 /}${voffset -4}\
${offset 18}home${offset 7}${voffset 4}${fs_bar 8, 35 /home}${voffset -4}\
${offset 18}swap${offset 6}${voffset 4}${if_match ${swapperc} > 64}${color red}${swapbar 8, 35}${color}${else}${swapbar 8, 35}${endif}${voffset -4}\
${offset 17}ram${offset 7}${voffset 4}${if_match ${memperc} > 90}${color red}${membar 8, 35}${color}${else}${membar 8, 35}${endif}${voffset -4}\
${offset 18}cpu${offset 6}${voffset 4}${cpubar cpu0 8, 35}${voffset -3}\
#
#
# --------------------------------------------
# 	TEMPERATURE
# --------------------------------------------
#
${offset 20}${font FreeMono Regular: size=12.5}${if_match $acpitemp>74}${if_match $acpitemp>88}${color red}${else}${color FFE6EF}${endif}${else}${color #B4B4B4}${endif}${acpitemp}°${color}${offset 4}${color #B4B4B4}| ${if_match ${hwmon 2 temp 3}>54}${if_match ${hwmon 2 temp 3}>70}${color red}${else}${color white}${endif}${else}${color #B4B4B4}${endif}${hwmon 2 temp 3}°${color}${font}\
#
#
# --------------------------------------------
# 	NETWORK
# --------------------------------------------
#
${voffset -2}${offset 14}${if_existing /proc/net/route eth0}${font Noto Sans UI: size=11}Ethernet${if_existing /proc/net/route wlan0}${color grey} | ${color}${endif}${font}${voffset -2}${endif}${if_existing /proc/net/route wlan0}${if_match "$wireless_essid wlan0"!="off/any"}${font Noto Sans UI: size=11}${wireless_essid wlan0} (${font PizzaDude Bullets:size=12}${if_match ${wireless_link_qual_perc wlan0}>74}${color green}BBB${color}${else}${if_match ${wireless_link_qual_perc wlan0}>49}${color green}BB${color}${color grey}B${color}${else}${if_match ${wireless_link_qual_perc wlan0}>34}${color green}B${color}${color grey}BB${color}${else}${color red}B${color}${color grey}BB${color}${endif}${endif}${endif}${font}${voffset -5})${endif}${endif}\
#
#
# --------------------------------------------
# 	BATTERY
# --------------------------------------------
#
${voffset 1}${offset 18}${font Webdings:size=15}~${font}${voffset -2}${offset 2}${font Noto Sans UI: size=13}${color #DCDCDC}=${color}${font}\
${offset 5}\
${if_match "$battery"=="charged"}${color #3BC9C0}${font Noto Sans UI: size=12:bold}AC${color}${font}${else}${if_existing /sys/class/power_supply/BAT0/status Charging}${color green}${battery_percent BAT0}%${font TakaoPGothic: size=13:bold}↑${else}${color orange}${battery_percent BAT0}%${font TakaoPGothic: size=13:bold}↓${endif}${color}${font}${endif}\
#
#
# --------------------------------------------
# 	VOLUME
# --------------------------------------------
#
${offset 18}${voffset -10}${font Noto Sans UI: size=19}♫${font}${offset 4}${color #E1E1E1}${texeci 1 ~/.conky/scripts-called-in-Conky/vol.sh}${color}\
#
#
# --------------------------------------------
# 	REDSHIFT
# Commented out because does not work properly on my system,
# --------------------------------------------
#
#${offset 18}\
#${font Noto Sans UI: size=11.5}${texeci 3 redshift -p -l 51.9:1.0 | awk 'FNR == 2 {print $3}'}${font}\
#
#
# ----------------------------------------------------------------------------
# 	TIME
# 	If use ${offset} here, get problems with right-aligning.
#	So, use spaces, with different font size.
# ----------------------------------------------------------------------------
#
${offset 20}${voffset -1}${alignr}${font Noto Sans UI: size=11.5}${time %A}, ${time %d} ${time %B} ${time %Y}   ${voffset -4}${font}${alignr}${font Noto Sans UI: size=15}${time %l:%M} ${font}${voffset -3}${font Noto Sans UI: size=11}${color #F4F4F4}${time %p}  \
#
#
# --------------------------------------------
# 	* * *  END  * * *
# --------------------------------------------
#
]]
Next, a script file, vol.sh, used by the script:

Code: Select all

#!/bin/bash
amixer get Master | awk -F'[]%[]' '/%/ {if ($7 == "off") { print "mute" } else { print $2"%" }}'
EDIT: I should explain the temperatures displayed by the Conky. The first is CPU temperature (mean across all cores). The second is, at least on my system, motherboard. You may need to adjust that stuff for your system. The same goes for the sound stuff and perhaps some of the other stuff. (For one thing, the power stuff will not make sense if run on a desktop.)
Sector11

Re: Conky Showoff thread

Post by Sector11 »

jsocoinac wrote:My pleasure! Here you go.
Thank you!

Also you are using conky v1.10 ... I'll have to convert it to v1.9 - not a big problem.

wlan, and battery stuff I'm use to changing or replacing with other stuff since I'm wired in with eth0 and on a desktop so no battery. Screen size isn't a problem, mine is 1920 wide.

maybe CAPS ON | caps off... I was more interested in the 'volume' and "mute" idea. I simply use the % values.

Code: Select all

${goto 85}${color0}Vol ${if_match ${mixer} < 10}${color0}  \
${else}${if_match ${mixer} < 34}${color0} \
${else}${if_match ${mixer} < 67}${color5} \
${else}${if_match ${mixer} <= 99}${color4} \
${else}${if_match ${mixer} == 100}${color4}\
${endif}${endif}${endif}${endif}${endif}${mixer}%${color}\
But 'mute' and 100% = 4 characters each so I can modify my code to do the same. :)

Code: Select all

mute
  3%
 49%
 99%
100%
yea that would work - with a mono font always the same width.

Will post results ... but now - wife time.
elbullazul

Re: Conky Showoff thread

Post by elbullazul »

mine :
Image

code if desired
jsocoinac

Re: Conky Showoff thread

Post by jsocoinac »

elbullazul: thanks!

Now, do you think you could tell me how to get conky to print 'CAPS' when caps is on, rather than 'on'? My Linux (/grep/Linux)-fu is not strong enough to do that on my own . .
Sector11

Re: Conky Showoff thread

Post by Sector11 »

If I may:

Code: Select all

TEXT
 xset:

 Cap Lock:    ${exec xset q | grep Cap |awk '{print $4}'}
 Num Lock:    ${exec xset q | grep Num |awk '{print $8}'}

 Cap Lock:    ${if_match "${exec xset q | grep Cap |awk '{print $4}'}"=="on"}${color9}${endif}${exec xset q | grep Cap |awk '{print $4}'}${color}
 Num Lock:    ${if_match "${exec xset q | grep Num |awk '{print $8}'}"=="on"}${color9}${endif}${exec xset q | grep Num |awk '{print $8}'}${color}

 ${if_match "${exec xset q | grep Cap |awk '{print $4}'}"=="on"}${color9}${exec xset q | grep Cap |awk '{print "Cap Lock:    "$4}'}${else}${exec xset q | grep Cap |awk '{print "Cap Lock:    "$4}'}${endif}${color}
 ${if_match "${exec xset q | grep Num |awk '{print $8}'}"=="on"}${color9}${exec xset q | grep Num |awk '{print "Num Lock:    "$8}'}${else}${exec xset q | grep Num |awk '{print "Num Lock:    "$8}'}${endif}${color}


 ${if_match "${exec xset q | grep Cap |awk '{print $4}'}"=="on"}CAP LOCK${else}cap lock${endif}
 ${if_match "${exec xset q | grep Num |awk '{print $8}'}"=="on"}NUM LOCK${else}num lock${endif}
Image Image
jsocoinac

Re: Conky Showoff thread

Post by jsocoinac »

Thanks! Helpful.

Am I too take it from the pictures you provided that you are having trouble displaying your computer's battery charging status? I can do it on mine . . But I get the impression that there's some hardware difficulty; I imagine not being able to script it is not your problem . .
Sector11

Re: Conky Showoff thread

Post by Sector11 »

jsocoinac wrote:But I get the impression that there's some hardware difficulty; I imagine not being able to script it is not your problem . .
No :oops: I have a desktop ... that Charging wasn't for me, but was for someone a long time ago that asked for this as a HowTo. I still have it and you asked ... :)
jsocoinac

Re: Conky Showoff thread

Post by jsocoinac »

> No, I have a desktop

Oh yes - you did say. Sorry. I wasn't sure how those pictures fitted it. Probably I paid insufficient attention.

At present I confine Linux to my laptop (unless you count my 'phone). One day I will move to Linux on my desktop too. At present my thinking is that that day will be when these things come to Linux: (1) MS Word 2013+, or something I find better (and lord knows Word has its problems); (2) VueMinder or a comparably good calendar program. 1 may not be far off (for Wine/Crossover). 2, at least for Mint Cinnamon, looks more distant. Also, I'd like various other things to be improved too - but I am de-railing this thread. Thanks for your help. I've adapted the caps lock stuff you provided; great.
Sector11

Re: Conky Showoff thread

Post by Sector11 »

No problem. Someday, if things are right, you'll switch. Personally doesn't bother me what people use. I'm retired and need nothing beyond email and online banking. All the rest is gravy. Dropped W2K in 2007 and been a Linux user since.

Enjoy your conky and have a nice day.
jsocoinac

Re: Conky Showoff thread

Post by jsocoinac »

Thank you.
not_Daniel

Re: Conky Showoff thread

Post by not_Daniel »

Orbmiser wrote:Man O' Man Conky is such a Time Sucker! Decided to find a script and modify thinking it's easy.
Spend at least 4-5 hours trying and tweaking to get everything working just right.

[img snip:]
https://www.flickr.com/photos/orb9220/8429410410/

Had to tweak and modify from the original
https://github.com/circumjacence/ConkyInfinitySVG
and don't understand how these coders can figure it all out as doesn't seem to be any gui type tools.
To take out the guesswork in positioning,placement of elements and such. Seems kind of arcane and time wasting to code it by guessing?

Tho love some of those Conky wonders.
.
I modified this theme slightly as well. The resolution and alignment is perfect because my 2nd monitor is 1920x1080 and since the config is right-aligned, it automatically displays on the 2nd (right-hand side) monitor.

Here's a few changes:

Code: Select all

update_interval 2.0
own_window_transparent yes
#temperature_unit fahrenheit -- lolwut?
temperature_unit celsius
${offset 650}${voffset -100}${font Ubuntu:pixelsize=16}${color FFA300}FREE ${offset 4}$color${fs_free /}${offset 30}${color FFA300}RAM ${offset 4}$color$mem${offset 30}${color FFA300}CPU ${offset 9}$color${cpu cpu0}%${offset 12}${color FFA300}TEMP ${offset 9}$color${execi 5 sensors | grep 'Core 0' | cut -c18-24}
${offset 120}${voffset 185}${color 4a89a7}${font Santana:size=8:style=Bold}root$color${font Santana:size=8} : ${offset 16}${fs_used /}/${fs_size /}
#check VPN connection first, then revert to eth0 if the VPN is disconnected. wlan0 not displayed bc I don't believe in wifi:
${if_existing /proc/net/route tun0}
${offset 713}${voffset 88}$color${font Santana:size=9:style=Bold}IP Address : ${addr tun0}
${offset 715}${voffset 0}$color${font Santana:size=8}TCP Connections : ${tcp_portmon 1 65535 count}
${offset 715}${voffset 0}${font Santana:size=8}${color e83737}Down : ${offset 9}$color${downspeedf tun0}kB/s ${offset 8}${color 46a646}Up : ${offset 9}$color${upspeedf tun0}kB/s
${offset 715}${voffset 0}${color 6f6f6f}${font Santana:size=8}Interface tun0 Usage :
${offset 575}${voffset -2}$color${font Santana:size=8}${color 2c2c2c}${downspeedgraph tun0 64,200 3B0000 FF0000}
${offset 780}${voffset -77}${color 2c2c2c}${upspeedgraph tun0 64,200 013900 04E200}
${else}${if_existing /proc/net/route eth0}
${offset 713}${voffset 88}$color${font Santana:size=9:style=Bold}IP Address : ${addr eth0}
${offset 715}${voffset 0}$color${font Santana:size=8}TCP Connections : ${tcp_portmon 1 65535 count}
${offset 715}${voffset 0}${font Santana:size=8}${color e83737}Down : ${offset 9}$color${downspeedf eth0}kB/s ${offset 8}${color 46a646}Up : ${offset 9}$color${upspeedf eth0}kB/s
${offset 715}${voffset 0}${color 6f6f6f}${font Santana:size=8}Interface eth0 Usage :
${offset 575}${voffset -2}$color${font Santana:size=8}${color 2c2c2c}${downspeedgraph eth0 64,200 3B0000 FF0000}
${offset 780}${voffset -77}${color 2c2c2c}${upspeedgraph eth0 64,200 013900 04E200}
${else}
${offset 713}${voffset 88}${color f4732d}${font Santana:size=9:style=Bold}Network disconnected!
${endif}${endif}
${offset 90}${voffset -160}${color EAEAEA}${font Ubuntu:pixelsize=20}${color f4732d}Linux Mint Xfce$color 17.3
The download/upload graphs are side-by-side and larger. CPU core temp #0 is accurately displayed. Next task is trying to figure out how to overlap both graphs into one and scale the bandwidth accordingly (as well as having "yellow" color for overlapping bandwidth.)
Sector11

Re: Conky Showoff thread

Post by Sector11 »

not_Daniel wrote:Next task is trying to figure out how to overlap both graphs into one and scale the bandwidth accordingly (as well as having "yellow" color for overlapping bandwidth.)
Stop using ${offset xxx} and use ${goto xxx}. Read about the difference here.
Only need one line:

Code: Select all

${goto 100}${color 2c2c2c}${downspeedgraph eth0 64,200 3B0000 FF0000}${goto 100}${downspeedgraph tun0 64,200 013900 04E200}${color}
Good luck.
not_Daniel

Re: Conky Showoff thread

Post by not_Daniel »

Sector11 wrote:
not_Daniel wrote:Next task is trying to figure out how to overlap both graphs into one and scale the bandwidth accordingly (as well as having "yellow" color for overlapping bandwidth.)
Stop using ${offset xxx} and use ${goto xxx}. Read about the difference here.
Only need one line:

Code: Select all

${goto 100}${color 2c2c2c}${downspeedgraph eth0 64,200 3B0000 FF0000}${goto 100}${downspeedgraph tun0 64,200 013900 04E200}${color}
Good luck.
I understand "goto" but I don't follow the rest of your line...why mix both tun0 and eth0 and put 2 downspeedgraphs in the same area? I'm assuming you meant this in the case where tun0 is active:

Code: Select all

${goto 100}${color 2c2c2c}${downspeedgraph tun0 64,200 3B0000 FF0000}${goto 100}${upspeedgraph tun0 64,200 013900 04E200}
I've already done that...the problem is there's no scale relative to upspeed vs downspeed and the red+green colors don't "mix" to form yellow. There's an amazing old windows app, dumeter, which worked like a charm...you could set the scale to any max bandwidth you wanted (or scale it automatically by default to the highest point in a session), there was a ton of options, and you could drag/resize it however you wanted. Also kept track on the total consumption and alerted you in case you were close to a 300GB cap -- and this was way back in '06.
Sector11

Re: Conky Showoff thread

Post by Sector11 »

It was only an example from your code. You were using ${offset} which is dependent on where it starts.
I was answering this:
Next task is trying to figure out how to overlap both graphs into one
The blending of red & green to make yellow will not happen as you already know.
To find you cap values as you put it use 'vnstat'.
Not a clue about dumeter, I don't use Windows and when I did I never heard about it.
not_Daniel

Re: Conky Showoff thread

Post by not_Daniel »

Sector11 wrote:overlap both graphs into one
I really think it's a futile effort...I think a new construct needs to be coded called "comboSpeedGraph" in which both up and down values are written into a single graph -- not one simply "overlapping" another. The individual graphs do indeed scale to their highest point in the session, except the graphs look the same side-by-side if, say, the download speed was a constant 900kB/s and the upload was a constant 10kB/s -- that's why relative scaling is important because you may be thinking you're uploading more than you think -- just by visually comparing graphs. "comboSpeedGraph" would take 3 hex color args -- up, down, and "combo". Scaling would be solved by default and that would solve the issue completely.
not_Daniel

Re: Conky Showoff thread

Post by not_Daniel »

I added a last line...which is another great example of sed that rids the need for text-boxes:

Code: Select all

# auto-indent every new line by the specified amount within '/ /'
${voffset 20}${font Ubuntu:pixelsize=15}${color f4732d}${execi 120 fortune | fold -s90 | sed 's/^/     /'}
Btw, who's this "Husse" guy in fortune? Talk about over-infatuation...

"If you still do not find it it's not there"...mmm...ok Husse.
Last edited by not_Daniel on Fri May 27, 2016 2:38 pm, edited 1 time in total.
not_Daniel

Re: Conky Showoff thread

Post by not_Daniel »

...and I deleted the line. I decided that I had enough fortune and Husse. There was some complications as well. -90 and -w90 still produce "character" wrapping on a new line and not proper "word" wrapping. I don't know how to solve this.

Additionally, ALL of the conky window elements randomly and annoyingly re-paint (1 blink) when a new fortune line re-draws from execi. I tracked it down to a buffering issue, here's the change on that:

Code: Select all

no_buffers no
#no_buffers yes
I have no idea what that does to your ram but that's the change if you want keep Husse and make him be less annoying. I also discovered something curious about Husse, fortune-mod is supposed to remove fortunes-husse but apparently he was kept around in Mint. Is this person still around today or is this figure nothing more than an old tribute to a Mint easter-egg or something -- like the South-African language pack in ff?
Sector11

Re: Conky Showoff thread

Post by Sector11 »

not_Daniel wrote:...and I deleted the line. I decided that I had enough fortune and Husse. There was some complications as well. -90 and -w90 still produce "character" wrapping on a new line and not proper "word" wrapping. I don't know how to solve this.
${ blah blah|fold -sw90} will fold at a 'space'

Code: Select all

       -s, --spaces
              break at spaces

       -w, --width=WIDTH
              use WIDTH columns instead of 80
not_Daniel

Re: Conky Showoff thread

Post by not_Daniel »

Sector11 wrote:
not_Daniel wrote:...and I deleted the line. I decided that I had enough fortune and Husse. There was some complications as well. -90 and -w90 still produce "character" wrapping on a new line and not proper "word" wrapping. I don't know how to solve this.
${ blah blah|fold -sw90} will fold at a 'space'

Code: Select all

       -s, --spaces
              break at spaces

       -w, --width=WIDTH
              use WIDTH columns instead of 80
Cool, thanks. Although -s90 seems to do the trick as the number is the implied amount of columns. I'll go back a couple posts up and modify my line.
Sector11

Re: Conky Showoff thread

Post by Sector11 »

not_Daniel wrote:Cool, thanks. Although -s90 seems to do the trick as the number is the implied amount of columns. I'll go back a couple posts up and modify my line.
YUP! new line works much better.
Locked

Return to “Compiz, Conky, Docks & Widgets”