zaphyra's git: nixfiles

zaphyra's nixfiles

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 
{
  config,
  lib,
  pkgs,
  ...
}:

{

  services.swayosd = {
    enable = true;
    topMargin = 0.05;
    stylePath = pkgs.writeText "swayosd.css" ''
      window#osd {
        padding: 10px 15px;
        border-radius: 10px;
        border: 1px solid rgba(255, 255, 255, .08);
        background: alpha(#303030, 0.8);
      }
      window#osd #container {
          margin: 10px;
      }
      window#osd #container > image {
        -gtk-icon-transform: scale(1.2);
      }
      window#osd image, window#osd label {
        color: rgba(255, 255, 255, .20);
      }
      window#osd progressbar:disabled, window#osd image:disabled {
          opacity: 0.5;
      }
      window#osd progressbar {
        min-height: 6px;
        border-radius: 999px;
        background: transparent;
        border: none;
      }
      window#osd trough {
        min-height: inherit;
        border-radius: inherit;
        border: none;
        background: rgba(255, 255, 255, .06);
      }
      window#osd progress {
        min-height: inherit;
        border-radius: inherit;
        border: none;
        background: rgb(74, 169, 108);
      }
    '';
  };

  programs.niri.settings.binds = with config.lib.niri.actions; {
    "XF86AudioRaiseVolume".action =
      spawn "swayosd-client" "--output-volume" "raise" "--max-volume"
        "150";
    "XF86AudioLowerVolume".action =
      spawn "swayosd-client" "--output-volume" "lower" "--max-volume"
        "150";

    "XF86MonBrightnessUp".action = spawn "swayosd-client" "--brightness" "raise";
    "XF86MonBrightnessDown".action = spawn "swayosd-client" "--brightness" "lower";
  };
}