Giter Club home page Giter Club logo

Comments (21)

vKnmnn avatar vKnmnn commented on July 19, 2024 1

if you know your the maximum width that your traffic block puts out, and can spare a few pixels of your bar, you can add something to the block config to get rid of that behaviour, like i did for my clock, which kept realining the whole thing every minute at 11 seconds..
The line you need to add to your block in i3blocks.confis min_width="22:22:22" and resetting that string to that very long output of your traffic e.g. "22MB/s" should get rid of that nuisance.

from i3blocks.

vKnmnn avatar vKnmnn commented on July 19, 2024 1

alright. so i will find a command which output tells me, that wifi is disconnected. i'll check that variable in the beginning of the script, and just let the block exit without giving any output. that way, the block should disappear.

are you using wireless? wireless only or do you use both wifi and LAN
?

from i3blocks.

vKnmnn avatar vKnmnn commented on July 19, 2024 1

alright. just add this right after the first if-clause.

if  [[ "${INTERFACE}" = "" ]]; then
        exit
fi

the first if-clause checks, whether you can reach googles dns server 8.8.8.8.
If you can't, the variable INTERFACE will be an empty string.

in this if clause, we check, if the string really is empty, and if it is, we just kill the script, so it will not output anything else.
have fun with it.

from i3blocks.

Anachron avatar Anachron commented on July 19, 2024

That's right, how would you suggest to fix this issue?

from i3blocks.

ralphee avatar ralphee commented on July 19, 2024

@vKnmnn epic will test in the morning... 😎

working like a charm

from i3blocks.

vKnmnn avatar vKnmnn commented on July 19, 2024

Nice. As a side note:
When you open an issue on someones scripts, made in their own spare time, you may want to address the issue in a nicer tone than you did here. That way you will more likely receive a positive answer.
Cheers.

PS: you should close the issue, when the problem has been fixed.

from i3blocks.

ralphee avatar ralphee commented on July 19, 2024

@vKnmnn chief...i didnt open the issue ...nonetheless it was driving my ocd into overdrive so thxs for the tip...greatly appreciated..

from i3blocks.

vKnmnn avatar vKnmnn commented on July 19, 2024

My apologies to you then, @ralpheee88, I was not paying attention to the names. Have a nice one

from i3blocks.

ralphee avatar ralphee commented on July 19, 2024

@vKnmnn chief ...can you pls confirm with the minimum width for the bandwidth block the auto hide feature does not work when there is no connection?

from i3blocks.

vKnmnn avatar vKnmnn commented on July 19, 2024

sorry, what do you want to know?
i just enabled the bandwidth block, instance=down, min_width="______" and disconnected from wifi. the block stays where it is and the min_width setting is still respected. what behavior do you expect?

from i3blocks.

ralphee avatar ralphee commented on July 19, 2024

@vKnmnn thxs for testing!!! I could be mistaken but if there is no internet connection and min width is not set i believe there should be an auto hide function...(hope that makes sense)

(the minimum width makes the notifications persistent)

from i3blocks.

vKnmnn avatar vKnmnn commented on July 19, 2024

Do you want the block to disappear, when you are disconnected from wifi?
Or do you want the block to disappear, when it shows 0b? (which might happen, even when you are connected)
The min_width setting has nothing to do with this.

from i3blocks.

ralphee avatar ralphee commented on July 19, 2024

@vKnmnn yeah ideally i would like the block to disappear when there is inactivity after a few seconds

from i3blocks.

vKnmnn avatar vKnmnn commented on July 19, 2024

that would probably take some rewriting. since i'm not using the bandwith block, i won't do it for you, but scripting is not that hard, so you could learn it yourself.
realistically, the throughput of a network interface doesn't stay at 0 for long, at any time, anyways. You should be able to see that in your block.
Making the block disappear, on disconnect is rather easy. would you like help with that?

from i3blocks.

vKnmnn avatar vKnmnn commented on July 19, 2024

you see, the block script is run every second, so it is hard to keep track on how long throughput has been zero

from i3blocks.

ralphee avatar ralphee commented on July 19, 2024

@vKnmnn thxs for the insight! making the block disappear on disconnect would be a good compromise. If and whenever you have time your help would be greatly appreciated!

from i3blocks.

ralphee avatar ralphee commented on July 19, 2024

@vKnmnn cant thank you enough...ironically i like to have a clean status bar

from i3blocks.

vKnmnn avatar vKnmnn commented on July 19, 2024

which device are you running the blocks on? wireless, wired or both? i need to know which ones. they go by names like wlp2s0 (wireless) enp0s3 (wired).
(find out with ip link)

from i3blocks.

ralphee avatar ralphee commented on July 19, 2024

@vKnmnn wlp4s0 & enp0s31f6

from i3blocks.

ralphee avatar ralphee commented on July 19, 2024

Superstar...will have a crack and let you know...

really small glitch... when not connected it shows one output/input of the block (not sure which one)

imgur-2017_09_15-08 55 04

My apologies ...i had a typo...its working beautifully...Thxs!!!

from i3blocks.

vKnmnn avatar vKnmnn commented on July 19, 2024

gonna close this

from i3blocks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.