You are not logged in.

#1 2016-01-20 18:01:58

mtcliatt
Member
Registered: 2016-01-15
Posts: 4

[i3] can not load saved workspace layouts

I'm using i3 v4.11 and I'm trying to use the tool i3-save-tree to save a layout I like to use, but I get an error while trying to load the saved .json file.

My syntax for saving the file:

i3-save-tree --workspace 1 > ~/.i3/codeLayout.json

My syntax for loading the file:

i3-msg "workspace 1; append_layout ~/.i3/codeLayout.json"

The error that occurs:

ERROR: Your command: (null)
ERROR:               (null)
ERROR: Could not determine the contents of "/home/dragonair/.i3/codeLayout.json".
[{"success":true},{"success":false,"error":"Could not determine the contents of \"/home/dragonair/.i3/codeLayout.json\"."}]

I read the docs for saving layouts here: https://i3wm.org/docs/layout-saving.html
And I know that I have to edit the json file before it will work, but I get the same error when I try to use the demo layout on the i3 docs and when I try to use my un-edited file.

And I really didn't understand the swallowing concept, I would be very grateful if someone could explain that.

The layout I am saving/loading: http://pastebin.com/F9tdTRN9
The demo layout on i3-docs: http://pastebin.com/kgu1nGDD

Thanks for your help!

Offline

#2 2016-01-21 06:45:47

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: [i3] can not load saved workspace layouts

Moving to "Applications & Desktop Environments".

Offline

#3 2016-01-21 11:28:42

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

Re: [i3] can not load saved workspace layouts

Hi, the workspace.json file only acts as a placeholder. The window you open in the placeholder, say Xterm, get swallowed by the placeholder.
Meaning, this json file only creates the framework in which the windows will be opened. So, after opening the json file, you still need to open the windows, which will then be opened in the placeholders place, (swallowed)
When I was creating this for myself I know it was a bitch to get it right.
My suggestion is that you start with a somewhat simpler layout than the one you use right now.
Here's a simple layout, it will open 3 Xterm windows, one in the placeholder on the left, two in a vertical split on the right

// vim:ts=4:sw=4:et
{
    "border": "pixel",
    "floating": "auto_off",
    "geometry": {
       "height": 1057,
       "width": 1918,
       "x": 0,
       "y": 21
    },
    "name": "Xterm",
    "percent": 0.64,
    "swallows": [
       {
       "class": "^XTerm$",
       "instance": "^xTerm$",
       "title": "^"
       }
    ],
    "type": "con"
}

{
    // splitv split container with 2 children
    "border": "pixel",
    "floating": "auto_off",
    "layout": "splitv",
    "percent": 0.36,
    "type": "con",
    "nodes": [
        {
            "border": "pixel",
            "floating": "auto_off",
            "geometry": {
               "height": 354,
               "width": 644,
               "x": 0,
               "y": 0
            },
            "percent": 0.5,
            "swallows": [
               {
               "class": "^XTerm$",
               "instance": "^xterm$",
               "title": "^"
               }
            ],
            "type": "con"
        },
        {
            "border": "pixel",
            "floating": "auto_off",
            "geometry": {
               "height": 354,
               "width": 644,
               "x": 0,
               "y": 0
            },
            "percent": 0.5,
            "swallows": [
               {
               "class": "^XTerm$",
               "instance": "^xterm$"
               }
            ],
            "type": "con"
        }
    ]
}

edit: I forgot to explain the measement, I have a 1920x1080 monitor a 21 pixel topbar a 1 pix border = 1918x1057, but will open up in a smaller monitor equally due to percent usage.

Last edited by qinohe (2016-01-21 12:49:18)

Offline

Board footer

Powered by FluxBB