Comments (11)
Hi @Airblader! I could have added a dynamic array of extra keys (I'm basically okay with dynamic allocation at load time, but not for runtime), I have to think a bit more about that (if it is worth it or not). About your fork, if it gets popular and have releases, I am willing to add support for extra i3-gaps-specific keys. In fact, someone already asked me to add this support for testing. See the gaps branch ;-)
from i3blocks.
In the meantime, I will warn on unknown values instead of erroring out.
from i3blocks.
Hi Vivien,
cool, thanks for your support! I really don't want to start my own releases on the fork, I simply keep it up to date with i3/i3, so the release cycle is "the same", though just more of a rolling release. I don't see a benefit in custom releases as I barely add any features to it :)
However, it's completely fine and acceptable that you don't want to "just add" it to your code base. Will the gaps
branch be maintained? That'd be good enough for me; otherwise I'd just fork it myself and keep it up to date (the commit is small enough to make maintenance managable :) ).
In the meantime, I will warn on unknown values instead of erroring out.
Are you talking about the master branch? I could totally live with that, too – I don't care about warnings. However, would you pass these values on to i3bar?
from i3blocks.
Ideally I think we all would like to factorize as much as possible, instead of maintaining many code bases. So if I could make i3blocks generic enough to support your use cases, I'd be glad to implement that.
Accepting extra keys and returning them as is might be ok. My only concern is the type, for instance distinguishing a number (e.g. border
) or a string (e.g. background
). But I guess considering any extra keys to be "string or number" (as it is for e.g. min_width
actually) is safe enough.
If you need an extra key to be a boolean, it's gonna be tricky. I will need to add something like a command line switch to specify new keys, e.g. i3blocks -k border -k background -k flag,bool
. Not sure the latter is worth it, but it isn't unfeasable.
from i3blocks.
Ah, the types – I didn't think of that. It wouldn't be an issue if i3blocks were to quote strings:
keyA="string value"
keyB=42
keyC=true
But that would be a breaking change now – unless you parse it like that only for unknown keys, which in turn is somewhat inconsistent. Parsing it that way could be an opt-in via command line flag, though, for example; that way it wouldn't affect users who don't need it.
Specifying arguments on the command like is possible, too, of course. You'd have to find a good syntax for that, though, that allows specifying name and type. Maybe something like --int-key <key>
, --string-key <key>
, --bool-key <key>
?
from i3blocks.
I like the idea behind your key{A,B,C}
example, this looks robust. The only thing I don't like for that is the annoying quote escaping that this may involve. That's what ini format was used for the config, to keep it as simple as possible. I'll add support for extra "number OR string" keys, then we'll see which option is the best.
from i3blocks.
It would be good enough for me right now for sure :) It's also a compatible change, so there wouldn't be any issues with it.
Thanks for all your support by the way!
from i3blocks.
(Sorry, accidentally hit the wrong button)
from i3blocks.
The dynamic properties are finally implemented in i3blocks master. That was fast!
i3blocks knows what string keys are expected by i3bar (e.g. "full_text"). For these string keys, i3blocks will quote their values, unless they already are. For unknown keys, values are sent as is to i3bar if they already are valid JSON values (i.e. true, false, null, a number or an already quoted strings), otherwise the value gets quoted. See the relevant bits for details. We should cover most cases this way!
from i3blocks.
@vivien Awesome work, thanks! Are there any release plans yet?
from i3blocks.
Thank you! I'm passing through all issue, small stuffs to implement here and there and I have to write a good documentation before releasing. It's gonna be soon in all cases.
from i3blocks.
Related Issues (20)
- Enable utf-8 string in i3blocks
- Persistent command does not actually persist HOT 3
- How do I tell i3blocks to refresh all blocks? HOT 2
- block freezing my status bar HOT 2
- battery regexp breaks with two batteries HOT 1
- `autogen.sh` Generates a `configure` File that Tries to Call Autoconf macro `PKG_CHECK_MODULES` HOT 1
- [Feature Request] Add ticker support
- I'm having trouble getting fixed-width strings to work on i3blocks. HOT 1
- Block's character will turn into "[" character after clicked and turn normal after sway is reloaded. HOT 1
- Can't use the config variable when running the script using i3-msg -q exec myscript HOT 4
- Simple way to display title of focused window in i3blocks HOT 2
- i3blocks does not show anything except datetime HOT 3
- dmenu hang when called from i3blocks with -fn option
- Battery regex in example doesn't handle 100% HOT 2
- Trouble with setting a label with emoji via the json format HOT 1
- Any script with a 'for' loop doesn't produce any output
- How to get back monochrome icons / emojis? Weird font issue!
- Question: is running a secondary command when clicking a button with an interval possible? HOT 1
- Change the color of borders from within a script
- If I launch a graphical program from a block and restart i3, the program dies even if disowned. HOT 2
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 i3blocks.