From e43c98f9e7b6f999e004b35020451978fb2a5a67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Abdelkader=20Mart=C3=ADnez=20P=C3=A9rez?= Date: Sat, 7 Jan 2023 18:53:22 +0100 Subject: [PATCH] Add an i3 module based on Sway module (#18) --- flake.nix | 1 + modules/i3.nix | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 modules/i3.nix diff --git a/flake.nix b/flake.nix index 5ecf4036b..db30466d4 100644 --- a/flake.nix +++ b/flake.nix @@ -70,6 +70,7 @@ ./modules/grub.nix ./modules/gtk ./modules/helix.nix + ./modules/i3.nix ./modules/kitty.nix ./modules/lightdm.nix ./modules/mako.nix diff --git a/modules/i3.nix b/modules/i3.nix new file mode 100644 index 000000000..f1e6145b8 --- /dev/null +++ b/modules/i3.nix @@ -0,0 +1,93 @@ +{ config, lib, ... }: + +with config.lib.stylix.colors.withHashtag; + +let + text = base05; + urgent = base08; + focused = base0A; + unfocused = base03; + + fonts = { + names = [ config.stylix.fonts.sansSerif.name ]; + }; + +in { + options.stylix.targets.i3.enable = + config.lib.stylix.mkEnableTarget "i3" true; + + config = { + home-manager.sharedModules = lib.mkIf config.stylix.targets.i3.enable [{ + xsession.windowManager.i3.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.i3.bar + lib.stylix.i3.bar = { + inherit fonts; + + colors = let + background = base00; + border = background; + in { + inherit background; + statusline = text; + separator = base03; + focusedWorkspace = { + inherit text background; + border = focused; + }; + activeWorkspace = { + inherit border background; + text = focused; + }; + inactiveWorkspace = { + inherit text border background; + }; + urgentWorkspace = { + inherit text background; + border = urgent; + }; + bindingMode = { + inherit text border; + background = urgent; + }; + }; + }; + }; +}