more rice stuff
This commit is contained in:
1 parent
3a345929b9
commit
e2d34c6d1e
7 files changed
+156
-45
No files matched your search
@@ -1,34 +1,65 @@
|
||||
{ lib, pkgs, ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.my.bspwm;
|
||||
in
|
||||
{
|
||||
xdg.configFile."bspwm/bspwmrc" = {
|
||||
executable = true;
|
||||
text = ''
|
||||
#!/bin/sh
|
||||
options.my.bspwm.monitors = lib.mkOption {
|
||||
default = [ ];
|
||||
description = "Monitors left to right. Empty means single-monitor defaults.";
|
||||
type = lib.types.listOf (lib.types.submodule {
|
||||
options = {
|
||||
name = lib.mkOption { type = lib.types.str; };
|
||||
xrandr = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "--auto";
|
||||
description = "Arguments for xrandr --output <name>.";
|
||||
};
|
||||
desktops = lib.mkOption { type = lib.types.listOf lib.types.str; };
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
bspc monitor -d 1 2 3 4 5 6 7 8 9
|
||||
config = {
|
||||
xdg.configFile."bspwm/bspwmrc" = {
|
||||
executable = true;
|
||||
text = ''
|
||||
#!/bin/sh
|
||||
|
||||
# Gaps and borders
|
||||
bspc config window_gap 10
|
||||
bspc config border_width 2
|
||||
bspc config focused_border_color "#7aa2f7"
|
||||
bspc config normal_border_color "#292e42"
|
||||
${lib.optionalString (cfg.monitors != [ ]) ''
|
||||
${pkgs.xrandr}/bin/xrandr ${lib.concatMapStringsSep " "
|
||||
(m: "--output ${m.name} ${m.xrandr}") cfg.monitors}
|
||||
''}
|
||||
${if cfg.monitors == [ ]
|
||||
then "bspc monitor -d 1 2 3 4 5 6 7 8 9"
|
||||
else lib.concatMapStringsSep "\n"
|
||||
(m: "bspc monitor ${m.name} -d ${lib.concatStringsSep " " m.desktops}")
|
||||
cfg.monitors}
|
||||
|
||||
# Layout behaviour
|
||||
bspc config split_ratio 0.50
|
||||
bspc config borderless_monocle true
|
||||
bspc config gapless_monocle true
|
||||
# Gaps and borders
|
||||
bspc config window_gap 10
|
||||
bspc config border_width 2
|
||||
bspc config focused_border_color "#7aa2f7"
|
||||
bspc config normal_border_color "#292e42"
|
||||
|
||||
# Launch polybar
|
||||
~/.config/polybar/launch.sh
|
||||
# Layout behaviour
|
||||
bspc config split_ratio 0.50
|
||||
bspc config borderless_monocle true
|
||||
bspc config gapless_monocle true
|
||||
|
||||
# Launch polybar
|
||||
~/.config/polybar/launch.sh
|
||||
|
||||
# Wallpapers
|
||||
[ -x ~/.config/wallpaper/set.sh ] && ~/.config/wallpaper/set.sh
|
||||
'';
|
||||
};
|
||||
|
||||
home.activation.reloadBspwm = lib.hm.dag.entryAfter [ "linkGeneration" ] ''
|
||||
if ${pkgs.procps}/bin/pgrep -x bspwm >/dev/null; then
|
||||
PATH=${pkgs.bspwm}/bin:$PATH DISPLAY=:0 $HOME/.config/bspwm/bspwmrc \
|
||||
|| echo "bspwmrc reload failed" >&2
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
home.activation.reloadBspwm = lib.hm.dag.entryAfter [ "linkGeneration" ] ''
|
||||
if ${pkgs.procps}/bin/pgrep -x bspwm >/dev/null; then
|
||||
PATH=${pkgs.bspwm}/bin:$PATH DISPLAY=:0 $HOME/.config/bspwm/bspwmrc \
|
||||
|| echo "bspwmrc reload failed" >&2
|
||||
fi
|
||||
'';
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user