3

I have read over this link which is almost the exact same problem I am having.

The solution provided simply links the documentation to i3's layout saving capability. I find the section on restoring the layout to be a bit vague and not very helpful.

I have the following at the end of my config file:

# restoring layouts
exec --no-startup-id i3-msg "workspace 3; append_layout /home/spanishgum/.config/i3/ws3.json"

# setting applications for layouts
exec --no-startup-id i3-msg "workspace 3; exec gnome-terminal -e 'tty-clock -s -b -c 6 -C -f %F'"
exec --no-startup-id i3-msg "workspace 3; exec gnome-terminal -e 'newsbeuter -u /home/spanishgum/.rssfeeds'"
exec --no-startup-id i3-msg "workspace 3; exec gnome-terminal -e 'htop'"

This is my saved layout in /home/spanishgum/.config/i3/ws3.json:

// vim:ts=4:sw=4:et
{
    "border": "pixel",
    "current_border_width": 0,
    "floating": "auto_off",
    "geometry": {
    "height": 1043,
    "width": 1272,
    "x": 0,
    "y": 0
    },
    "name": "Terminal",
    "percent": 0.5,
    "swallows": [
        {
            "class": "^Gnome\\-terminal$",
            "instance": "^gnome\\-terminal\\-server$",
            "title": "^Terminal$",
            "transient_for": "^$",
            "window_role": "^gnome\\-terminal\\-window\\-ebb34c69\\-83f4\\-4caf\\-8410\\-8625e29d63ec$"
    }
    ],
    "type": "con"
}

{
    // splitv split container with 2 children
    "border": "normal",
    "floating": "auto_off",
    "layout": "splitv",
    "percent": 0.5,
    "type": "con",
    "nodes": [
        {
            "border": "pixel",
            "current_border_width": 0,
            "floating": "auto_off",
            "geometry": {
            "height": 1043,
            "width": 1272,
            "x": 0,
            "y": 0
            },
            "name": "Terminal",
            "percent": 0.5,
            "swallows": [
                {
                    "class": "^Gnome\\-terminal$",
                    "instance": "^gnome\\-terminal\\-server$",
                    "title": "^Terminal$",
                    "transient_for": "^$",
                    "window_role": "^gnome\\-terminal\\-window\\-da79755c\\-fdbf\\-47fc\\-b776\\-3afece7da1a6$"
                }
            ],
            "type": "con"
        },
        {
            "border": "pixel",
            "current_border_width": 0,
            "floating": "auto_off",
            "geometry": {
            "height": 1043,
            "width": 1272,
            "x": 0,
            "y": 0
            },
            "name": "Terminal",
            "percent": 0.5,
            "swallows": [
                {
                    "class": "^Gnome\\-terminal$",
                    "instance": "^gnome\\-terminal\\-server$",
                    "title": "^Terminal$",
                    "transient_for": "^$",
                    "window_role": "^gnome\\-terminal\\-window\\-4b04543e\\-b298\\-45af\\-8042\\-b5f8b123dcc3$"
                }
            ],
            "type": "con"
        }
    ]
}

When I login, I am presented with 6 windows. The 3 from the layout are loaded in the correct configuration, but the startup applications are generating there own windows in the same workspace. (I now have 6 windows, 3 empty ones waiting for an app to fill them).

I can not figure out how to write my execution command to get it to link to these windows.

The documentation example says that if one wishes to start emacs in the layout window, they must use exec emacs --name some_name which is the name of the window instance. I don't know how to use --name with gnome-terminal, and so all my instances are of the same name when I created my layout.

Is there another hook of sorts I need to be using?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.