summaryrefslogtreecommitdiff
path: root/modules/home-manager/personal/gui/x/i3/default.nix
blob: 483a0d4198c15599505f9b3adc59575911ad1e11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{
  config,
  lib,
  pkgs,
  ...
}@extraArgs:
let
  cfg = config.personal.x.i3;
in
{
  imports = [
    ./bar
    ./keybindings.nix
    ./startup.nix
  ];

  options.personal.x.i3 = {
    enable = lib.mkEnableOption "i3" // {
      default = extraArgs.osConfig.services.xserver.windowManager.i3.enable or false;
    };
  };

  config = lib.mkIf cfg.enable {
    xsession.windowManager.i3 = {
      enable = cfg.enable;
      package = lib.mkDefault pkgs.i3-gaps;

      config = {
        assigns =
          lib.optionalAttrs
            (config.personal.profiles.multimedia && (extraArgs.osConfig.programs.steam.enable or true))
            {
              "8: multimedia" = [
                { class = "^Steam$"; }
                { title = "Netflix"; }
                { title = "MUBI"; }
                { title = "Deezer"; }
              ];
            }
          // lib.optionalAttrs config.personal.profiles.social {
            "9: social" = [
              { class = "^Mail$"; }
              { class = "^thunderbird$"; }
            ]
            ++ lib.optionals config.personal.identities.personal [
              { class = "^signal$"; }
              { class = "^Signal$"; }
              { title = "^Signal"; }
            ]
            ++ lib.optionals config.personal.identities.work [
              { class = "^zulip"; }
              { class = "^Zulip"; }
            ];
          }
          // {
            "10: passwords" = [
              {
                # matches <some db>.kbdx [Locked] - KeePassXC
                title = ".*\\.kbdx \\[Locked\\] - KeePassXC$";
              }
            ];
          };

        workspaceAutoBackAndForth = lib.mkDefault true;

        window = {
          titlebar = lib.mkDefault false;
          border = lib.mkDefault 0;
        };
        floating = {
          titlebar = lib.mkDefault false;
          border = lib.mkDefault (
            if config.services.picom.enable && config.services.picom.shadow then 0 else lib.mkOptionDefault
          );
        };
        gaps = {
          inner = lib.mkDefault 15;
          outer = lib.mkDefault 5;
        };
      };
    };
    programs.rofi.enable = lib.mkDefault true;
  };
}