The reason is quite simple, when you run
chromium it does not return until it finishes, that is after you close Chromium. So
i3-msg will only be run after the window is already gone.
To solve this, you just need to start
chromium in the background, this can be done by appending
& to the command. The
sleep is required, without it
i3-msg might run before Chromium even initialized its window. Five seconds might be a bit long, but it really depends on how fast Chromium opens on your system.
Additionally, I would suggest to add criteria to the
i3-msg. That way it works on any Chromium window and not just the currently focused window, which might not actually be the desired Chromium window (obviously this might not be a desired behavior, in case you want some Chromium windows to be fullscreen).
i3-msg workspace web
/bin/chromium --start-fullscreen &
i3-msg '[instance="^chromium$"] fullscreen disable'
Alternatively, if you want Chromium windows to always appear on the workspace "web", you can use the
for_window configuration directives in your i3 configuration to do the work:
assign [instance="^chromium$"] web
for_window [instance="^chromium$"] exec "sh -c 'sleep 2; i3-msg \[instance=chromium\] fullscreen disable'"
With that, you no longer need a script and every time you run
chromium i3 will put it on "web" and two seconds later the window will drop out of fullscreen.
Note: Although it is theoretically possible to use
fullscreen disable directly with
for_window, it does not work with Chromium because the window does actually start in fullscreen. Chromium just enables fullscreen really fast; unfortunately i3 is even faster when running
for_window. So i3 will disable fullscreen before Chromium even tries to enable it. That is why the detour with running
exec is necessary.