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
User avatar
Todd Sauve
Level 4
Level 4
Posts: 268
Joined: Tue Oct 20, 2015 11:36 pm
Location: Calgary, Alberta

Re: Conky Showoff thread

Post by Todd Sauve »

Sector11 wrote:
Todd Sauve wrote:Thanks Sector11! You are a gentleman and a scholar, as most of my fellow Canadians are! 8) :lol:

Unfortunately, the code you wrote to detect the CPU doesn't work. :(

Code: Select all

CPU: ${pre_exec cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq | cut -c -10} \
${pre_exec cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq | cut -c 16-24}
Just trying to help.

RE: ${pre_exec ...} vs ${execi 86400 ...}
I'm using conky v1.9 you are using conky v1.10
You don't have the ${pre_exec cat ...} command in that version of conky ... {hopefully} YET!
Change it to: ${execi 86400 cat...} and it will update once a day ... no sense in wasting CPU cycles updating it more often.

Also each "cat" call (where's Batman?) is a different length depending on the CPU. Recommend doing all the ground work in a terminal:

Code: Select all

 31 Jul 16 @ 11:10:35 ~
  $ cat /proc/cpuinfo | grep 'model name'
model name	: AMD Athlon(tm) II X3 450 Processor
model name	: AMD Athlon(tm) II X3 450 Processor
model name	: AMD Athlon(tm) II X3 450 Processor
 
 31 Jul 16 @ 11:10:50 ~
  $ cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq
AMD Athlon(tm) II X3 450 Processor
 
 31 Jul 16 @ 11:12:53 ~
  $ cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq | cut -c -10
AMD Athlon
 
 31 Jul 16 @ 11:13:24 ~
  $ cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq | cut -c 16-24
II X3 450
 
 31 Jul 16 @ 11:13:47 ~
  $ 
As you see with the last two lines, I split the output into two calls to edit out the "(tm)". Script foo gurus out there could probably eliminate that second call and do it in one command ... but I'm not a script foo guru. :)
and in my conky:

Code: Select all

   CPU: ${pre_exec cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq | cut -c -10} \
${pre_exec cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq | cut -c 16-24}
cat, grep, sed, cut and possibly fold commands are a blessing and a curse ... man pages are a blessing and my friend.
ARGGGHHH!

OK, I put this in the code but it shows too much info to fit on the line in the conky display. It says: CPU: Intel(R) CM) i7-477 :(

What do I need to cut out to get rid of the (R) CM) ?


${goto 10}${font StyleBats:size=12}x${font} CPU: ${execi 86400 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq | cut -c -10} \
${execi 86400 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq | cut -c 16-24}

In fact, it is probably just easier not to even try to get the code to list the CPU. I should probably just leave it the way I have it.
Sector11

Re: Conky Showoff thread

Post by Sector11 »

Todd Sauve wrote:ARGGGHHH!
What do I need to cut out to get rid of the (R) CM) ?

In fact, it is probably just easier not to even try to get the code to list the CPU. I should probably just leave it the way I have it.
:lol: :lol: yea, I know your frustration - been there; screamed out loud! :lol:

I created a file, $HOME/catintel, with the info you gave me, here's the cut values:

Code: Select all

 31 Jul 16 @ 13:31:13 ~
  $ cat catintel
Intel(R) CM) i7-477

 31 Jul 16 @ 13:31:20 ~
  $ cat catintel | cut -c -5
Intel

 31 Jul 16 @ 13:31:40 ~
  $ cat catintel | cut -c 13-
 i7-477
 
 31 Jul 16 @ 13:31:50 ~
  $ 
And yea, you are right, you can just type the info in. You could also do that for your OS, it's not going to change multiple times a day either. BUT the idea is to get conky to do the work.

This will work for you:

Code: Select all

${goto 10}${font StyleBats:size=12}x${font}   CPU: ${execi 86400 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq | cut -c -5} \
${execi 86400 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq | cut -c 13-}
Also: IF this:
What do I need to cut out to get rid of the (R) CM) ?
is really this:
What do I need to cut out to get rid of the (R) (CM) ?
The code would be 14- not 13- in the second 'cut':

