nix-dotfiles/hm_modules/bspwm.nix

47 lines
1.5 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ pkgs, lib, ... }:
let
xsetroot = "${pkgs.xorg.xsetroot}/bin/xsetroot";
monitorPages = [ "" "" "" "" "" "" "" "" "" "" ];
monitorPagesString = lib.strings.concatStringsSep " " monitorPages;
monitorSetupScript = pkgs.writeShellScript "monitorSetupScript" ''
autorand -c || true
for monitor in $(bspc query -M --names); do
bspc monitor $monitor -d ${monitorPagesString}
done
'';
strPalette = pkgs.lib.rice.palette.toRGBHex pkgs.rice.colorPalette;
in
{
xsession.windowManager.bspwm = {
enable = true;
settings = {
border_width = 1;
border_radius = 8;
window_gap = 2;
split_ratio = 0.5;
top_padding = 0;
borderless_monocle = true;
gapless_monocle = false;
normal_border_color = strPalette.normal.blue;
focused_border_color = strPalette.bright.red;
};
# monitors = builtins.foldl' (acc: monitor: acc // { ${monitor} = monitorPages; }) { } monitors;
rules = {
"*" = { follow = true; };
"Zathura" = { state = "tiled"; };
"Yad" = { state = "floating"; };
};
startupPrograms = [
"${monitorSetupScript}" # Setup monitors
"systemctl --user restart polybar" # Restart polybar
"${xsetroot} -solid black -cursor_name left_ptr" # Set cursor
"${pkgs.update-background}/bin/update-background" # Set background
];
};
services = {
network-manager-applet.enable = true;
blueman-applet.enable = true;
};
home.packages = with pkgs; [ blueman ];
}