Announcement

Collapse
No announcement yet.

Yet Another Conky Thread - Contd.

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Yet Another Conky Thread - Contd.

    As it seems threads (in this section?) get auto-locked - I suppose after a certain time - I'll make a new one.
    Continued from https://www.kubuntuforums.net/showth...r-Conky-Thread

    I've made a few small improvements to my conky since then.
    It now looks like this:

    Click image for larger version

Name:	Screenshot_0405_204724.png
Views:	1
Size:	178.5 KB
ID:	649729

    I realise nobody here seems to be much interested in conky. But then some may be... I really can't believe people could want to "fly blind" on Linux, which offers so many monitoring possibilities.
    I couldn't use a computer without my conky. Any new system I try, the first thing I do is install it, else I have no idea what's going on - and I hate it.
    KSysGuard? Absurd ;-)

    Anyway. Let me explain the changes.
    Keep in mind that the idea here is "cram the most amount of useful information into the least possible space".
    - The CPU: bit. Totally useless, except I use two "mirrored" systems at the moment and sometimes get confused sometimes as to which I'm on :-)
    - I've added a "cumulative load" entry to the CPU part.
    - I use http://ipv4.icanhazip.com/ and http://ipv6.icanhazip.com/ for the different protocols to avoid confusion.
    - The Load Avg: bit. The if-then-else juggling I was using here , I luckily got rid of by using cat /proc/loadavg instead of uptime . It has no time format glitches.
    - I've added "total download" and upload to the network section.
    - Made some slight modifications to the RAM one. It's clearer.
    - I only have one partition in use on this machine, so the separate entries, though clever ;-) are not used. But you can take a hint from the "root" far-right label on how they were used.
    - The wireless mouse and keyboard battery state entries are - probably - useless. But I'm not sure yet how much :-)
    - The "Time to Xplanet" bit... hard to explain, but if anyone would like to know how I worked it out...

    #2
    You know you could probably reduce your CPU load a couple percent by not running Conky. Personally if I hear the fan come on, then I know it's getting overloaded.

    Comment


      #3
      Does my CPU look overloaded to you? :-)
      I never hear the fan come on, but if I did, I'd certainly like to have a conky telling me why...

      Comment


        #4
        Originally posted by Don B. Cilly View Post
        ...

        I realise nobody here seems to be much interested in conky. But then some may be...
        Mine's minimal but meets my needs.

        The image show the conky and Kubuntu's panel:

        Click image for larger version

