stylix/modules/sway.nix

96 lines
2.2 KiB
Nix
Raw Normal View History

{ config, lib, ... }:
2021-07-28 15:12:23 +00:00
with config.lib.stylix.colors.withHashtag;
2021-07-28 15:12:23 +00:00
let
text = base05;
urgent = base08;
focused = base0A;
unfocused = base03;
2021-07-28 15:12:23 +00:00
fonts = {
names = [ config.stylix.fonts.sansSerif.name ];
size = 8.0;
};
in {
options.stylix.targets.sway.enable =
config.lib.stylix.mkEnableTarget "Sway" true;
config = {
home-manager.sharedModules = lib.mkIf config.stylix.targets.sway.enable [{
wayland.windowManager.sway.config = {
inherit fonts;
colors = let
background = base00;
indicator = base0B;
in {
inherit background;
urgent = {
inherit background indicator text;
border = urgent;
childBorder = urgent;
};
focused = {
inherit background indicator text;
border = focused;
childBorder = focused;
};
focusedInactive = {
inherit background indicator text;
border = unfocused;
childBorder = unfocused;
};
unfocused = {
inherit background indicator text;
border = unfocused;
childBorder = unfocused;
};
placeholder = {
inherit background indicator text;
border = unfocused;
childBorder = unfocused;
};
};
output."*".bg = "${config.stylix.image} fill";
};
}];
# Merge this with your bar configuration using //config.lib.stylix.sway.bar
lib.stylix.sway.bar = {
2021-07-28 15:12:23 +00:00
inherit fonts;
colors = let
background = base01;
border = background;
2021-07-28 15:12:23 +00:00
in {
inherit background;
statusline = text;
separator = base03;
focusedWorkspace = {
inherit text border;
background = focused;
2021-07-28 15:12:23 +00:00
};
activeWorkspace = {
inherit text border;
background = unfocused;
2021-07-28 15:12:23 +00:00
};
inactiveWorkspace = {
inherit text border;
background = unfocused;
2021-07-28 15:12:23 +00:00
};
urgentWorkspace = {
inherit text border;
background = urgent;
2021-07-28 15:12:23 +00:00
};
bindingMode = {
inherit text border;
background = urgent;
2021-07-28 15:12:23 +00:00
};
};
};
};
}