aboutsummaryrefslogtreecommitdiffstats
path: root/modules/desktop/i3/default.nix
blob: e24f95bd596873c96567c2e15e08068c3bd6c9ba (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
85
86
87
88
89
90
91
92
93
{
  config,
  lib,
  pkgs,
  ...
}:

{
  config = lib.mkIf config.desktop.enable {
    xsession.windowManager.i3.enable = true;

    xsession.windowManager.i3.config = with config.scheme.withHashtag; {
      modifier = "Mod4"; # Super

      bars = [ ];

      gaps = {
        inner = 10;
        outer = 0;
      };

      window = {
        border = 1;
        titlebar = false;
      };

      colors = {
        focused = {
          border = base03;
          background = base03;
          text = base07;
          indicator = base03;
          childBorder = base03;
        };
        focusedInactive = {
          border = base02;
          background = base02;
          text = base05;
          indicator = base02;
          childBorder = base02;
        };
        unfocused = {
          border = base02;
          background = base02;
          text = base05;
          indicator = base02;
          childBorder = base02;
        };
      };

      defaultWorkspace = "workspace number 1";

      window.commands = [
        {
          command = "floating enable, sticky enable, resize set 1000 600, move position center";
          criteria = {
            class = "floating-termial";
          };
        }
      ];

      focus.followMouse = true;

      startup = [
        # {
        #   command = "${config.services.polybar.script}";
        #   always = true;
        #   notification = false;
        # }
        {
          command = "xrandr -q | grep -w 'connected' | cut -d' ' -f1 | xargs -I{} i3-msg \"workspace 1 output {}\"";
          always = false;
          notification = false;
        }
        {
          command =
            if config.tools.feh.enable then
              "${pkgs.feh}/bin/feh --bg-scale ${../../../assets/skeleton-mage.png}"
            else
              "xsetroot -solid \"${config.scheme.withHashtag.base00}\"";
          always = true;
          notification = false;
        }
      ];

      keybindings = lib.mkOptionDefault (import ./keybindings.nix { inherit pkgs lib; });
    };

    xsession.windowManager.i3.extraConfig = ''
      exec_always --no-startup-id xrandr -q | grep -w 'connected' | cut -d' ' -f1 | xargs -I{} i3-msg "workspace 1 output {}"
    '';
  };
}