Code: Select all

${goto 10}${font StyleBats:size=12}x${font}   CPU: ${execi 86400 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq | cut -c -5} \
${execi 86400 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq | cut -c 14-}
--- --- --- --- --- --- ---
Also just some friendly advice about forum etiquette, I'm a member here just like you so this isn't "official":

When posting code from conkys, other scripts or terminal output use the

Code: Select all

[code]code tags
[/code] it makes things easier to read.
And you really don't need to quote entire posts, although a lot of people do ... trim it back a bit. It might only be a few bits, but every little 'bit' and 'byte' saved helps the server serve better.
User avatar
Todd Sauve
Level 4
Level 4
Posts: 268
Joined: Tue Oct 20, 2015 11:36 pm
Location: Calgary, Alberta

Re: Conky Showoff thread

Post by Todd Sauve »

Thanks Sector11!

Now there is just one more little detail. There is a redundant "CPU" at the end of the line and it says CPU: Intel (TM) i7-4770K CPU. How do I get rid of the CPU at the end of the line?

Other than that, it is working perfectly now!
Sector11

Re: Conky Showoff thread

Post by Sector11 »

Todd Sauve wrote:it says CPU: Intel (TM) i7-4770K CPU. How do I get rid of the CPU at the end of the line?
You're welcome

AHA! So the CPU: Intel(R) (CM) i7-477 wasn't exact.

I changed my little file to read - adding the missing ( as well
Intel(R) (CM) i7-477K CPU
and in the terminal to get the cut right:

Code: Select all

 31 Jul 16 @ 15:50:58 ~
  $ cat catintel
Intel(R) (CM) i7-477K CPU

 31 Jul 16 @ 15:51:06 ~
  $ cat catintel | cut -c -5
Intel
 
 31 Jul 16 @ 15:51:16 ~
  $ cat catintel | cut -c 14-
 i7-477K CPU
 
 31 Jul 16 @ 15:51:45 ~
  $ cat catintel | cut -c 14-19
 i7-47
 
 31 Jul 16 @ 15:52:56 ~
  $ cat catintel | cut -c 14-20
 i7-477
 
 31 Jul 16 @ 15:53:01 ~
  $ cat catintel | cut -c 14-21
 i7-477K
 
 31 Jul 16 @ 15:53:06 ~
  $ 
Sooooo ... the second call would be:

Code: Select all

${execi 86400 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq | cut -c 14-21}
Check out

Code: Select all

cut --help
User avatar
Todd Sauve
Level 4
Level 4
Posts: 268
Joined: Tue Oct 20, 2015 11:36 pm
Location: Calgary, Alberta

Re: Conky Showoff thread

Post by Todd Sauve »

OK, I don't quite get what you are driving at. When I paste your code:

${execi 86400 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq | cut -c 14-21}

I get: CPU: Intel (TM) i7-

But that is all it shows now. We are not communicating well on this last little bit of code, so what should it be?

I would like to get rid of the (TM) as well, if possible.
Sector11

Re: Conky Showoff thread

Post by Sector11 »

OK, but PLEASE do this: open a terminal and paste in this line, hit Enter and post the results here:

Code: Select all

cat /proc/cpuinfo | grep 'model name'
That will tell me exactly what I need

Mine:

Code: Select all

 31 Jul 16 @ 18:44:48 ~
  $ cat /proc/cpuinfo | grep 'model name'
model name	: AMD Athlon(tm) II X3 450 Processor
model name	: AMD Athlon(tm) II X3 450 Processor
model name	: AMD Athlon(tm) II X3 450 Processor
 
 31 Jul 16 @ 18:44:53 ~
  $ 
User avatar
Todd Sauve
Level 4
Level 4
Posts: 268
Joined: Tue Oct 20, 2015 11:36 pm
Location: Calgary, Alberta

Re: Conky Showoff thread

Post by Todd Sauve »

OK, here's what it says:

todd@todd-All-Series ~ $ cat /proc/cpuinfo | grep 'model name'
model name : Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz
model name : Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz
model name : Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz
model name : Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz
model name : Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz
model name : Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz
model name : Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz
model name : Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz

And now I have to go to bed for a while--I'm beat!!!
Sector11

Re: Conky Showoff thread

Post by Sector11 »

Thank you ... try this:

Code: Select all

CPU: ${execi 86400 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq | cut -c -5} \
${execi 86400 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq | cut -c 19-26}
You should see:

Code: Select all

CPU: Intel i7-4770K
User avatar
Todd Sauve
Level 4
Level 4
Posts: 268
Joined: Tue Oct 20, 2015 11:36 pm
Location: Calgary, Alberta

Re: Conky Showoff thread

Post by Todd Sauve »

Thanks Sector11!

It works perfectly! :mrgreen:
User avatar
trytip
Level 14
Level 14
Posts: 5371
Joined: Tue Jul 05, 2016 1:20 pm

Re: Conky Showoff thread

Post by trytip »

fun with snaps ... mint/mate 17.03

Image

Image
Image
Sector11

Re: Conky Showoff thread

Post by Sector11 »

@trytip ... what a neat idea ... let's see if we can get a chain going.

BunsenLabs 8.5
Image
With 6 conkys to stay on topic.
Last edited by Sector11 on Wed Aug 10, 2016 10:54 pm, edited 1 time in total.
Sector11

Re: Conky Showoff thread

Post by Sector11 »

I'm tired, please delete - double post - see above.
ostracized

Re: Conky Showoff thread

Post by ostracized »

Modifying @Retic1959's choice, which is quite nice but don't really have an interest to install a "Conky Manager"...but let me know if you do and see how it works out. In my version I get rid of references to the battery since a) I'm on a desktop and b) terminal was complaining of battery acpi errors, probably due to old legacy settings.

