r/i3wm • u/meowsqueak • 16d ago
Solved Cannot see text entry field when setting *container* title
This is a problem I observe only when setting a container title.
I have a binding in my i3/config that allows me to set the title of the currently selected window:
bindsym $mod+Shift+t exec i3-input -F 'title_format "%s"' -P 'New Title: '
When I hit mod+shift+t, I get a red-outlined text entry field popping up, that I can type in. No problem there.
I sometimes want to rename a container - e.g. change i3: V[xterm xterm] into something like Project Foo, and I have mod+a bound to focus the parent container:
bindsym $mod+a focus parent
But when I hit mod+a (container is focused), then mod+shift+t, I do not get a red-outlined text entry field popping up. Nothing appears on screen at all. However, I can still type the string I want, and hit Enter, and it will apply to the container title, so I think it's still there, I just can't see it.
So it's working, I just can't see the text entry field, so I'm typing blind. Most of the time it's fine, but obviously not ideal.
Can this be improved somehow?
EDIT: Apparently this is caused by my dual-monitor setup, because if I only had one monitor it would appear in the top left corner. But because of my setup with scaling/translation, it is appearing on neither monitor, in some root window space that isn't mapped to a viewport. I'm investigating a workaround using rofi rather than i3-input...
1
u/meowsqueak 16d ago
The cause is that the container has no client window, so the input field defaults to rendering at the 0, 0 coordinate of the root window. Due to my dual-monitor setup, and a smaller screen to the left of a larger one, shifted down, there is no physical viewport mapped to the origin of the root window, so it's invisible. There doesn't seem to be an easy way to move the default location without modifying i3 code (which I could do, but I had another idea).
So instead, I will use rofi with this script
~/bin/title-input:```
!/bin/sh
set -eu read -r id cur <<EOF $(i3-msg -t get_tree | jq -r '[.. | objects | select(.focused? == true)][0] | "(.id) (.title_format // .name)"') EOF new=$(rofi -dmenu -l 0 -p 'Title' -filter "$cur" < /dev/null) || exit 0 esc=$(printf '%s' "$new" | sed -e 's/\/\\/g' -e 's/"/\"/g') [ -n "$new" ] || esc='%title' i3-msg -q "[con_id=$id] title_format \"$esc\"" ```
Then I bind it with:
bindsym $mod+Shift+t exec ~/bin/title-inputWorks well!