GithubHelp home page GithubHelp logo

Comments (20)

mredaelli avatar mredaelli commented on August 14, 2024 3

Alternatively, or even better, in addition, a for-hosts option for all blocks, interpreted as a regexp, and then the block is shown only if the hostname matches the regexp.

from i3status-rust.

mredaelli avatar mredaelli commented on August 14, 2024 2

I agree: simply allowing to specify per-block an on-fail behaviour (giving the three options "fail all bar", "leave empty", "show constant string") would be perfect (and I would personally put option three as default for all blocks).
I would prefer not to have only hide or only ×.
Hide is useful because for instance for disk space: I might put all my "normal" mountpoints in all my PCs, so that those that don't exist in one machine simply don't show up.
× instead would be good for "extraordinary" mountpoints, like USB keys or fuse stuff.

from i3status-rust.

svmnotn avatar svmnotn commented on August 14, 2024 1

It would be nice to provide a way to do this without an external shell script. I believe @greshake had an idea about this with "profiles" or something.

from i3status-rust.

greshake avatar greshake commented on August 14, 2024 1

Yea... At first I assumed this is a rather rare issue but now I'll consider moving to a solution for this more quickly. I still have not decided which solution makes sense; There are elegant solutions (e.g. profiles) that fix this but require significant implementation effort and I fear overcrowding the project with features that solve rare use cases and thereby diminishing maintainability in the long run.

from i3status-rust.

burdickjp avatar burdickjp commented on August 14, 2024 1

I think failing silently would fix a lot of things across the board.

from i3status-rust.

bbuccianti avatar bbuccianti commented on August 14, 2024 1

I'm using a one liner awk program in a custom block like this.

[[block]]
block = "custom"
command = "upower -i $(upower -e | awk /BAT/) | awk '/percentage/ {bat = $2} END {print (length(bat) == 0) ? "AC" : bat}'"
interval = 10

Maybe someone find it useful waiting for a fix.

from i3status-rust.

AkechiShiro avatar AkechiShiro commented on August 14, 2024 1

Is there any chance for one of the PR #585 or #233 to be merged in master or are they currently incomplete somehow or have issues ? (the single check passes for both completely)

from i3status-rust.

burdickjp avatar burdickjp commented on August 14, 2024

Here's a solution using a shell script to generate the config conditionally from templates:
https://faq.i3wm.org/question/1367/anyway-to-include-in-config-file/%3C/p%3E.html

from i3status-rust.

uinput avatar uinput commented on August 14, 2024

@greshake Has there been any progress on this? What about adding an option for the blocks to silently fail? Users could specify the battery block to not render if the battery was not found.

from i3status-rust.

uinput avatar uinput commented on August 14, 2024

I think the same issue applies to the backlight block. I thought about implementing a fail_silently = True option for those. Do you think that would suffice for our use case?

from i3status-rust.

atheriel avatar atheriel commented on August 14, 2024

I think we could implement something similar to the Weather block fallback. That is, we show an × when the battery appears to be missing. I'd prefer this to hiding the block, because otherwise users with errors/typos in their configurations will be confused when the block is simply missing. An × provides some visual feedback to those users.

from i3status-rust.

atheriel avatar atheriel commented on August 14, 2024

In addition, this would be a pretty easy change to make, because the battery device already returns Result<T> for its sysfs queries.

from i3status-rust.

uinput avatar uinput commented on August 14, 2024

That would permanently take unused space in case there is no battery/backlight. An explicit hint for users about what the option fail_silently does shouldn't lead to such problems, I think.

from i3status-rust.

uinput avatar uinput commented on August 14, 2024

As for the implementation, what about returning a SilentError when the block is initialized? That way we could completely remove the block, saving computation time.

from i3status-rust.

uinput avatar uinput commented on August 14, 2024

Another approach would be to support includes in the configuration. That would allow for making separate configurations without code duplication. Also, include statements for configurations help having a clean configuration overall.

from i3status-rust.

atheriel avatar atheriel commented on August 14, 2024

I believe this can now be avoided by setting device = "DisplayDevice" with UPower. Is this incorrect?

from i3status-rust.

bbuccianti avatar bbuccianti commented on August 14, 2024

I tried to use device = "DisplayDevice" with UPower but when I have my battery unplugged I get the error Error in block 'battery': UPower device is not a battery.

from i3status-rust.

atheriel avatar atheriel commented on August 14, 2024

Ok, so I guess it’s not a fix, then.

from i3status-rust.

itsfarseen avatar itsfarseen commented on August 14, 2024

Hi, I would like to contribute a patch for this issue. What is the conclusion of the community?

from i3status-rust.

PhilipConte avatar PhilipConte commented on August 14, 2024

Could the solution be something like hide_missing in the net block?

from i3status-rust.

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.