Retic1959's link points to another mediafire link which provides you with a nice collection of configs...many of them need updating due to persistent weather API issues and new naming schemes of the network adapters in the 16.04 codebase.

Anyway his theme is the first one in the pack, "4 & 2 core blue". In that folder he's using conkyrc2core, because dual-cores are still cool. :lol:

Here are the prereqs:
1. install Lua obviously if it hasn't been installed.
2. install /fonts/Caviar_Dreams.ttf, /fonts/Caviar_Dreams_Bold.ttf, and /fonts/Radio_Space.ttf

In clock01_rings.lua, get rid of the entire battery element and make these changes (which are just basically changing around the x and y coords of 5 rings):

Code: Select all

    {
        name='cpu',
        arg='cpu0',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.3,
        fg_colour=0x0ABFFF,
        fg_alpha=0.8,
        x=152, y=323,
        radius=25,
        thickness=5,
        start_angle=-90,
        end_angle=180
    },
    {
        name='cpu',
        arg='cpu1',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.3,
        fg_colour=0x0ABFFF,
        fg_alpha=0.8,
        x=226, y=323,
        radius=25,
        thickness=5,
        start_angle=-90,
        end_angle=180
    },
    {
        name='fs_used_perc',
        arg='/',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0x0ABFFF,
        fg_alpha=0.8,
        x=35, y=587,
        radius=25,
        thickness=5,
        start_angle=-90,
        end_angle=180
    },
    {
        name='memperc',
        arg='',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0x0ABFFF,
        fg_alpha=0.8,
        x=130, y=590,
        radius=25,
        thickness=5,
        start_angle=-90,
        end_angle=180
    },
    {
        name='swapperc',
        arg='',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0x0ABFFF,
        fg_alpha=0.8,
        x=220, y=592,
        radius=25,
        thickness=5,
        start_angle=-90,
        end_angle=172
    },
These changes in conkyrc2core:

Code: Select all

# Conky settings #
background no
update_interval 1
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale yes
double_buffer yes
no_buffers yes
text_buffer_size 2048
temperature_unit celsius
default_color FFFFFF

