/ home / modules / walker.nix
walker.nix
  1  {
  2    config,
  3    lib,
  4    ...
  5  }:
  6  with lib;
  7  let
  8    cfg = config.maatwerk.hyprland;
  9  
 10    colors = config.lib.stylix.colors.withHashtag;
 11    fonts = config.stylix.fonts;
 12    opacity = config.stylix.opacity;
 13  in
 14  {
 15    config = mkIf cfg.enable {
 16      programs.walker = {
 17        enable = true;
 18        runAsService = true;
 19        config = {
 20          theme = "stylix";
 21          providers = {
 22            default = [
 23              "desktopapplications"
 24              "websearch"
 25              "calc"
 26            ];
 27            prefixes = [
 28              {
 29                provider = "files";
 30                prefix = "/";
 31              }
 32              {
 33                provider = "clipboard";
 34                prefix = "\\";
 35              }
 36              {
 37                provider = "symbols";
 38                prefix = ":";
 39              }
 40            ];
 41          };
 42          keybinds.quick_activate = [
 43            "ctrl j"
 44            "ctrl k"
 45            "ctrl l"
 46          ];
 47        };
 48  
 49        themes.stylix = {
 50          style = # css
 51            ''
 52              @define-color window_bg_color ${colors.base00};
 53              @define-color accent_bg_color ${colors.base0D};
 54              @define-color theme_fg_color ${colors.base05};
 55              @define-color error_bg_color ${colors.base08};
 56              @define-color error_fg_color ${colors.base00};
 57  
 58              * {
 59                all: unset;
 60                font-family: "${fonts.sansSerif.name}";
 61                font-size: ${toString fonts.sizes.popups}pt;
 62              }
 63  
 64              popover {
 65                background: ${colors.base01};
 66                border: 1px solid ${colors.base03};
 67                border-radius: 18px;
 68                padding: 10px;
 69              }
 70  
 71              .normal-icons { -gtk-icon-size: 16px; }
 72              .large-icons { -gtk-icon-size: 32px; }
 73              .search-container { border-radius: 10px; }
 74              .input placeholder { opacity: 0.5; }
 75              .list { color: @theme_fg_color; }
 76  
 77              scrollbar { opacity: 0; }
 78  
 79              .box-wrapper {
 80                box-shadow: 0 19px 38px rgba(0, 0, 0, 0.3), 0 15px 12px rgba(0, 0, 0, 0.22);
 81                background: alpha(@window_bg_color, ${toString opacity.popups});
 82                padding: 20px;
 83                border-radius: 20px;
 84                border: 1px solid @accent_bg_color;
 85              }
 86  
 87              .preview-box, .elephant-hint, .placeholder {
 88                color: @theme_fg_color;
 89              }
 90  
 91              .input selection {
 92                background: ${colors.base02};
 93              }
 94  
 95              .input {
 96                caret-color: @theme_fg_color;
 97                background: ${colors.base01};
 98                padding: 10px;
 99                color: @theme_fg_color;
100                border-radius: 8px;
101              }
102  
103              .item-box {
104                border-radius: 10px;
105                padding: 10px;
106              }
107  
108              .item-quick-activation {
109                background: alpha(@accent_bg_color, 0.25);
110                border-radius: 5px;
111                padding: 10px;
112                color: ${colors.base0A}; 
113              }
114  
115              child:selected .item-box {
116                background: alpha(@accent_bg_color, 0.4);
117              }
118  
119              .item-subtext {
120                font-size: ${toString (fonts.sizes.popups - 2)}pt;
121                opacity: 0.6;
122              }
123  
124              .preview {
125                border: 1px solid alpha(@accent_bg_color, 0.25);
126                border-radius: 10px;
127                color: @theme_fg_color;
128              }
129  
130              .keybind-label, 
131              .keybind-bind {
132                font-size: ${toString (fonts.sizes.popups - 4)}pt;
133              }
134  
135              .keybind-label {
136                padding: 1px 4px;
137                border-radius: 4px;
138                background: alpha(@theme_fg_color, 0.05);
139                border: 1px solid alpha(@theme_fg_color, 0.2);
140              }
141  
142              .keybind-bind {
143                font-size: ${toString (fonts.sizes.popups - 5)}pt;
144                opacity: 0.5;
145                margin-top: 2px;
146              }
147  
148              .keybinds {
149                padding-top: 10px;
150                margin-top: 5px;
151                border-top: 1px solid alpha(@theme_fg_color, 0.1);
152              }
153  
154              .error {
155                padding: 10px;
156                background: @error_bg_color;
157                color: @error_fg_color;
158              }
159            '';
160        };
161      };
162  
163    };
164  }