How do you implement layout with the autostarting of applications in the i3 window manager?

user44370

This is a follow-up on a prior question on how to autostart applications on individual workspaces with the i3 window manager and what can and can't be done inside the ~/.i3/config configuration file.

First, the provided solution based on Arch Linux documentation and an update provided by op where he pushes the logic further:

exec --no-startup-id i3-msg 'workspace 1:Web; exec /usr/bin/firefox'
exec --no-startup-id i3-msg 'workspace 1; exec firefox; workspace 2; exec urxvt; workspace 1'

Also of interest is this exchange about leveraging some of that directly on the command line without duplicating:

i3-msg workspace 3; i3-msg exec firefox
i3-msg workspace 9; i3-msg exec chromium

But I have never seen a configuration which autostarts many windows/apps in each workspace according to a desired vertical or horizontal layout. My goal is to autostart this simple configuration I use:

 _____ _____     ___________     ___________
| lx  | lx  |   |        |u_|   |     |     |   proportions:
|_____|_____|   |  FF    |lx|   |spacefm    |   1- 25% each
|medit| lx  |   |        |__|   |     | vlc |   2- 75/25 x 25/50/25
|_____|_____|   |________|u_|   |_____|_____|   3- 50/50
      1               2               3

So it starts with something like this in the config file:

exec --no-startup-id i3-msg 'workspace 1; exec i3-sensible-terminal; layout toggle split; layout splitv; split vertical; exec i3-sensible-terminal; exec i3-sensible-terminal; exec i3-sensible-terminal; workspace 2; exec firefox; exec urxvt; exec i3-sensible-terminal; exec urxvt; workspace 3; exec spacefm; exec vlc'

But how in the world do you achieve the type of layout and vert/horizontal splitting you want? I'm trying, but it's not clear how you "mix" execution and layout. The syntax feels idiosyncratic to start because you're executing i3-img within i3's configuration. Do you use split h (or v) - layout split v - exec layout split v - focus down(or right) in between each exec call??

For a single workspace, the configuration starts all applications either vertically or horizontally and I can't seem to influence layout - or the last split command in the chain decides whether the windows are added vertically or horizontally. i3-msg seemingly ignores parts of the command that aren't properly formatted in some cases so it's hard to debug. This is further compounded by the fact that you really need to quit X and startx again every time to verify the results as just refreshing the configuration with mod+shift+R won't cut it even if you close everything on each of the workspaces.

What is the proper way of configuring this? Does anyone have a solution which implements something like that? The documentation is pretty good but it doesn't provide that I can see a detailed example which mixes execution and layout on multiple workspaces.

damien

I believe that you are looking for the new layout-saving feature that was introduced in i3 v4.8 (2014-06-15). The linked documentation seems pretty thorough.

Quoting from the documentation:

Layout saving/restoring allows you to load a JSON layout file so that you can have a base layout to start working with after powering on your computer. Dynamic use-cases also come to mind: if you frequently (but not always!) need a grid layout of terminals with ping/traceroute commands to diagnose network issues, you can easily automate opening these windows in just the right layout.

... and the release notes:

tl;dr: export1 your current layout as JSON file, load it into new i3 sessions, get placeholder windows that will be replaced by the actual apps once you start them.


1. You may require the perl-anyevent-i3 and perl-json-xs packages to use the i3-save-tree utility.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Set default container layout for i3 window manager

From Dev

How do I scale i3 window manager for my HiDPI display?

From Dev

How to use i3 window manager in fedora with gnome

From Dev

How to add volume visual feedback to i3 window manager?

From Dev

i3 window manager: ampersand (&) in commands

From Dev

How can I define startup applications with the Awesome Window Manager?

From Dev

How do you add a new window manager to the gdm menu?

From Dev

How can I set what i3 returns as the window manager name?

From Dev

How do I restart the window manager?

From Dev

How do I use the awesome window manager?

From Dev

How do I restart the window manager?

From Dev

How do I uninstall applications from my applications window

From Dev

Android: how do I implement the following layout?

From Dev

How to change keyboard layout in i3?

From Dev

Remap Fedora 23 Keys under the i3 window manager

From Dev

Incorporate nm-applet in i3 window manager

From Dev

How do you change the color for all the items in the status bar in the i3 WM?

From Dev

How do you change the color for all the items in the status bar in the i3 WM?

From Dev

How do I change the login manager's keyboard layout?

From Dev

How do I change the login manager's keyboard layout?

From Dev

How do I get websites and software applications to open up into a window?

From Dev

How do I set the default window manager under Fedora 21?

From Dev

How Do I install and use fluxbox window manager?

From Dev

How do I start the GUI (Window Manager?) over VNC?

From Dev

How Do I install and use fluxbox window manager?

From Dev

How do I exit the window manager on the current X display?

From Dev

How do I start the GUI (Window Manager?) over VNC?

From Dev

OSX: How do you allow user to resize window under auto layout?

From Dev

How to run Gnome Startup Applications in i3?

Related Related

  1. 1

    Set default container layout for i3 window manager

  2. 2

    How do I scale i3 window manager for my HiDPI display?

  3. 3

    How to use i3 window manager in fedora with gnome

  4. 4

    How to add volume visual feedback to i3 window manager?

  5. 5

    i3 window manager: ampersand (&) in commands

  6. 6

    How can I define startup applications with the Awesome Window Manager?

  7. 7

    How do you add a new window manager to the gdm menu?

  8. 8

    How can I set what i3 returns as the window manager name?

  9. 9

    How do I restart the window manager?

  10. 10

    How do I use the awesome window manager?

  11. 11

    How do I restart the window manager?

  12. 12

    How do I uninstall applications from my applications window

  13. 13

    Android: how do I implement the following layout?

  14. 14

    How to change keyboard layout in i3?

  15. 15

    Remap Fedora 23 Keys under the i3 window manager

  16. 16

    Incorporate nm-applet in i3 window manager

  17. 17

    How do you change the color for all the items in the status bar in the i3 WM?

  18. 18

    How do you change the color for all the items in the status bar in the i3 WM?

  19. 19

    How do I change the login manager's keyboard layout?

  20. 20

    How do I change the login manager's keyboard layout?

  21. 21

    How do I get websites and software applications to open up into a window?

  22. 22

    How do I set the default window manager under Fedora 21?

  23. 23

    How Do I install and use fluxbox window manager?

  24. 24

    How do I start the GUI (Window Manager?) over VNC?

  25. 25

    How Do I install and use fluxbox window manager?

  26. 26

    How do I exit the window manager on the current X display?

  27. 27

    How do I start the GUI (Window Manager?) over VNC?

  28. 28

    OSX: How do you allow user to resize window under auto layout?

  29. 29

    How to run Gnome Startup Applications in i3?

HotTag

Archive