# Window specifications #
own_window yes
own_window_type normal
own_window_hints below,skip_pager,skip_taskbar,sticky,undecorated
own_window_argb_visual yes
own_window_argb_value 190
border_inner_margin 0
border_outer_margin 5
minimum_size 250 300
maximum_width 250
alignment top_right
gap_x 10
gap_y 38

# Graphics settings #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes

# Text settings #
use_xft yes
xftfont caviar dreams:size=8
xftalpha 0.5
uppercase no

# Lua Load #
lua_load ~/.conky/clock01_rings.lua
lua_draw_hook_pre clock_rings

TEXT
# Time, date, and uptime #
${voffset 7}${font Radio Space:size=16}${color 0ABFFF}${time %A}${font}$color${font Radio Space:size=38}${goto 167}${voffset -8} ${time %e}${font}
${font Radio Space:size=18}${voffset -30}${time %b}${font}${voffset -3} ${font Radio Space:size=20}${time %Y}${font}${color 0ABFFF} ${hr 1}
${font caviar dreams bold:size=10}${goto 150}${voffset 170}Uptime: ${uptime_short}
# CPU usage #
${color 0ABFFF}${hr 1}$color
${color 0ABFFF}${voffset 6}Temp: $color ${execi 5 sensors|grep 'Core 0'|cut -c18-24}
${color 0ABFFF}${voffset 6}Processes:$color $processes
${color 0ABFFF}${voffset 6}Running: $color  $running_processes${goto 116}${voffset 8}${cpu cpu0}% ${color 0ABFFF}${goto 116}${voffset 13}CPU1$color${goto 191}${voffset -12}${cpu cpu1}% ${color 0ABFFF}${goto 191}${voffset 12}CPU2$color
${color 0ABFFF}${voffset -12}FREQ:$color ${freq}MHz
${color 0ABFFF}${voffset 6}Load:$color ${loadavg}
# Network #
${color 0ABFFF}${voffset 2}${hr 1}
${color 0ABFFF}${voffset 5}Hostname: $color$alignr$nodename
#${color 0ABFFF}wlan0: $color$alignr${addr wlan0}
#${color 0ABFFF}Current: $color${alignr}${execi 10 /sbin/iwconfig wlan0|grep Rate|cut -d"M" -f1|cut -b20-24} Mbits/sec
${color 0ABFFF}eno1: $color$alignr${addr eno1}
${if_existing /proc/net/route tun0}${color 0ABFFF}tun0: $color$alignr${addr tun0}${endif}

