Cpu and network speed plugin, Conky or not Conky?

I’m gonna have to google for a script that checks what device is coming up in /etc/ppp/ip-up.d and can restart the appropriate conky based on if wlan1 is active or the ethernet is…just not sure what to do if both are active…default to the ethernet?

Then again this might be easier if conky still supports it:

draw_graph_borders yes
${if_existing /sys/class/net/eno1/operstate up}
${color #0077ff}Net Down:$color ${downspeed eno1} ${color #0077ff}Net Up:$color ${upspeed eno1}
${color #0077ff}${downspeedgraph eno1 32,155 104E8B 0077ff} $alignr${color #0077ff}${upspeedgraph eno1 32,155 104E8B 0077ff}
${endif}
${if_existing /sys/class/net/wlan1/operstate up}
${color #0077ff}Net Down:$color ${downspeed wlan1} ${color #0077ff}Net Up:$color ${upspeed wlan1}
${color #0077ff}${downspeedgraph wlan1 32,155 104E8B 0077ff} $alignr${color #0077ff}${upspeedgraph wlan1 32,155 104E8B 0077ff}
${endif}

Ok so I coded this into the conky and it works as expected yet there are a couple of blank lines between “Network” and wlan1 which was the last of the 3 choices. The thing is I don’t see anything causes blank space?

${if_existing /sys/class/net/enp5s0/operstate up}
${color4}${font StyleBats:size=20}q${font}${color}${offset 8}${voffset -12}${color2}enp5s0 Up:${color} ${alignr}${offset -10$}${upspeed enp5s0}${alignr}${upspeedgraph enp5s0 8,100}
${color2}${offset 30}enp5s0 Down:${color} ${alignr}${offset -10$}${downspeed enp5s0}${alignr}${downspeedgraph enp5s0 8,100}
${endif}
${if_existing /sys/class/net/wlan0/operstate up}
${color4}${font StyleBats:size=20}q${font}${color}${offset 8}${voffset -12}${color2}wlan0 Up:${color} ${alignr}${offset -10$}${upspeed wlan0}${alignr}${upspeedgraph wlan0 8,100}
${color2}${offset 30}wlan0 Down:${color} ${alignr}${offset -10$}${downspeed wlan0}${alignr}${downspeedgraph wlan0 8,100}
${endif}
${if_existing /sys/class/net/wlan1/operstate up}
${color4}${font StyleBats:size=20}q${font}${color}${offset 8}${voffset -12}${color2}wlan1 Up:${color} ${alignr}${offset -10$}${upspeed wlan1}${alignr}${upspeedgraph wlan1 8,100}
${color2}${offset 30}wlan1 Down:${color} ${alignr}${offset -10$}${downspeed wlan1}${alignr}${downspeedgraph wlan1 8,100}
${endif}

Not always sure where blank lines come from in conky! Couple of ways to combat it:

  1. just use a ${voffset -#} where # is enough to pull it up where you want it - ahead of the display line that it too low.
  2. Sometimes, if you put a # at the end of each line, it becomes more predictable as to where you are.

One of the 2 should work!

Freebird54

Use some backslashes to prevent extra lines. Here’s how I modified what you had (and added another output of no Network):

${if_existing /sys/class/net/enp9s0/operstate up}\
${color4}${font StyleBats:size=20}q${font}${color}${offset 8}${voffset -12}${color2}Eth Up:${color} ${alignr}${offset -10$}${upspeed enp9s0}${alignr}${upspeedgraph enp9s0 8,100}
${color2}${offset 30}enp9s0 Down:${color} ${alignr}${offset -10$}${downspeed enp9s0}${alignr}${downspeedgraph enp9s0 8,100}
${else}\
${if_existing /sys/class/net/wlan0/operstate up}\
${color4}${font StyleBats:size=20}q${font}${color}${offset 8}${voffset -12}${color2}wlan0 Up:${color} ${alignr}${offset -10$}${upspeed wlan0}${alignr}${upspeedgraph wlan0 8,100}
${color2}${offset 30}wlan0 Down:${color} ${alignr}${offset -10$}${downspeed wlan0}${alignr}${downspeedgraph wlan0 8,100}
${else}\
${color 4}${font StyleBats:size=20}q${font}${color}${offset 8}${voffset -12}${color 2}No Network!
${endif}\
${endif}

Oops! Forgot about that - I tend to just allow each line to be verrrry long if needed :grin: I use a very capable code editor - in fact it is called Code. (From Microsoft of all people, check out VS-Code) Yes, the line extending character does the same job…

Freebird54

BTW: Awesome job on this. Looks and works great!

Check out vscodium. Its VS Code with the Microsoft telemetry and trackers removed (same source just recompiled without that extra big brother stuff).

From what I could figure in the code I saw, all the extra stuff could be turned off anyway - but if it is kept updated a version without it would be good. Does it accept all the same extensions etc? Got quite a lot in there w/custom theme, lua extensions, conkyscript recognition, history backup etc…

Code-screen
like so…

Freebird54

What’s sad is I had codium installed (yes even on the laptop) and didn’t even think about pulling it up. Will adapt the code. Yes they appear to keep it updated and all the extensions work…or at least python, ruby, shell scripting etc did when I installed them a few days ago.

I’ll have to try it on one of my other setups - I have all the goodies ready to drop in if it uses the same directory structure as VS-Code. The guy who wrote conkywx really set it up nicely for conky and lua use, and I borrowed shamelessly! :grin:

I’ll let you know how it goes.

Freebird54

Which plugin are you using on the conky code? The lua one?

That’s the conkyscript setup in use - but as conky uses the much of the same encoding - and comments - there isn’t much difference. The particular item I had ‘up’ include a lot of lua ‘calls’ - it was basically an include file for the conky I run at the bottom of the screen usually. The biggest difference is that it doesn’t make many code suggestions! I’m trying to setup Cinnamon (as it was one I hadn’t put vs-Code on yet) and I’ll let you know how it goes.

Freebird54

Well - that would look like a longer-term project! All the goodies I have go in 2 places, neither of which is in use by codium! For example, extensions go in ~/.vs-code-oss/extensions - and most of the rest goes in ~/.config/Code-OSS. From the quick look at codium, it puts everything all over /usr/share/vscodium - so figuring out whre it looks for what would take bit more time than I’m going to put in right now!

Freebird54

How are you getting your conky to autostart especially specifying the config it should use?

The way I autostart is a bit specialized (I have a complete conky control system that I put together that includes a gui for choosing conkys and sessions) - I can run a “sessionfile” anytime (they can include multiple conkys in a session). For general use, just write a script like:

#!/bin/bash
sleep 20
conky -c ~/.config/conky/conkyfilerc &

and stick that in autostart. The sleep is often needed for the WM to setup completely beforehand.
Where the script goes for autostarting is DE dependent - so I won’t say :grin:

Yeah…thats the problem I’m encountering…I don’t see the autostart setup for deepin and was hoping arch had a generic one for users…it got complicated quick talking about user systemd services and all I want is a simple script I can throw some shell script in to run conky. If I right click conky itself it has option “add to startup” but that makes a default conky and not the one I want even if I do like the old one did and create a ~/conky/conkyrc

Well - if this is Deepin, it appears that a desktop entry placed in ~/.config/autostart will do what you need

[Desktop Entry]
Type=Application
Exec="~/.config/conky/conkystart"
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=Conky-start
Comment=Start new default Conky

If you

  1. Save the script file I entered earlier as ~/.config/conky/conkystart
  2. chmod +x ~/.config/conkystart
  3. Save the .desktop file I just posted as ~/.config/autostart/Conkystart.desktop
  4. Logout or reboot, and see if it runs

Should work, AFAIK

There was already a conky.desktop in there from where I told it to run on startup. I added yours and setup the script and config…conky never triggers from either .desktop so not sure what the deal is. I give up for now and will just run it manually.

Does the script, when run from the command line, do what it should? IT doesn’t have much chance if not! I’ll drop over to the Deepin system on this machine, and see what I get. After all - I might learn something! :grin:

It works although I don’t see why you are passing the parms both in the script AND in the desktop entry. A dot was missing from the path in script so I got it squared away.

update disregard this…I got confused because everything is named conkystart.

Yeah - when doing ‘examples’ the names might not work out too well, Over on the Deepin, I had it called deepinrc for the conky itself, and the .desktop file was conky-start - and it all worked perfectly. BTW - I reduced the wait time to 10, it sets up so fast that more seems overkill. YMMV. You could run multiple conkys that way if you want, by just adding another conky -c filename to the start script…

OH - and even EndeavourOS hasn’t implemented the command we all need most - DWIM. They insist on doing what we tell them instead of - Do What I Mean :smile: