I saved the layout for my workspace following the docs:
i3-save-tree --workspace 1 > ~/.i3/layouts/ws1.json
Because my workspace name is a quoted string variable, I had to make a script (~/.i3/scripts/load_layout.sh
) in order to call i3-msg
properly:
i3-msg "workspace $1"
i3-msg "append_layout /home/villasv/.i3/layouts/ws$2.json"
Then my ~/.i3/config
file had the following for workspace setup:
set $ws1 "1 "
bindsym $mod+1 workspace $ws1
bindsym $mod+Shift+1 move container to workspace $ws1
exec --no-startup-id 'sh ~/.i3/scripts/load_layout.sh $ws1 1'
exec firefox
But the layout change does not happen after sign out and sign in. I've tried even using exec_always
and restarting i3
, but still no effect.
Running sh ~/.i3/scripts/load_layout.sh "dummy" 1
successfuly creates a workspace with the layout.
Also, using exec --no-startup-id "i3-msg 'workspace 1; append_layout ~/.i3/layouts/ws1.json'"
wil also work, almost as desired. I guess the problem happens in the script or the script call, but I don't know what.
What am I missing to make this work with workspace variable names?