${color 0ABFFF}Down: $color${downspeed eno1}/s ${alignr}${color #0ABFFF}Up:$color ${upspeed eno1}/s
${downspeedgraph eno1 30,120 000000 FF0000} ${alignr}${upspeedgraph eno1 30,120 000000 04E200}$color
${color 0ABFFF}Total:$color ${totaldown eno1} ${alignr}${color 0ABFFF}Total:$color ${totalup eno1}
# DISK/RAM/SWAP usage #
${color 0ABFFF}${voffset 2}${hr 1}
${color FFFFFF}${goto 7}${voffset 39}${fs_used_perc /}%
${color 0ABFFF}${goto 7}DISK
${color FFFFFF}${goto 102}${voffset -27}${memperc}%
${color 0ABFFF}${goto 102}RAM
${color FFFFFF}${goto 192}${voffset -26}${swapperc}%
${color 0ABFFF}${goto 191}SWAP
# Running processes #
${color 0ABFFF}${voffset 2} ${hr 1}
${color 0ABFFF}${voffset 5}NAME${goto 163}CPU%${goto 210}MEM%$color${voffset 5}
${top name 1}${goto 160}${top cpu 1}${goto 205}${top mem 1}
${top name 2}${goto 160}${top cpu 2}${goto 205}${top mem 2}
${top name 3}${goto 160}${top cpu 3}${goto 205}${top mem 3}
${top name 4}${goto 160}${top cpu 4}${goto 205}${top mem 4}
${top name 5}${goto 160}${top cpu 5}${goto 205}${top mem 5}
# Computer info #
${color 0ABFFF}${voffset 2}${hr 1}${voffset 5}
${color 0ABFFF}OS:$color${alignr}${exec cat /etc/issue.net} $machine
${color 0ABFFF}Kernel:$color${alignr}${kernel}$color
# Logging #
${color 0ABFFF}${voffset 2}${hr 1}$color
${color 0ABFFF}${alignc}SYSLOG:$color
${color 0ABFFF}${voffset -5}${hr 1}$color
${voffset 5}${font caviar dreams:size=9}${execi 10 tail -n4 /var/log/syslog | awk '{print " ",$0}' | fold -s45}
Notes:
  • This gives a more accurate reading of the cpu temp considering "acpitemp" could really be anything, including the temp on your physical motherboard, lol.
  • The 2nd gradient colors of the download/upload graphs fit my liking and habit of seeing those colors in DU Meter in Windows. You could argue that it breaks the "entirely blue" color scheme but I find these graphs are more noticeable (especially when rogue apps start uploading secret mothership data.)
  • The name, "wlan0" needs to be modified if you're going to be using unreliable wifi on the desktop. Easiest way to find out the name is by doing an ifconfig and seeing the correct adapter name in the left column.
  • own_window_hints undecorated is probably what you wanted for a borderless window without a title bar. You can move the window (by default) by holding ALT+left click.
  • The reason why I have gap_y 38 is because on my 2nd monitor (where I like the Conky window to show up), the window will align to the top area of the screen, regardless if it's viewable or not. Here's why, the following second monitor position is intentional:
    monitor-prefs.png
    ...long story short, watch this insightful youtube clip, use the "Esco" window border, and the extra y setting compensates.
  • I have absolutely no idea where the reference to ~/.conky/accu_weather/rss/weather is, so (much like unreliable yahoo weather sources) I left it out completely, along with the battery portion.
  • In the last bit showing the last 4 lines of the syslog, I don't know what the awk syntax is to omit $1, $2, and $4, show $3, and THEN show the rest of the (complete) line. The original code cut off the lines since obviously there's more than just $10 elements...maybe @xenopeek has some insight on this. I simply show the entire line and make the font a bit smaller and wrap line words. Preferably I'd want: tail -n5 /var/log/syslog | awk '{ print $3,$5,...,[EOL]) }' since obviously log event times are important.
  • Feel free to add your own notes because I'm obviously stupid.
LPT: If you want easy readability when making changes in XED, change the highlight mode in XED by doing View -> Highlight Mode -> Source -> Boo. I don't know why "Boo" works so well with conky configs, but it's so bae.
Did you know? These are actually legacy Conky configs now. The updated 1.10+ Conky follows the Lua syntax. Thankfully 1.10 reads legacy code fine. For now.
Sector11

Re: Conky Showoff thread

Post by Sector11 »

Hi ostracized

In the LUA script you are using:

Code: Select all

    {
        name='cpu',
        arg='cpu0',
        blah blah ...
    },
    {
        name='cpu',
        arg='cpu1',
        blah blah ...
    },
which means you are showing the "average" of your two CPU's and CPU 1 - or if you're running an Intel chip CORES

To show both of your cores/cpus change that to:

Code: Select all

    {
        name='cpu',
        arg='cpu1',
        blah blah ...
    },
    {
        name='cpu',
        arg='cpu2',
        blah blah ...
    },
Take a look at this post for an explanation of how:
  • Intel uses CORE 0 and CORE 1 for a dual core chip
  • AMD uses CPU 1 and CPU 2 for a dual core chip
  • conky uses ${cpu cpu1} and ${cpu cpu2} for separate cores/cpus
  • and also ${cpu} or ${cpu cpu0} for the the average of the cores/cpus
