Bspwmrc doesnt execute on boot/login

Hey, I have been trying to set up multiple NixOS systems and I’ve encountered the same issue on all 4 systems, 1 System is my desktop another 2 are my laptops and the last one is a virtual machine, my issue is that my bspwmrc doesnt execute whenever i login to bspwm on X, sxhkdrc does execute (sxhkd is the hotkey daemon for bspwm). executing bspwmrc manually works fine, sxhkdrc and bspwmrc both have the same permissions and the executable permission so i doubt that this problem is caused by the file perms.
ive had this issue happen to me on all 4 of my systems with different configuration.nix file, and on different NixOS versions older/newer…
my bspwmrc and sxhkdrc files are in the right location, adding the option windowManager.bspwm.configFile = "/home/kranzes/.config/bspwm/bspwmrc"; (under my services.xserver section of course)
does not do anything, ive tried removing and adding it and i got the same results with and without it.
im quite lost, ive been trying to figure this issue out for over 15 hours and i couldn’t figure it out, as you can tell.
these are my config files (configuration.nix , bspwmrc , sxhkdrc"
i seem to be the only one that has experienced this issue, so it might be user-error but i really cant find what i did wrong, Thanks.

(sorry for the small pictures, i wasnt sure how i could send the config files here)

The only big problem I can see from your config files is the sxhkd & at the top of your bspwmrc. sxhkd will already be started by your display manager as described [here](http:// SXHKD_SHELL=/bin/sh ${cfg.sxhkd.package}/bin/sxhkd ${optionalString (cfg.sxhkd.configFile != null) “-c "${cfg.sxhkd.configFile}"”} &). But I don’t think that is what’s causing your problems, because I would think that sxhkd would just error out if called twice. That line is redundant either way and it would be good to remove it.

Also you are logging in through your display manager right(it should be lightdm for you) right? Can you post relevant lines from journalctl -u display-manager.service. I believe any bspwm errors will show up there and if not I recommend finding any relevant logs to see if there is some error in starting your config.

i dont think sxhkd causes any problems when trying to execute it when its already runny, it just says “keys already grabbed” and moves on to the next bit of the script, also i can run bspwmrc manually and it works fine, it just that it doesnt execute on login.

You still need to indicate the displayManager session command. For example:

services.xserver.displayManager.sessionCommands = ''
  ${pkgs.bspwm}/bin/bspc wm -r
  source $HOME/.config/bspwm/bspwmrc
'';
1 Like