~ruther/nixos-config

ref: 5a79eacaff96316e123fc98a700ee5fa84fc80c9 nixos-config/home/modules/profiles/desktop/qtile/launcher.nix -rw-r--r-- 3.6 KiB
5a79eaca — Frantisek Bohacek feat: disable qtile 8 months ago
                                                                                
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
{ config, lib, pkgs, ... }:

let
  inherit (config.lib.formats.rasi) mkLiteral;        # Theme.rasi alternative. Add Theme here

  themes-collection = pkgs.fetchFromGitHub {
    owner = "newmanls";
    repo = "rofi-themes-collection";
    rev = "f87e08300cb1c984994efcaf7d8ae26f705226fd";
    hash = "sha256-A6zIAQvjfe/XB5GZefs4TWgD+eGICQP2Abz/sQynJPo=";
  };
in
{
  config = lib.mkIf (config.profiles.desktop.qtile.enable || config.profiles.desktop.dwl.enable) {
    home.packages = [
      pkgs.rofi-power-menu
    ];

    xdg.dataFile."rofi/themes/launchpad.rasi".source = "${themes-collection}/themes/launchpad.rasi";
    xdg.dataFile."rofi/themes/spotlight.rasi".source = "${themes-collection}/themes/spotlight-dark.rasi";

    programs = {
      rofi = {
        enable = true;
        package = pkgs.rofi-wayland;
        terminal = "${config.home-config.defaultTerminalExe}";
        location = "center";
        font = "${config.home-config.defaultFont} 11";
        theme = with config.themes.default; {
          # Based on spotlight theme
          "*" = {
            font =  "Montserrat 12";

            bg0 = mkLiteral "#${background.primary}e6";
            bg1 = mkLiteral "#${background.secondary}80";
            bg2 = mkLiteral "#${background.active}e6";
            fg0 = mkLiteral "#${foreground.text}";
            fg1 = mkLiteral "#${foreground.activeAlt}";
            fg2 = mkLiteral "#${foreground.inactive}";

            background-color = mkLiteral "transparent";
            text-color = mkLiteral "@fg0";

            margin = mkLiteral "0";
            padding = mkLiteral "0";
            spacing = mkLiteral "0";
          };

          "window" = {
            background-color = mkLiteral "@bg0";
            border = mkLiteral "2px 0 0";
            border-color = mkLiteral "@bg2";

            location = mkLiteral "center";
            width = mkLiteral "640";
            border-radius = mkLiteral "0";
          };

          "inputbar" =  {
            font = "Montserrat 20";
            padding = mkLiteral "12px";
            spacing = mkLiteral "12px";
            children = mkLiteral "[ icon-search, entry ]";
          };

          "icon-search" =  {
            expand = false;
            filename = "search";
            size = mkLiteral "28px";
          };

          "icon-search, entry, element-icon, element-text" = {
            vertical-align = mkLiteral "0.5";
          };

          "entry" = {
            font = mkLiteral "inherit";

            placeholder = "Search";
            placeholder-color = mkLiteral "@fg2";
          };

          "message" = {
            border = mkLiteral "2px 0 0";
            border-color = mkLiteral "@bg1";
            background-color = mkLiteral "@bg1";
          };

          "textbox" = {
            padding = mkLiteral "8px 24px";
          };

          "listview" = {
            lines = 10;
            columns = mkLiteral "1";

            fixed-height = false;
            border = mkLiteral "1px 0 0";
            border-color = mkLiteral "@bg1";
          };

          "element" = {
            padding = mkLiteral "8px 16px";
            spacing = mkLiteral "16px";
            background-color = mkLiteral "transparent";
          };

          "element normal active" = {
            text-color = mkLiteral "@bg2";
          };

          "element selected normal, element selected active" = {
            background-color = mkLiteral "@bg2";
            text-color = mkLiteral "@fg1";
          };

          "element-icon" = {
            size = mkLiteral "1em";
          };

          "element-text" = {
            text-color = mkLiteral "inherit";
          };
        };
      };
    };
  };
}
Do not follow this link