From: http://conky.sourceforge.net/variables.html
cpu (cpuN)
CPU usage in percents. For SMP machines, the CPU number can be provided as an argument. ${cpu cpu0} is the total usage, and ${cpu cpuX} (X >= 1) are individual CPUs.
[*] I have absolutely no idea where the reference to ~/.conky/accu_weather/rss/weather is, so (much like unreliable yahoo weather sources) I left it out completely, along with the battery portion.
That can be found here: » Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant) - bash scripts that are well documented and supported by TeoBigusGeekus.

Scroll down to: 1d)Accuweather RSS - 1d_12-2-14 :)

Does ${pre_exec} work in conky v1.10 yet?
ostracized

Re: Conky Showoff thread

Post by ostracized »

Sector11 wrote: To show both of your cores/cpus change that to:

Code: Select all

    {
        name='cpu',
        arg='cpu1',
        blah blah ...
    },
    {
        name='cpu',
        arg='cpu2',
        blah blah ...
    },
Ok well that's weird, because I didn't touch that from the original authors, which means all of them were unaware of this since 2009?
Does ${pre_exec} work in conky v1.10 yet?
No. ${pre_exec} literally parses into text. That was one needed change to simply exec. And I don't see the advantage of using pre if the execution is not on an interval anyway? Apparently pre_exec was removed quite a while ago.

Here are the updated variables btw: https://github.com/brndnmtthws/conky/wi ... -Variables
Sector11

Re: Conky Showoff thread

Post by Sector11 »

RE: ${cpu} - ${cpu cpu0} = average
ostracized wrote:Ok well that's weird, because I didn't touch that from the original authors, which means all of them were unaware of this since 2009?
In a word: Yes! Even though the conky variable page has explained it for as long as I have been a conky user (2007), "man conky" in a terminal will tell you the same.

There are a lot of people that think because "Intel" reports "CORES" starting at 0, like so many things with computers, and conky has a ${cpu cpu0} command that they are equal. Clearly the conky variable/man page says different. AMD starts counting their multiple 'core' chips with CPU1, CPU2, etc

A simple test in a simple conky:

Code: Select all

TEXT
  CPU %
Avg ${cpu}
Avg ${cpu cpu0}
${hr}
  1 ${cpu cpu1}
  2 ${cpu cpu2}
  3 ${cpu cpu3}
- I have a triple core AMD so I added the ${cpu} command above my ${cpu cpu0} to show in this screehshot

9+11+9=29 and 29/3= 9.666 - 10 is close enough. :)

Stress that out and you will always see ${cpu} and ${cpu cpu0} at the same levels and they will be within a reasonable guestimate of "average".
ostracized wrote:
Does ${pre_exec} work in conky v1.10 yet?
No. ${pre_exec} literally parses into text. That was one needed change to simply exec. And I don't see the advantage of using pre if the execution is not on an interval anyway? Apparently pre_exec was removed quite a while ago.

Here are the updated variables btw: https://github.com/brndnmtthws/conky/wi ... -Variables
Oh I know what ${pre_exec} does I use it a lot since I turn my computer off every night and some conky commands do not need to be updated at all during it's run time.

Two such examples - four really

Code: Select all

15/01/86: ${color1}${pre_exec conkyDateDiff 19860115}${goto 305}${color5}${pre_exec conkyDaysDiff 19860115}${color}
04/07/78: ${color1}${pre_exec conkyDateDiff 19780704}${goto 305}${color5}${pre_exec conkyDaysDiff 19780704}${color}
as seen in a terminal, they count time by date and days:

Code: Select all

 17 Aug 16 @ 14:01:46 ~
  $ conkyDateDiff 19860115
30 yrs 7 mths 2 days
 
 17 Aug 16 @ 14:01:48 ~
  $ conkyDaysDiff 19860115
11172
 
 17 Aug 16 @ 14:02:01 ~
  $ 
