aboutsummaryrefslogtreecommitdiff
path: root/share/cfg/tofi.nix
blob: de97cf4bf6c7fbae51f186c135d9f2dfb3ebd21c (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
{ lib, config, ... }:
{
  # Tofi's cache seems to get messed up sometimes, so we regenerate it when
  # building the system.
  # https://github.com/philj56/tofi/issues/115#issuecomment-1701748297
  home.activation = lib.mkIf config.programs.tofi.enable {
    regenerateTofiCache = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
      tofi_cache=${config.xdg.cacheHome}/tofi-drun
      [[ -f "$tofi_cache" ]] && rm "$tofi_cache"
    '';
  };

  programs.tofi = {
    settings = {
      anchor = "top";
      width = "100%";
      height = 30;
      horizontal = true;
      font-size = 14;
      prompt-text = " run: ";
      font = "monospace";
      outline-width = 0;
      border-width = 0;
      background-color = "#000000";
      min-input-width = 120;
      result-spacing = 15;
      padding-top = 0;
      padding-right = 0;
      padding-bottom = 0;
      padding-left = 0;
      drun-launch = true;
      terminal = "foot";
    };
  };
}