Skip to content

Commit

Permalink
Create Sway module
Browse files Browse the repository at this point in the history
  • Loading branch information
danth committed Jul 28, 2021
1 parent af17cad commit 01c39ac
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 0 deletions.
1 change: 1 addition & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
./modules/lightdm.nix
./modules/plymouth
./modules/qutebrowser.nix
./modules/sway.nix
./modules/vim.nix
];
}
90 changes: 90 additions & 0 deletions modules/sway.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{ config, ... }:

with config.lib.stylix.colors;

let
text = base05-hash;
urgent = base08-hash;
focused = base0A-hash;
unfocused = base03-hash;

fonts = {
names = [ config.stylix.fonts.sansSerif.name ];
size = 8.0;
};

in {
stylix.homeModule = {
wayland.windowManager.sway.config = {
inherit fonts;

colors = let
background = base00-hash;
indicator = base0B-hash;
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 = {
inherit fonts;

colors = let
background = base01-hash;
border = background;
in {
inherit background;
statusline = text;
separator = base03-hash;
focusedWorkspace = {
inherit text border;
background = focused;
};
activeWorkspace = {
inherit text border;
background = unfocused;
};
inactiveWorkspace = {
inherit text border;
background = unfocused;
};
urgentWorkspace = {
inherit text border;
background = urgent;
};
bindingMode = {
inherit text border;
background = urgent;
};
};
};
}

0 comments on commit 01c39ac

Please sign in to comment.