Name:	20210407090857.jpg
Views:	1
Size:	5.9 KB
ID:	645116

        conky.conf:
        Code:
        conky.config = {
         alignment = 'top_left',
         default_color = '656565',
         use_xft = true,
         font = 'Ubuntu Mono:size=15',
         gap_x = 2,
         gap_y = 1,
         no_buffers = true,
         own_window = true, 
         own_window_class = 'Conky',
         own_window_type = 'dock',
         own_window_hints = 'undecorated,above,sticky,skip_pager',
         own_window_colour = '050000',
         update_interval = 2.0,
         use_spacer = 'none',
         double_buffer = true
        }
        
        conky.text = [[
        ${alignc}${color ad8a64}${time %a}${color}
        ${voffset 3}${color 999767}${alignc}${font Ubuntu Mono:size=20}${time %d}${font}${color}
        ${voffset 3}${color ad8a64}${alignc}${time %H:%M}${color}
        ${voffset 3}R${alignr}${execpi 2 bash myram.sh}
        ${voffset 3}T${alignr}${i8k_cpu_temp}
        ${voffset 3}C${alignr}${execpi 2 bash mycpu.sh}
        ${voffset 6}${alignc}${color ad8a64}...
        ${voffset 3}${alignc}${execpi 60 bash mynet.sh}${color}]]
        myram.sh:
        Code:
        #!/usr/bin/bash
        
        free -m | awk '$1 == "Mem:" { printf("% d", (($3 / $2 ) *100))}'
        mycpu.sh:
        Code:
        #!/usr/bin/bash
        
        cpu=$(mpstat 1 1 | awk '/Average/ { printf("% d",100-$NF) }')
        
        [ "$cpu" -gt 15 ] && echo "\${color white}$cpu"\${color} ||  echo "$cpu"
        mynet.sh:
        Code:
        #!/usr/bin/bash
        
        if ping -c2 www.google.com | grep -q -e '64 bytes from 192.168.1.1\|1 received\|0 received\|Name or service not known' ;
        then echo "off"
        else echo "on"
        fi
        Re. CPU usage by the conky itself, I reason it's minimal because, when I'm not doing anything, it's near zero.

        Any feedback or improvements will be most welcome!
        Kubuntu 20.04

        Comment


          #5
          Very minimal indeed :-)
          Feedback...
          - I guess you don't like the panel's own clock.
          - Conky has its own CPU variable, ${cpu} (which I find quite accurate).
          - It also has a memory one, but, like you, I use my own syntax for it because it doesn't report correct values. I use
          free -m | awk '/Mem:/ { printf ( $2-$7 ) /$2*100 }'
          (for percentage) which is pretty much the same as yours.
          - Network... again, I guess you don't like the panel's own indicator :-)

          [AH] As to load, my monster-of-a-conky uses between .50% and 1.20% of an i7-4600U CPU... averages around 1%. Well worth it for me.
          Last edited by Don B. Cilly; Apr 06, 2021, 11:14 PM.

          Comment


            #6
            Originally posted by Don B. Cilly View Post
            Feedback...
            - I guess you don't like the panel's own clock.
            - Conky has its own CPU variable, ${cpu} (which I find quite accurate).
            - It also has a memory one, but, like you, I use my own syntax for it because it doesn't report correct values. I use
            free -m | awk '/Mem:/ { printf ( $2-$7 ) /$2*100 }'
            (for percentage) which is pretty much the same as yours.
            - Network... again, I guess you don't like the panel's own indicator :-)

            [AH] As to load, my monster-of-a-conky uses between .50% and 1.20% of an i7-4600U CPU... averages around 1%. Well worth it for me.
            Thanks!

            ? Re. the clock, I couldn't format the panel's clock the way I want.
            ? Re. CPU, I know it's more efficient to use conky's built-in variables but by going the external route, I can have a different, more striking, color when CPU usage goes above a certain value.
            ? Re. RAM, I'll check out your RAM code!
            ? Re. Network, my ISP sometimes "fools" me into thinking I'm connected to the outer world when it's only getting as far as 192.168.1.1. The Network icon doesn't reflect this deception and other ISP misdeeds
            Kubuntu 20.04

            Comment


              #7
              Well, just for kicks, below is mine. I use Conky. Wouldn't have it any other way.

              Click image for larger version

Name:	Selection_1051.png
Views:	1
Size:	115.8 KB
ID:	645120

              Comment


                #8
                Li'l update:
                - I forgot: setting update_interval to 2 (seconds) greatly improves readability (of top processes) and reduces load significantly.
                - If no one is interested in "Time to render" (I understand), someone might be in "Time since last resume".

                Code:
                #!/bin/bash
                t1=$(date +"%s");z="0" # current time (epoch seconds)
                t2=$(journalctl -u systemd-suspend | tail -1 | awk '/all/ {print $3}') # time of last resume (human readable)
                t3=$(date -d $t2 +%s) # time of last resume (epoch seconds)
                cd=$(expr $t1 - $t3)
                hmsr=$(date -d@$cd -u +%H:%M:%S) # (seconds to hh:mm:ss)
                echo Time since last resume: $hmsr
                So ${execi 10 /home/not/.local/bin/tlr} - the above script (has no .sh extension and is in $path so it also works as a command) produces:

                Click image for larger version

Name:	Screenshot_0408_180516.png
Views:	1
Size:	3.1 KB
ID:	645121

                Comment


                  #9
                  I just discovered "if_match". Overjoyed!
                  Kubuntu 20.04

                  Comment


                    #10
                    Yes. it can be useful :-)
                    I didn't use it anymore, as (as I said) I got rid of by using cat /proc/loadavg instead of uptime.

                    On the other hand, on a day I was bored, I made the disk use bit prettier :-) with quite a bit of awk-juggling.
                    The other PC has two bars, one for / and one for /home (which explains the "root" label inside the bar. Inside saves space ;-)

                    Click image for larger version

Name:	Screenshot_0708_190520.png
Views:	1
Size:	10.2 KB
ID:	645181

                    Comment

                    Working...
                    X