davatorium / rofi

Rofi: A window switcher, application launcher and dmenu replacement
https://davatorium.github.io/rofi/
Other
13.06k stars 608 forks source link

[BUG] window mode alignment issue with i3 scratchpad windows #1209

Closed infokiller closed 3 years ago

infokiller commented 3 years ago

Version

Output of rofi -v: Version: 1.6.0

Configuration

Output of rofi -help (in a gist, please paste the full output): https://gist.github.com/infokiller/c27758987dc51c929aff2cd49c1d4d49

Launch Command

The commandline used to launch **rofi**: rofi -no-config -show window

Steps to reproduce

What behaviour you see

The columns of lines of scratchpad windows are not aligned:

image

What behaviour you expect to see

Workaround

Using this setting in my xresources file fixes the issue, though it also adds a lot of space after the desktop name in the entries:

rofi.window-format:               {w}\011{c} {t}

Note that \011 is interpreted as a tab character by xrdb [1].

[1] https://jlk.fjfi.cvut.cz/arch/manpages/man/XrmGetDatabase.3#FILE_SYNTAX

DaveDavenport commented 3 years ago

There is already a working solution for this, in window format you can set the length of each element, see manpage.

This is what I use (in my config.rasi):

window-format: "{w:20} {c:-40} {t}";

It will pad w to 20 char width.

infokiller commented 3 years ago

Using rofi -window-format '{w:20} {c:-40} {t}' -show window still results in the alignment issue above. Am I missing something?

DaveDavenport commented 3 years ago

hmm under i3 I get no alignment issue for the workspace .. (and I have scratchpad windows)

DaveDavenport commented 3 years ago

image

do you use monospace font? (I assume so, it called mono :D)

infokiller commented 3 years ago

Haha yup, it should be monospace. One thing that is odd in my setup is that the workspace names have unicode zero width chars in them (it's an implementation detail of i3-workspace-groups). For example, a workspace can be named '1:\u200bgroup\u200b\u200b:1'. If you execute printf '1:\u200bgroup\u200b\u200b:1' in bash/zsh you'll notice that it only shows as 1:group:1 because the unicode zero width char is not rendered. However, the scratchpad workspace name is not modified in any way. Could that be the issue?

DaveDavenport commented 3 years ago

Yeah, that could be the issue. It uses 'g_utf8_strlen' to count chars, and that will most likely count them and screw up alignment.

Not sure how to solve this.

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.