You are not logged in.

#1 2024-03-21 17:40:01

JasonMehmel
Member
Registered: 2015-10-06
Posts: 186

building margins or padding for a tint2 executor? (for CPU)

I'm using the executors I found here: https://lecorbeausvault.wordpress.com/2 … executors/

Specifically, the CPU. There are times where my conky is obscured but I want to know how much CPU I'm using!

It's working great! The only thing that's bugging me is that the icon moves (and moves the whole panel) when the number changes a digit level. (From one, two, or three levels, for those rare times I hit 100%! wink )

Let me know if that makes sense.

The new Tint2 settings tool I found in Boron has been great, but I can't figure out how to make sure that this executor can have it's own area without changing the spacings of the areas around it.

(Let me know if this description makes sense. I can try to capture it and share a gif or video as well.)

The Horizontal and Vertical Padding options seem like they'd help, but tweaking them has brought no joy.


Fortune favours the bold.
ThinkPad T15 Gen 2i

Offline

#2 2024-03-21 20:34:25

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,737

Re: building margins or padding for a tint2 executor? (for CPU)

One way might be to pad the cpu variable, so the modified cpu script:

#!/bin/bash

  read cpu a b c previdle rest < /proc/stat
  prevtotal=$((a+b+c+previdle))
  sleep 0.5
  read cpu a b c idle rest < /proc/stat
  total=$((a+b+c+idle))
  cpu=$((100*( (total-prevtotal) - (idle-previdle) ) / (total-prevtotal) ))
  echo ~/.config/tint2/executors/icons/indicator-cpufreq.svg
  #echo "$cpu%"
  printf "%03d%s" "$cpu" ; printf "%s\n" "%"

p.s. untested.

edit: Padding with spaces may also work (depending on font I guess):

cpu="5"
printf "%3s" "$cpu" ; printf "%s\n" "%"
  5%
printf "%-3s" "$cpu" ; printf "%s\n" "%"
5  %

Offline

#3 2024-03-22 03:27:16

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,008

Re: building margins or padding for a tint2 executor? (for CPU)

JasonMehmel wrote:

Let me know if that makes sense.

Make perfect sense.
Question:
1. Is your Tint2 horizontal?
2. does it cover the entire width of your screen?

If yes and no they not put a little 1 line conky in the space beside Tint2?

I use FB panel just for the tray and a 1line conky beside it, centred.
Nitrogen at max and conky bottom/centre
⁰ = average then the CPUs ¹ ² ³ & ⁴

I know it doesn't answer your 'executor' question but that conky of mine isn't hidden.


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#4 2024-03-22 16:28:37

JasonMehmel
Member
Registered: 2015-10-06
Posts: 186

Re: building margins or padding for a tint2 executor? (for CPU)

@brontosaurusrex

That first option works! It looks like those printf commands are making sure it displays the number in three consistent digits, so therefore it's never moving around?

One thing I didn't expect is that it adds a leading zero, so for example it'll show 030% instead of 30%.

My preference would be to hide that third digit unless it ever actually got up to 100, but I can sacrifice that preference for a stable reading!

(Actually, I just tried changing the printf "%03d%s" to printf "%02d%s", and it does look like it's giving me the stability I'm looking for.

And I don't know if I've ever seen my CPU read at an actual 100%, just 99% on those rare situations where a LOT is going wrong at once. So I think this works, thank you!)

Also,

I tried the padding options and there's still a little bit of 'bounce' every time it gets down to single zeros. I feel like a padding option would have to be something building a 'box' around the whole thing that wouldn't change size, with the graphic and text aligned (probably to the left) to avoid the bounce even inside the 'box.'


Fortune favours the bold.
ThinkPad T15 Gen 2i

Offline

#5 2024-03-22 16:37:42

JasonMehmel
Member
Registered: 2015-10-06
Posts: 186

Re: building margins or padding for a tint2 executor? (for CPU)

Sector11 wrote:
JasonMehmel wrote:

Let me know if that makes sense.

Make perfect sense.
Question:
1. Is your Tint2 horizontal?
2. does it cover the entire width of your screen?

If yes and no then why not put a little 1 line conky in the space beside Tint2?

I use FB panel just for the tray and a 1line conky beside it, centred.
Nitrogen at max and conky bottom/centre
⁰ = average then the CPUs ¹ ² ³ & ⁴

I know it doesn't answer your 'executor' question but that conky of mine isn't hidden.

It is horizontal, and it covers most of the width?

This is an entirely different solution, but I kind of love it. And it's a reminder of just how flexible conky can be!

I could totally see modifying my tint2 so I've got my system tray and program icons on the left and right, and leave a space in the centre for conky to do its thing!

When you say FB panel, is that something instead of tint2? Is that this over here? https://github.com/aanatoly/fbpanel

I'll check it out, especially if I can't get what I need out of tint2!

brontosaurusrex gave me a solution that satisfies the immediate need, but I'll make a note to try this when I've got some extra time to play with my system!


Fortune favours the bold.
ThinkPad T15 Gen 2i

Offline

#6 2024-03-23 13:11:31

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,008

Re: building margins or padding for a tint2 executor? (for CPU)

JasonMehmel wrote:

When you say FB panel, is that something instead of tint2? Is that this over here? https://github.com/aanatoly/fbpanel

brontosaurusrex gave me a solution that satisfies the immediate need, but I'll make a note to try this when I've got some extra time to play with my system!

Yes 'other' than tint2 it's a different panel and cannot run at the same time tint2 runs.
All I wanted was the tray, and I could never seem to get that working in tint2.

It's old and not in Debian 12 repos so I grabbed it from old stable - it still works.  I'm happy.

If you are satisfied with what brontosaurusrex did for you go with it.
He knows his stuff and is light years ahead of what I know!


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

Board footer

Powered by FluxBB