aboutsummaryrefslogtreecommitdiff
path: root/modules/desktop/hjem/wm/tofi.nix
blob: f6a070374cb0352830060981856e0d444abdb28e (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
{
  pkgs,
  lib,
  config,
  ...
}: let
  cfg = config.collinux.desktop.programs.tofi;
  flags = {
    drun-launch = "true";
    anchor = "bottom";
    horizontal = "true";
    width = "100%";
    height = 20;
    font-size = 12;
    prompt-text = "";
    font = "${pkgs.iosevka}/share/fonts/truetype/Iosevka-Regular.ttf";
    outline-width = 0;
    border-width = 0;
    num-results = 20;
    min-input-width = 0;
    result-spacing = 10;
    padding-top = 0;
    padding-bottom = 0;
    padding-left = 0;
    padding-right = 0;
    background-color = "#11111b";
    text-color = "#585B70";
    selection-color = "#CDD6F4";
    selection-match-color = "#89B4FA";
  };
  flagsText = flags |> lib.mapAttrsToList (k: v: "--${k}=${toString v}") |> lib.concatStringsSep " ";
in
  lib.mkIf cfg.enable {
    packages = [
      (pkgs.writeShellScriptBin "tofi" ''
        ${pkgs.tofi}/bin/tofi ${flagsText}
      '')
      (pkgs.writeShellScriptBin "tofi-drun" ''
        ${pkgs.tofi}/bin/tofi-drun ${flagsText}
      '')
    ];
  }