move caja to scratchpad on start
Hi, I am new to i3, so please be patient :)
I use caja (file manager from Mate) and want it to be ready from the start of i3. I can do this by using this config:
for_window [instance="caja"] move window to scratchpad
exec --no-startup-id i3-msg 'workspace 0; exec caja; workspace 1'
bindsym $mod+e [instance="caja"] scratchpad show
But if i want to open a new caja window (so i have 2 different caja windows, one in scratchpad one in workspace), it will be sent to the scratchpad instead (so now i have 2 caja windows in scratchpad). So how do I fix this?
I tried several options included vim-like mark, but it is not working on startup. (it is working with bindsysm, but i want to mark it automatically). I tried something like this:
for_window [con_mark="^test$"] move window to scratchpad
exec --no-startup-id i3-msg 'workspace 0; exec caja, mark test; workspace 1'
bindsym $mod+e [con_mark="^test$"] scratchpad show
and several other options, but nothing works. caja has --name options, but it is not working. When i check it with xprop, the class still WM_CLASS(STRING) = "caja", "Caja". Thanks for all your help.
The reason the second try does not work is that i3 does not wait after `exec caja` for a window to appear before running `mark test`, so unless caja starts exceptionally fast, `mark test` will run long before the window appears, thus marking something else.
Aside from that, scratchpads are available on all workspaces, so switching to "workspace 0", starting caja and then switching to "workspace 1" does not really make sense.
@Adaephon oh i forgot to explain about moving to workspace 0 first. It is because if i do all of that only on workspace 1, after caja is sent to the scratchpad, the focus is not come back to workspace 1. so i need to do $mod+1 again to bring the focus to workspace 1.
Does Caja perchance have a `--class=CLASS` command line argument?
it has, but same like the --name, it is not working at all.