Announcement

Collapse
No announcement yet.

Yet Another Conky Thread

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

    #16
    Originally posted by Don B. Cilly View Post
    One thing I liked in yours is Load. I'll add that.
    So I did
    I had to cram the system info into even less space, being too lazy to move the grids and Lua linengraphs, but for the moment, I quite like it :·)

    Click image for larger version

Name:	load.png
Views:	1
Size:	62.3 KB
ID:	644458

    [EDIT] The code is quite a bit of a juggling (offset/voffest) exercise, actually, :·) so if anyone is interested:

    Code:
    ${font ubuntu:bold:size=8}Kernel:  ${alignr}${color 607f96}${execi 6000 inxi -c 0 -Sx | awk '/System:/ {print substr($5,1,8),$6}'}${color}
    ${voffset -2}Distro:               ${alignr}${color 607f96}${execi 6000 lsb_release -d | awk '/Description:/ {print $2,$3,$4}'}${color}
    ${voffset -2}${alignr}Up: ${color 607f96}${uptime}${color}
    ${voffset -15}KDE:  ${color 607f96}${execi 6000 inxi -c 0 -Sx | awk '/Desktop:/ {print $4,$5,$6}'}${color}
    ${voffset -2}Load avg.:  (1m) ${voffset 1}${color 607f96}${exec uptime | awk '/user/ {print $8"         ",$9,"          "$10}'}${color}
    ${voffset -15}${offset 115}(5m)${offset 28}(15m)
    ${voffset -6}$stippled_hr${voffset 78}
    Last edited by Don B. Cilly; Dec 12, 2019, 02:55 PM.

    Comment


      #17
      Originally posted by Don B. Cilly View Post
      So I did
      I had to cram the system info into even less space, being too lazy to move the grids and Lua linengraphs, but for the moment, I quite like it :·)
      Total noob at conky & awk here, so thanks for the substr trick with awk!

      My question is about the use of inxi. I think you can do without it.
      This is just a mock conky:
      Code:
      conky.text = [[
      ${exec uname -a | awk '{ print substr($3,1,9)" "$12 }'}
      ${exec kf5-config --version | awk '/Qt/ { print $2}'}
      ]]
      If you compare
      time uname -a | awk '{ print substr($3,1,9)" "$12 }'
      and
      time inxi -Sx | awk '/System/ { print substr($5,1,9)" "$6 }'
      you'll notice that the first is considerably quicker. (Your exact values in inxi and awk could be different. I'm using inxi 3.0.37-00 (2019-11-19)). On my system, both output 4.15.0-70 x86_64

      BTW, I think that "-c 0" is the default now and isn't needed in the version I use.

      More on inxi & conky here: https://forums.bunsenlabs.org/viewtopic.php?id=5551
      Kubuntu 20.04

      Comment


        #18
        Thanks
        I'll check it out... even though, those command are ${execi 6000}... they execute every 6000 seconds...

        Thing is, I had a "disagreeable" surprise this morning.
        I wrote the uptime thingy with an uptime of over one hour. At reboot, it was under 1 hour, and the string numbers changed.
        So I had to find my way through an if/then/else maze until I found a way around that.
        And I couldn't find a way to do it with the conky $loadavg... not with the labels and colours.
        This seems to work:

        Code:
        ${font ubuntu:bold:size=8}Kernel:  ${alignr}${color 607f96}${execi 6000 inxi -c 0 -Sx | awk '/System:/ {print substr($5,1,8),$6}'}${color}
        ${voffset -2}Distro:               ${alignr}${color 607f96}${execi 6000 lsb_release -d | awk '/Description:/ {print $2,$3,$4}'}${color}
        ${voffset -2}${alignr}Up: ${color 607f96}${uptime}${color}
        ${voffset -15}KDE:  ${color 607f96}${execi 6000 inxi -c 0 -Sx | awk '/Desktop:/ {print $4,$5,$6}'}${color}
        ${if_match "$uptime" >="1"}${voffset -2}Load avg.:  (1m) ${voffset 1}${color 607f96}${exec uptime | awk '/average/ {print $8"         ",$9,"          "$10}'}${color}${else}${if_match "$uptime" <="1"}${voffset -2}Load avg.:  (1m) ${voffset 1}${color 607f96}${exec uptime | awk '/average/ {print $9"         ",$10,"          "$11}'}${color}${endif}${endif}
        ${voffset -15}${offset 115}(5m)${offset 28}(15m)

        Comment


          #19
          Originally posted by Don B. Cilly View Post
          I'll check it out... even though, those command are ${execi 6000}... they execute every 6000 seconds...
          Umm, why do you need to update it all...it's never going to change at runtime?
          You could do a simple "${exec uname -ri}"

          Comment


            #20
            uname -ri is brilliant, didn't know, thanks

            The way I understand it though - and I may be wrong but it looks like it - is, exec keeps executing at every cicle (1 sec by my update_interval), execi at defined intervals.
            So I put 100 minutes as if to say, don't bother. ;·)

            Comment


              #21
              Originally posted by Don B. Cilly View Post
              The way I understand it though - and I may be wrong but it looks like it - is, exec keeps executing at every cicle (1 sec by my update_interval), execi at defined intervals.
              So I put 100 minutes as if to say, don't bother. ;·)
              Good answer

              You're right, of course, it's been a good while since I toyed with conky configs (and checked the man page)...still, you could only update after a few trillion years (not that it is really that resource intensive).

              Comment


                #22
                I could, but working out what the trillion years come to in seconds is too resource-intensive... for me

                Comment


                  #23
                  1.893456e+21 seconds
                  Don't worry about it, your retirement funds will be cut off long before then.
                  Kubuntu 24.11 64bit under Kernel 6.11.0, Hp Pavilion, 6MB ram. Stay away from all things Google...

                  Comment


                    #24
                    (Ignoring the advice in the OP's handle.)
                    Originally posted by TWPonKubuntu View Post
                    1.893456e+21 seconds
                    my calculator says 60 * 60 * 24 * 365.2425 * 1 trillion is 3.1556952e+19 (assuming the "short scale" braindamage). Finding power to keep the computer going that long might be difficult; I've assumed it will have been moved to a "better" place than the earth, which will be too hot in a few hundred million years.

                    Slightly less ridiculously, trying to specify a number of seconds that overflows a 64 bit signed integer, about 9.2e18, might be problematic.
                    Regards, John Little

                    Comment


                      #25
                      Ah, I had too many digits in 1 Trillion, high by a factor of 1000. Guess I'm too old...
                      Kubuntu 24.11 64bit under Kernel 6.11.0, Hp Pavilion, 6MB ram. Stay away from all things Google...

                      Comment


                        #26
                        Originally posted by jlittle View Post
                        (Ignoring the advice in the OP's handle.)

                        my calculator says 60 * 60 * 24 * 365.2425 * 1 trillion is 3.1556952e+19 (assuming the "short scale" braindamage). Finding power to keep the computer going that long might be difficult; I've assumed it will have been moved to a "better" place than the earth, which will be too hot in a few hundred million years.

                        Slightly less ridiculously, trying to specify a number of seconds that overflows a 64 bit signed integer, about 9.2e18, might be problematic.

                        As you are all probably aware, I didn't suggest it seriously, it wouldn't really be practical...or sane. Was fairly sure that someone would count it, though
                        (If it's not a server, making the interval a year [or a few months] would probably suffice to never update it...again with no practical benefits except that fuzzy feeling you get from needless optimizing).

                        Comment


                          #27
                          Just planning to be around for the collision of the Milky Way and Andromeda galaxies. Fireworks are expected. If you miss it by a factor of 1000, no problem, it will last a while.

                          Remember that computers may evolve beyond 64 bit resolution, maybe even go to quantum computing in our lifetimes.
                          Kubuntu 24.11 64bit under Kernel 6.11.0, Hp Pavilion, 6MB ram. Stay away from all things Google...

                          Comment


                            #28
                            Nah, I'm just waiting for those black holes to evaporate, kind of a slow process taking roughly 10^70 years (give or take a few zeroes), but it should give me some time to read all the books I have planned to read.

                            Comment


                              #29
                              Interesting factlet for conky buffs:
                              Since last night icanhazip.com returns the IPV6 address. To get the V4 one you can use checkip.amazonaws.com

                              Code:
                              $ curl -s http://icanhazip.com
                              2a01:c50f:9a94:6800:91f3:652e:8e64:569e
                              
                              $ curl -s http://checkip.amazonaws.com
                              92.56.100.55
                              (actual addresses abridged) >:·)

                              Comment


                                #30
                                Another (un)interesting factlet:
                                Whereas my IPV4 address remains the same through router reboots, the V6 one changes every time.
                                The first four hextets remain the same, the last four change. :·)

                                [Correction] A computer reboot will quite suffice for it to change.
                                Last edited by Don B. Cilly; Dec 26, 2019, 02:56 AM.

                                Comment

                                Working...
                                X