Launching application on fresh boot on bspwm


I recently moved to bspwm , my main issue is starting my usual application on every reboot.

I have tried to methods:

  1. Using bspc to just get the latest node and move it to the desktop I want. This went really bad as (as much as I added sleep time to commands) they are unpredictable and it will not follow the order it recieved commands.
  2. Using bspc -a rule running my command then running bspc -r rule to nullify previous rule for that program. This one works a little better but still don’t work well with heavy applications like Brave browser (and anything running on Electron).

Any standard way to do this. I really liking bspwm, specially because I have used sxhkd for a long time for my hotkeys and this allows me have all of them in just one program and file. But I still need this feature.

My question is: Is there a way to lauch my startup setup using bspwm? And if not which WM you recommend to do so. I really like to get in and out of work faster. Just manually setting up windows and their setting is very time consuming and annoying for me.

Thanks for your help in advanced.

I once used this post with some success:

Check if this helps

1 Like

I would add the programs you want to your bspwmrc, they will all spawn in the same workspace… unless you want them some of them to be floating, in which case you will have to either do that manually, or make every instance of that program floating with a specific dimensions. OR you can make a keybinding in sxhkd to run apps (one time) with specific dimensions. For example:

{alacritty --hold -e 'echo ""', bspc rule -a \* -o state=floating rectangle=400x800 && alacritty --hold -e echo ""}

makes a terminal echoing “” appear with dimensions 400x800 while floating. This makes a rule that only happens once.

I think all my windows i need are tiled. I also don’t think autolauching it with bspwmrc is an good idea. These are heavy applications (for specs of my machine) and take a while to load. I want an option to cancel the launch if needed. So I put them in my startup script and activate it via sxhkd.

1 Like

Thanks , it seems to be exactly what I want. unfortunatly I can’t make it work even on single command. Most important for me is to put windows in right desktop not mentioned here. I think it was desktop=^N. I also using kitty instead of termit. --name and --title seems to be option but don’t work

kitty --name works for me, do you have a bar? if not, run xprop and click on the kitty window and look at WM_CLASS, it should say whatever name you used. If you do have a bar, enable the xwindow module in polybar if you have it. desktop='N' should work.

Yeah I figure it out , WM_CLASS is strange , usually it is just name of the program with first letter capital. For kitty it is all lower case for some reason. Thanks

1 Like

Here’s something I use to offset the time my systray items launch:

xfce4-power-manager &
numlockx on &
(sleep 1s && pasystray) &
dunst &
(sleep 2s && copyq) &
(sleep 2s && flameshot) &

In my case, I don’t actually call the bspc command. These are just lines in my bspwmrc. Not sure if this makes a difference.

Interesting, these are very light programs compared to Chrome. This method works fine for TUI programs for me too.
It is interesting you used () to group them before the launch tho. I thing I test with this too

1 Like

Seems like this -o or --one-shot flag doesn’t work most of the times and is the most problomatic one.