The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
4

How can I change the position of i3-input prompt?

asked 2014-06-10 04:12:17 +0000

montiainen gravatar image

I have four monitors, and regardless of the active workspace, i3-input prompt always opens up on top left monitor. Why is it so, since it hasn't even been defined as primary monitor? Is it possible to re-position it?

edit retag flag offensive close merge delete

4 answers

Sort by ยป oldest newest most voted
4

answered 2014-06-10 07:04:00 +0000

Adaephon gravatar image

updated 2015-10-08 06:30:06 +0000

TL;DR

You cannot without changing the source code.


The position of the i3-input window is hardcoded to geometry 500x(fontheight+8)+50+50. That means upper left corner of the virtual screen spanning all displays. There are no configuration or command line options that allow changing that.

As far as I can tell, it is not mapped in the i3 window tree (i3-msg -t get_tree). Therefore it cannot be moved to a specific workspace or output with i3 commands. It even will remain visible if the workspace on the display, on which it is displayed, is changed.

While the window could theoretically be moved with xdotool, it does not have a title or window class, which could be used to reference the window.

At the moment, if you really want to change the position you can do so only in the source code in i3-input/main.c, search for "dimensions":

50, 50, 500, font.height + 8, /* dimensions */

Even better would be if you could give the window a name, so that it can be found with xdotool or similar programs. Maybe you could even submit a patch for that.

Update version 4.11

As of version 4.11 the placement of the i3-input window is improved. While still not configurable the i3-input window now appears inside the currently focused window.

edit flag offensive delete link more

Comments

Based on your answer I made a [patch](http://cr.i3wm.org/patch/570) using my very limited C know-how. It seems to be working: #!/bin/sh xdotool search --sync test windowmove 1000 1000 & i3-input -n test , prompt opens up on different location. Thank you very much for your fine answer!

montiainen gravatar imagemontiainen ( 2014-06-11 06:15:19 +0000 )edit

I don't have enough karma to post links.

montiainen gravatar imagemontiainen ( 2014-06-11 06:21:23 +0000 )edit
0

answered 2015-05-19 14:52:03 +0000

GenghisKen gravatar image

Zenity++. I put the renaming logic into a script, enhanced to maintain the workspace number:

#! /bin/bash
#
# Script to prompt to rename the current workspace.
#
# Cadged from
#  https://faq.i3wm.org/question/3936/how-can-i-change-the-position-of-i3-input-prompt/
#
WSNUMBER=$(ruby -rjson -e 'puts(JSON.parse(`i3-msg -t get_workspaces`).find { |ws| ws["focused"] }["num"])')
NEWNAME="`zenity --entry --text 'Rename workspace to: '`"
if [[ ! "${NEWNAME}" =~ ^[0-9]+: ]] ; then
    NEWNAME="${WSNUMBER}:${NEWNAME}"
fi
i3-msg "rename workspace to \"${NEWNAME}\""
edit flag offensive delete link more

Comments

In case you don't know: with the next release of i3, the i3-input window will be positioned at the currently focused window.

Airblader gravatar imageAirblader ( 2015-05-19 15:49:50 +0000 )edit
0

answered 2015-05-08 09:46:14 +0000

My workaround is using zenity + i3-msg

As an exmaple for renaming workspace, instead of:

bindsym $mod+Shift+A exec i3-input -F 'rename workspace to "%s"' -P 'New name: '

I use:

bindsym $mod+Shift+A exec i3-msg rename workspace to `zenity --entry --text "Rename workspace to:"`
edit flag offensive delete link more
0

answered 2015-05-27 14:03:23 +0000

gurkensalat gravatar image

updated 2015-05-27 14:18:26 +0000

To answer the question directly, it is possible to reposition i3-input using xdotool with a short delay (in this case 0.1s):

#!/bin/bash
i3-input "$@" &
pid=$!
sleep 0.1
xdotool getwindowfocus windowmove 500 500
# xdotool getwindowfocus windowmove $(($RANDOM%1420)) $(($RANDOM%1060))
wait $pid
edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-06-10 04:12:17 +0000

Seen: 812 times

Last updated: Oct 08