don't need to update once conky is running. With conky v1.10 I have to change a LOT of pre_exec commands to ${execi 86400} which, in my mind, means conky is still checking the clock to see if it needs updating - therefore using a bit (tiny I know) of CPU resources to do that ... but as I said: I have a lot. Normally with 14 conkys running and everything else idle my cpu usage is around 4-5%. That 10 you see above is because I have firefox, medit and claws_mail open as well.
ostracized

Re: Conky Showoff thread

Post by ostracized »

Sector11 wrote:RE: ${cpu} - ${cpu cpu0} = average
I should've said that I already understand you and there's no need to explain...I just found it odd that no one seemed to have noticed that in the Lua script for what...at least 7+ years?

Also, I would be cautious about using the word "average" here because that might get taken out of context and just use "total cpu usage" instead (per the old variable page on SF.)
$cpu = ${cpu cpu0} = "total cpu utilization of the system" = "mean value among all cores of the system"
...I would think a more "meaningful" use of the word "average" would be the load average figures that everyone is used to.
With conky v1.10 I have to change a LOT of pre_exec commands to ${execi 86400}
I still don't understand why you simply can't replace it with exec in those instances versus putting it on a long interval with execi. That's what I did in the latest config on line 84: ${color 0ABFFF}OS:$color${alignr}${exec cat /etc/issue.net} $machine
More potential resources? My understanding is that pre_exec ran before elements got painted and exec runs during the painting. Although I did see a reference for execp to be re-evaluated when Conky "loops"...whatever that means.
ostracized

Re: Conky Showoff thread

Post by ostracized »

ostracized wrote:I don't know what the awk syntax is to omit $1, $2, and $4, show $3, and THEN show the rest of the (complete) line.
I figured out how to solve this. awk '{print $3,(substr($0,24))}' -- that gives you the timestamp and then the relevant log line without the full date and your hostname (which you obviously know.) Because your hostname is different, change '24' to the number of characters at the beginning of each line in syslog before relevant log text is outputted (mine starts with character #24 in every line.)

I would still like to color the timestamp for easier readability and use execpi to insert Conky color variables right into awk, but apparently something like this isn't working for me: ${execpi 5 tail -n4 /var/log/syslog | awk '{${color yellow}print $3${color},(substr($0,23))}' | fold -s43} and I can't find a lot of execpi examples out there...
Sector11

Re: Conky Showoff thread

Post by Sector11 »

ostracized wrote:Also, I would be cautious about using the word "average" here because that might get taken out of context and just use "total cpu usage" instead (per the old variable page on SF.)
$cpu = ${cpu cpu0} = "total cpu utilization of the system" = "mean value among all cores of the system"
...I would think a more "meaningful" use of the word "average" would be the load average figures that everyone is used to.
OK, you're right man page says "total" :)

but 9%+11%+9% = 30% and ${cpu} would report 10% - it looks like average to me. :wink:

I'll use total from now on ;)
ostracized wrote:
With conky v1.10 I have to change a LOT of pre_exec commands to ${execi 86400}
I still don't understand why you simply can't replace it with exec in those instances versus putting it on a long interval with execi. That's what I did in the latest config on line 84: ${color 0ABFFF}OS:$color${alignr}${exec cat /etc/issue.net} $machine
More potential resources? My understanding is that pre_exec ran before elements got painted and exec runs during the painting. Although I did see a reference for execp to be re-evaluated when Conky "loops"...whatever that means.
Well, back to the man page: (bold is mine)
exec command
Executes a shell command and displays the output in conky. warning: this takes a lot more resources than other variables. I'd recommend coding wanted behaviour in C and posting a patch.
"loop" I think, may refer to "update_interval". Not 100% sure though.
Sector11

Re: Conky Showoff thread

Post by Sector11 »

@ ostracized

RE: awk I'm horrible with awk and sed commands. But you can use conky commands with sed:

The centre calendar:

Code: Select all

${goto 175}${execpi 900 LAR=`date +%-d`; ncal -bh | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color}/' | sed ':a;N;$!ba;s/\n/\n${goto 175}/g'}${color}
Image
Good luck
Locked

Return to “Compiz, Conky, Docks & Widgets”