The i3 FAQ has migrated to https://www.reddit.com/r/i3wm/. All content here is read-only.
Ask Your Question
1

Spawn placeholder

asked 2015-07-27 20:35:27 +0000

gerw gravatar image

updated 2015-07-28 05:06:24 +0000

i3convert gravatar image

Is it possible to spawn a (specific) placeholder exactly at the position at which a new window would spawn?

Currently, I used

i3-msg append_layout file

with file being

{
"name": "aa",
    "swallows": [
       {
          "class": "bb",
          "instance": "cc"
       }
    ],
    "type": "con"
}

However, this window spawns at the top-node of the workspace (i.e. on the very right/bottom).

Maybe there is another possibilty to create those handy placeholder windows?

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
2

answered 2015-07-28 07:24:55 +0000

gerw gravatar image

One can simply use

i3-msg "workspace dummy; append_layout file; focus child; move window to workspace back_and_forth; workspace back_and_forth"

Here, dummy is a workspace which is not used elsewhere. The only drawback seems to be that this command changes back_and_forth.

edit flag offensive delete link more

Comments

Nice idea. You can of course fix the drawback by moving to the previous workspace first and saving its name.

i3convert gravatar imagei3convert ( 2015-07-28 12:47:54 +0000 )edit
1

answered 2015-07-28 04:45:48 +0000

i3convert gravatar image

updated 2015-07-28 04:56:16 +0000

Let me sketch a possible solution (assuming that “aa” is a unique name). First, move the layout window to the scratchpad automatically by adding the following line to the config file:

for_window [title="^aa$"] move scratchpad

Next write a script that places the placeholder as follows. First it should issue the append_layout command. Then it should wait for the layout window to be opened (you can subscribe to i3 events, which I won't go into, or use an ugly solution that waits in loop and checks every, say, 0.01s whether the window has been opened). When it has been opened, it should issue two commands:

  • [title="^aa$"] scratchpad show to show the layout window.
  • floating disable to make it tiling in the current position.
edit flag offensive delete link more

Comments

Thank you for your valuable input. By playing around with your suggestion, I have found an easier solution.

gerw gravatar imagegerw ( 2015-07-28 07:22:38 +0000 )edit

Question Tools

1 follower

Stats

Asked: 2015-07-27 20:35:27 +0000

Seen: 101 times

Last updated: Jul 28