Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[i3get] title is not being printed if it contains ":" #174

Closed
gmardom opened this issue Jul 18, 2022 · 3 comments
Closed

[i3get] title is not being printed if it contains ":" #174

gmardom opened this issue Jul 18, 2022 · 3 comments

Comments

@gmardom
Copy link

gmardom commented Jul 18, 2022

I recently watched your video on custom title module for polybar and when I run i3get -r t, it didn't work on the browser tab with your video, but worked on anything else.
I tried to investigate by testing i3get with bunch of random symbols but it seems that it only doesn't work with :.

@gmardom gmardom changed the title [i3get] title is not beeing printed if it contains ":" [i3get] title is not being printed if it contains ":" Jul 18, 2022
@budRich
Copy link
Collaborator

budRich commented Jul 19, 2022

thanks for the report i will look into it. just to be sure what is your output of: i3get -v

@budRich
Copy link
Collaborator

budRich commented Jul 19, 2022

i managed to reproduce the issue and i think i have found a fix.
in the JSON the title is fetched from the name property and the raw json looks something like this:

"geometry":{"x":0,"y":0,"w":0,"h":0},"name":"cool title:with colon","title_format":"..."

I parse with AWK simply by splitting records on "," and fields on ":" and i always assume(d) the name of the property is the second to last field.. Usually that is the first field. But sometimes like with "geometry", the second to last field is "x".

"geometry":{"x":0
"y":0
"w":0
"h":0}
"name":"cool title:with colon"
"title_format":"..."

But if the title has a colon, "name" will not be the second to last key, and it was ignored. I fixed it now and applied the same fix to "title_format" (i3get -r o) which have the same issues.

budRich added a commit that referenced this issue Jul 19, 2022
Fix for #174

Since we split fields : this messed up the assumptions of the relevant property
("name":) being the second to last field.
@gmardom
Copy link
Author

gmardom commented Jul 19, 2022

Sorry for the late response but I just woke up...

Here's an i3-get -v output (sorry for not including):

i3get - version: 0.8
updated: 2022-05-21 by budRich

I'm using the aur version of i3ass.

i managed to reproduce the issue and i think i have found a fix.

Glad to hear that :)

@gmardom gmardom closed this as completed Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants