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

Closed
opened 2022-07-18 18:30:41 +00:00 by gmardom · 3 comments
gmardom commented 2022-07-18 18:30:41 +00:00 (Migrated from github.com)

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 :.

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](https://www.youtube.com/watch?v=3vQtovcQElY), 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 `:`.
budRich commented 2022-07-19 01:49:52 +00:00 (Migrated from github.com)

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

thanks for the report i will look into it. just to be sure what is your output of: `i3get -v`
budRich commented 2022-07-19 03:17:46 +00:00 (Migrated from github.com)

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.

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: ```JSON "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". ```text "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.
gmardom commented 2022-07-19 05:05:44 +00:00 (Migrated from github.com)

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 :)

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 :)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
bud/i3ass#174
No description provided.