Comments (20)
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.
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.
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.
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.
I think failing silently would fix a lot of things across the board.
from i3status-rust.
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.
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.
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.
@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.
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.
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.
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.
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.
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.
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.
I believe this can now be avoided by setting device = "DisplayDevice"
with UPower. Is this incorrect?
from i3status-rust.
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.
Ok, so I guess it’s not a fix, then.
from i3status-rust.
Hi, I would like to contribute a patch for this issue. What is the conclusion of the community?
from i3status-rust.
Could the solution be something like hide_missing in the net block?
from i3status-rust.
Related Issues (20)
- new privacy block seems to create some instability when switching on and off display outputs HOT 1
- new privacy block causes i3status-rs to be unstable in some conditions, especially when gamescope and certain games are launched HOT 1
- feature: add `format_alt` and `format_list` to all blocks HOT 3
- Wrong icons in sound block HOT 5
- Upgrading an old configuration to later i3status-rust versions HOT 6
- Typo in GitHub repository About description, "resourcefriendly" should be "resource-friendly"
- How to hide sound blocks for devices that are not present? (bluetooth/USB headsets, etc) HOT 4
- .Xresources color definition import? HOT 2
- Feature: Add support for non sway/i3 wayland compositors HOT 1
- amd_gpu: improve the error when a device does not exist HOT 3
- Implement format_alt for sound block HOT 4
- Battery block not showing battery percentage HOT 1
- `headphones_indicator` set to `true` doesn't show when headphones are connected HOT 12
- eng formatter: support prefixes in the range argument
- `sound`: Make the warning status when muted configurable HOT 2
- Request: DNS information to network block HOT 7
- keyboard_layout span colors HOT 2
- Revert empty battery state to charging when plugged in
- Net Block placeholder issue
- Zero division HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from i3status-rust.