You are not logged in.

#1 2017-04-13 01:58:40

leepicmaymay
Member
Registered: 2017-04-13
Posts: 1

i3 saved layout placeholder not working

Hi all,

I have a problem with my i3 JSON layout configuration as it does not work at startup. I am trying to make 3 windows open at startup in my first workspace. The left-side of the layout will open ranger and newsbeuter (splitv) and the right-side will just open my terminal. All three windows are successfully executed at startup however they are laid out in a splith configuration: my JSON configuration is effectively unused.

When I do login to Arch I receive an i3 error message (top row appears) and the JSON segment of my i3 config is underlined in the "show errors" window.

I think the problem is within the JSON config as shown below. I believe my placeholders may not have the required specificity to function. I've tried to use xprop for the applications in question but I cannot determine any unique identifiers for these windows.

// vim:ts=4:sw=4:et
{
    // splitv split container with 2 children
    "border": "normal",
    "floating": "auto_off",
    "layout": "splitv",
    "percent": 0.5,
    "type": "con",
    "nodes": [
        {
            "border": "normal",
            "current_border_width": 2,
            "floating": "auto_off",
            "geometry": {
               "height": 654,
               "width": 484,
               "x": 0,
               "y": 0
            },
            "percent": 0.5,
            "swallows": [
               {
               "class": "^UXTerm$",
               "instance": "^ranger$",
               //"title": "^ranger$",
               // "transient_for": "^$"
               }
            ],
            "type": "con"
        },
        {
            "border": "normal",
            "current_border_width": 2,
            "floating": "auto_off",
            "geometry": {
               "height": 654,
               "width": 484,
               "x": 0,
               "y": 0
            },
            //"name": "newsbeuter: 32 unread articles within 2 unread feeds",
            "percent": 0.5,
            "swallows": [
               {
               "class": "^UXTerm$",
               "instance": "^newsbeuter",
               //"title": "^newsbeuter$",
               // "transient_for": "^$"
               }
            ],
            "type": "con"
        }
    ]
}

{
    // splith split container with no children
    "border": "normal",
    "current_border_width": 2,
    "floating": "auto_off",
    //"layout": "splith",
    "geometry": {
       "height": 654,
       "width": 484,
       "x": 0,
       "y": 0
    },
    "percent": 0.5,
    "swallows": [
       {
       "class": "^UXTerm$",
       //"instance": "^right$",
         // "transient_for": "^$"
       }
    ],
    "type": "con"
}

Also of interest is the code that I've implemented in the i3 config to startup my JSON config after loggin in to Arch.

exec --no-startup-id "i3-msg 'workspace $workspace1; append_layout ~/.config/i3/ws_1-config.json'"
exec --no-startup-id "i3-msg workspace $workspace1; exec ranger"
exec --no-startup-id "i3-msg workspace $workspace1; exec newsbeuter"
exec --no-startup-id "i3-msg workspace $workspace1; exec xterm"

I've looked through every single forum post on this issue and unfortunately I haven't found a fix. Any advice or tips would be much appreciated.

Offline

#2 2017-04-13 11:34:30

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,494

Re: i3 saved layout placeholder not working

Did not try your config. You don't need i3-msg to execute your app,

#exec  --no-startup-id xterm ; workspace $space2

Offline

#3 2017-04-24 08:41:10

raalraan
Member
Registered: 2017-04-24
Posts: 1

Re: i3 saved layout placeholder not working

Hello, did you solve your problem yet?

In case you haven't or someone else comes here with the same problem: when you uncommented the "swallows" rules you also need to remove the comma from the last line you uncommented in every "swallows" section. That means you have to remove the comma from the "instance" line for the two first windows and from the "class" line in the first window.

Applications that run inside a terminal require you to also run the terminal. In the case of newsbeuter in xterm this is done as

xterm -e newsbeuter

then your i3 config should say something like

exec --no-startup-id xterm -e newsbeuter

You don't need to specify the workspace for the window, the latter will be swallowed by the placeholder.

Greetings

Last edited by raalraan (2017-04-24 16:53:04)

Offline

Board footer

Powered by FluxBB