From 774f25f5448cd2e6b503ed0eb9e7f68cd70aa85d Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Sat, 8 Apr 2023 10:32:55 +0100 Subject: [PATCH] Move bspwm extra scripts to separate file, assign windows to workspaces like in i3 --- nixos/home-manager/env/bspwm.nix | 36 +++++++++---------- .../home-manager/env/config/bspwm/startup.sh | 7 ++++ nixos/home-manager/env/xfce.nix | 3 +- 3 files changed, 27 insertions(+), 19 deletions(-) create mode 100755 nixos/home-manager/env/config/bspwm/startup.sh diff --git a/nixos/home-manager/env/bspwm.nix b/nixos/home-manager/env/bspwm.nix index cad7fded..aad1b47b 100644 --- a/nixos/home-manager/env/bspwm.nix +++ b/nixos/home-manager/env/bspwm.nix @@ -1,5 +1,9 @@ { pkgs, ... }: { + home.packages = with pkgs; [ + nitrogen + polybar + ]; xsession.windowManager.bspwm = { enable = true; settings = { @@ -18,24 +22,20 @@ }; rules = { "Xfce4-terminal".state = "floating"; - "kitty" = { - desktop = "^1"; - focus = true; - }; - "firefox" = { - desktop = "^2"; - focus = false; - }; + "Nm-connection-editor".state = "floating"; + "Pavucontrol".state = "floating"; + "kitty".desktop = "^1"; + "firefox".desktop = "^2"; + "Thunar".desktop = "^3"; + "thunderbird".desktop = "^4"; + "Mailspring".desktop = "^4"; + "Element".desktop = "^5"; + "Signal".desktop = "^5"; + "TelegramDesktop".desktop = "^5"; + "Steam".desktop = "^6"; + "Bitwarden".desktop = "^7"; + "Nxplayer.bin".desktop = "^8"; }; - extraConfig = '' - [ -f "$HOME/.config/nitrogen/bg-saved.cfg" ]\ - && ${pkgs.nitrogen}/bin/nitrogen --restore\ - || ${pkgs.nitrogen}/bin/nitrogen --set-auto $HOME/.dotfiles/wallpaper/images_dark/5120x2880.png --save - ${pkgs.xorg.xinput}/bin/xinput set-button-map "Logitech USB Receiver Mouse" 3 2 1 - ${pkgs.polybar}/bin/polybar-msg cmd quit - echo "---" | tee -a /tmp/polybar.log - ${pkgs.polybar}/bin/polybar 2>&1 | tee -a /tmp/polybar.log & disown - echo "Bars launched..." - ''; + extraConfig = builtins.readFile (./config/bspwm/startup.sh); }; } diff --git a/nixos/home-manager/env/config/bspwm/startup.sh b/nixos/home-manager/env/config/bspwm/startup.sh new file mode 100755 index 00000000..8d5491c6 --- /dev/null +++ b/nixos/home-manager/env/config/bspwm/startup.sh @@ -0,0 +1,7 @@ +[ -f "$HOME/.config/nitrogen/bg-saved.cfg" ]\ + && nitrogen --restore\ + || nitrogen --set-auto $HOME/.dotfiles/wallpaper/images_dark/5120x2880.png --save +polybar-msg cmd quit +echo "---" | tee -a /tmp/polybar.log +polybar 2>&1 | tee -a /tmp/polybar.log & disown +echo "Bars launched..." diff --git a/nixos/home-manager/env/xfce.nix b/nixos/home-manager/env/xfce.nix index c4a5fd23..51c96132 100644 --- a/nixos/home-manager/env/xfce.nix +++ b/nixos/home-manager/env/xfce.nix @@ -15,10 +15,11 @@ ranger flameshot power-profiles-daemon + i3lock-fancy ]; xfconf.settings = { xfce4-session = { - "general/LockCommand" = "${pkgs.i3lock-fancy}/bin/i3lock-fancy"; + "general/LockCommand" = "i3lock-fancy"; }; xsettings = { "Net/ThemeName" = "Catppuccin-Frappe-Standard-Blue-Dark";