aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/modules/workstation/ui/i3/core/setup.nix
blob: 80d1827d881c788f09957fcd225ef89b5f4e5248 (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
/** Main entry point for the home-manager module configuration
 *
 * For some reason, access to the config.libkookie.* option tree
 * is not possible here, but instead needs to be deferred to an
 * imported expression.  For that reason, this file only contains
 * key allocations, and no actual configuration content.
 */

{ config, lib, pkgs, home-manager, ... } @ args:

{
  xsession.windowManager.i3 =
    let config = (import ./config.nix args);
    in
      {
        enable = true;
        package = pkgs.i3;
        inherit config;

        # TODO: move this into the config module?

        extraConfig = with pkgs; ''
          # Setup compositor
          exec_always --no-startup-id "${coreutils}/bin/pkill picom; ${picom}/bin/picom --config ~/.config/i3/picom.conf"
      
          # Make CAPSLOCK into ESC because it's 2018
          #
          # Okay actually this is slightly more complicated than that. I'm binding 
          # CAPSLOCK to HYPER, so that I can use it as a modifier in emacs, but then 
          # using xcape(1) to also make short CAPSLOCK presses into ESCAPE.

          exec_always --no-startup-id "${xorg.xmodmap}/bin/setxkbmap -layout us -variant altgr-intl -option caps:hyper"
          exec ${xcape}/bin/xcape -e "#66=Escape" -t 150

          # Always set a wallpaper
          # exec_always --no-startup-id ${feh}/bin/feh --bg-fill config.libkookie.ui.i3.wallpaper ?????

          bar {
              status_command ${i3status}/bin/i3status -c ~/.config/i3/i3status.conf
              position bottom
              bindsym button4 nop
              bindsym button5 nop
              colors  {
                  background #0F0F0F
                  statusline #D5D5D5
              }
          }

          focus_follows_mouse no

          # Layout and design settings that should _really_ be in the module
          default_border pixel 3
          client.focused #4c7899 #285577 #ffffff #F73E5F #666666
        '';
      };

  xdg.configFile."i3/picom.conf" = (import ./picom.nix args);

  xdg.configFile."i3/i3status.conf" = (import ./i3status.nix args);
}