summaryrefslogtreecommitdiff
path: root/software/windowmanager.nix
blob: c89913bebe7f8c2471a781bc22b34cc1215f18c4 (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
{environment, xdg, pkgs, services, ...}:

{
  # Main packages
  environment.systemPackages = with pkgs; [
    # Fonts
    fontconfig
    fira-code-nerdfont
    libertinus

    kanshi # auto-configure monitors on connect/disconnect

    river  # wm
    lua    # river config
    luajitPackages.luaposix

    foot   # terminal
    tofi   # launcher (dmenu-like)
    swaybg # wallpaper
    waybar # bar
    wev    # detect inputs

    cronie

    tmux # for my homemade dropdowns

    # Screenshots
    grim
    slurp

    dunst  # notifications
    libnotify
    wl-clipboard # copy/paste

    wlr-randr # detect monitors
    wdisplays # arrange monitors
    jq # parse wlr-randr json output

    pulsemixer # adjust audio
    playerctl # control next/previous song
    glib # for gdbus needed by volumectl
  ];

  # Screen capture/sharing:
  xdg.portal = {
    enable = true;
    xdgOpenUsePortal = true;
    config = {
      common = {
        default = ["wlr"];
      };
    };
    wlr = {
      enable = true;
      settings = {
        screencast = {
          max_fps = 30;
          chooser_type = "simple";
          chooser_cmd = "${pkgs.slurp}/bin/slurp -f %o -or";
        };
      };
    };
  };

  # Force wayland on electron
  environment.sessionVariables.NIXOS_OZONE_WL = "1";

  # Trigger updates to waybar
  services.cron = {
    enable = true;
    systemCronJobs = [
      # Time & Date
      "* * * * * kill -42 $(pidof waybar)"
      "* * * * * kill -40 $(pidof waybar)"
      # Battery
      "* * * * * kill -35 $(pidof waybar)"
      # Yadm Dotfiles
      "*/10 * * * * kill -41 $(pidof waybar)"
      # Emails
      "*/5 * * * * kill -46 $(pidof waybar)"
      # Gentoo News
      "*/30 * * * * kill -45 $(pidof waybar)"
    ];
  };

}