mirror of
https://github.com/JakeStanger/ironbar.git
synced 2026-07-11 07:15:19 +01:00
[GH-ISSUE #1065] ironbar var set: accept bigger values #3146
Labels
No labels
A:Build
A:CI
A:Client
A:Config
A:Core
A:Documentation
A:Documentation
A:IPC
A:Testing
A:UX/UI
blocked
BREAKING CHANGE
duplicate
good first issue
GTK4
help wanted
invalid
M:Battery
M:Battery
M:Bindmode
M:Bluetooth
M:Brightness
M:Cairo
M:Clipboard
M:Clock
M:Clock
M:Custom
M:Focused
M:Keyboard
M:Launcher
M:Menu
M:Music
M:Music
M:Music
M:Network Manager
M:Notifications
M:SysInfo
M:Tray
M:Volume
M:Workspaces
partially resolved
P:Critical
P:High
P:Low
P:Medium
pull-request
T:Bug
T:Bug
T:Core Enhancement
T:Module Enhancement
T:New Module
T:Question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
JakeStanger/ironbar#3146
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @postsolar on GitHub (Jun 24, 2025).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/1065
Is your feature request related to a problem? Please describe.
ironbar var set foo "$(printf '%965s' a)", seeokironbar var set foo "$(printf '%966s' a)", seeI understand this to mean I can't pass an argument this long for setting an Ironvar. I'm not well-versed in lower-level Linux details, from some googling it seems like it should be fine but for some reason it stops working after the 966th byte. I don't know if it's actually related to argument size, so don't mind the feature request labeling too much.
967 bytes isn't that much, I want a label (within a popup) with more than that.
Describe the solution you'd like
If it is in fact related to argument size, then it would be nice to have any of:
command-with-long-output | ironbar var set foocommand-with-long-output | ironbar var set foo -command-with-long-output | ironbar var set foo --from=/dev/stdinDescribe alternatives you've considered
Using
{{ script }}(necessarily inpollmode, aswatchwould only show the last line), but I'd prefer a different architecture for my use case.I have a long-running service that does a lot of things related to Hyprland, among them setting some Ironvars. It's simple and centralized to this service, feels nicer and easier to manage this way.
Additional context
@postsolar commented on GitHub (Jun 24, 2025):
In case issue description is too messy, here's a sum-up:
labelwidget with an ironvarironbar var set that-var some-long-textscriptor when the label has a static value. It only fails when it's a var set via the IPC and value is long.@JakeStanger commented on GitHub (Jun 24, 2025):
I suspect this is a nice and simple fix. The IPC buffers have a capacity of 1024 bytes, which I guess doesn't grow as its passed as a slice.
github.com/JakeStanger/ironbar@d45eb2a69a/src/ipc/server/mod.rs (L85-L86)github.com/JakeStanger/ironbar@d45eb2a69a/src/ipc/client.rs (L27-L28)I think using
read_to_endis probably a better fit here:https://docs.rs/tokio/latest/tokio/io/trait.AsyncReadExt.html#method.read_to_end
@JakeStanger commented on GitHub (Jun 24, 2025):
Regarding your initial request, this can be achieved directly through a clap library:
https://docs.rs/clap-stdin/latest/clap_stdin/
Alternatively it should be easy enough to look for a
-value and lock stdin manually without it...@postsolar commented on GitHub (Jun 24, 2025):
I tried using
read_to_endand it works but I don't know how to add EOF signal to close the stream, so CLI hangs until Ctrl-C.@JakeStanger commented on GitHub (Jun 24, 2025):
Hm, I feel like I'm missing something obvious.
I wonder if calling
shutdownon the write stream will do that as desired? Not sure if it'll do that and then also cut off the read streamhttps://docs.rs/tokio/latest/tokio/io/trait.AsyncWriteExt.html#method.shutdown
EDIT: The server is already doing that on response. The client isn't though, since the socket is re-used. Not sure without getting a chance to test...
@postsolar commented on GitHub (Jun 24, 2025):
Yeah ChatGPT suggested this too 😅. I tried adding it to client as well, didn't help. Also tried not splitting the stream in the server's code, because there's something in tokio docs implying caveats, but this didn't help either.
@JakeStanger commented on GitHub (Jun 24, 2025):
Fixed by using aBufReaderon the server/client. Since the JSON message is always one line, it's possible to append a\nand then read until the first\n.Nevermind. It kinda works, and then jams up after a while :/
@JakeStanger commented on GitHub (Jul 14, 2025):
Turns out it jammed up because I've got a systemd timer setting variables on a script, and that was using a version of Ironbar without the fix and it didn't like the mismatch...
Fix incoming!
@postsolar commented on GitHub (Jul 14, 2025):
Thank you for fixing this! Now my submap hints fit into the message 😎