dflock / ulauncher-window-switcher

Linux/X11 Window Switcher plugin for Ulauncher
GNU General Public License v3.0
14 stars 10 forks source link

Parse workspace name when geometry is unavailable #7

Closed furgerf closed 2 years ago

furgerf commented 3 years ago

The workspace information contains one column fewer when the workspace geometry is unavailable, which previously broke the retrieval of the workspace name.

The name should now be retrieved correctly in both cases and with an arbitrary number of spaces between the columns of wmctrl -d.

furgerf commented 3 years ago

Forgot to link issue #2

furgerf commented 2 years ago

Hi @dflock would you mind having look at this when you have a moment? :)

dflock commented 2 years ago

I'm very sorry for leaving this for so long!

Thank you for your patch - I'm now working on this.

Does running this command correctly produce a list of workspace names for you?:

$ wmctrl -d | awk -F'  ' '{print $NF}'

I think this should work in both cases - geometry or not. Only edge case would be where the user has two spaces in a workspace name.

dflock commented 2 years ago

OK, so I think this fixes that edge case:

$ wmctrl -d | sed -n -E -e 's/^.*WA: (N\/A|.,. [[:digit:]]+x[[:digit:]]+)  //p'
furgerf commented 2 years ago

Awesome! That's neat, and also good that it doesn't rely on not having two spaces in a WS name. I used your sed script with the original code and that indeed works for me as well.

dflock commented 2 years ago

Thank you very much for your help in fixing this issue - and for your patience!