home-manager @ 199f5268ddeec261f5cba352d741f64517eb68e5

  1{
  2  pkgs,
  3  inputs,
  4  ...
  5}: let
  6  jsonFormat = pkgs.formats.json {};
  7in {
  8  xdg.configFile."waybar/config".source = jsonFormat.generate "config" {
  9    layer = "top";
 10    position = "left";
 11    "modules-left" = [
 12      "niri/workspaces"
 13      "niri/scratchpad"
 14    ];
 15    modules-center = [
 16      "niri/window"
 17    ];
 18    modules-right = [
 19      "wireplumber"
 20      "bluetooth"
 21      "temperature"
 22      "battery"
 23      "cpu"
 24      "memory"
 25      "clock#time"
 26      "clock#date"
 27      "tray"
 28    ];
 29    "clock#time" = {
 30      interval = 10;
 31      format = "{:%H\n%M}";
 32      tooltip = false;
 33    };
 34    "clock#date" = {
 35      interval = 20;
 36      format = "{:%d\n%m}";
 37      tooltip = false;
 38    };
 39    cpu = {
 40      "format" = "{usage}";
 41      "tooltip" = false;
 42    };
 43    memory = {
 44      "format" = "{:2}";
 45    };
 46    "temperature" = {
 47      "thermal-zone" = 2;
 48      "hwmon-path" = "/sys/class/hwmon/hwmon2/temp1_input";
 49      "critical-threshold" = 80;
 50      "format-icons" = [
 51        ""
 52        ""
 53        ""
 54        ""
 55        ""
 56      ];
 57      "format" = "{icon}";
 58      "on-click" = "ghostty -e btop";
 59    };
 60    "battery" = {
 61      "states" = {
 62        "warning" = 30;
 63        "critical" = 15;
 64      };
 65      "format" = "{icon}";
 66      "format-charging" = "󰂄";
 67      "format-plugged" = "{icon}";
 68      "format-alt" = "{capacity} {time} {icon}";
 69      "format-icons" = [
 70        "󰂎"
 71        "󰁺"
 72        "󰁻"
 73        "󰁼"
 74        "󰁽"
 75        "󰁾"
 76        "󰁿"
 77        "󰂀"
 78        "󰂁"
 79        "󰂂"
 80        "󰁹"
 81      ];
 82    };
 83    "wireplumber" = {
 84      "format" = "{icon}";
 85      "return-type" = "json";
 86      "signal" = 8;
 87      "interval" = "once";
 88      "format-icons" = {
 89        "mute" = "";
 90        "default" = [
 91          ""
 92          "󰖀"
 93          "󰕾"
 94        ];
 95      };
 96      "exec" = "pw-volume status";
 97      "on-click" = "pavucontrol";
 98    };
 99    "bluetooth" = {
100      "format-on" = "󰂯";
101      "format-off" = "󰂲";
102      "format-disabled" = "";
103      "format-connected" = "󰂱";
104      "tooltip-format-connected" = "{device_enumerate}";
105      "tooltip-format-enumerate-connected" = "{device_alias}\t{device_address}";
106    };
107    "niri/window" = {
108      "format" = "{title}";
109      "icon" = false;
110      "max-length" = 300;
111      "rotate" = 90;
112    };
113  };
114
115  xdg.configFile."waybar/style.css".text = ''
116    * {
117        border: none;
118        border-radius: 0;
119        min-height: 0;
120        margin: 0;
121        padding: 0;
122        box-shadow: none;
123        text-shadow: none;
124    }
125
126    #waybar {
127        font-family: iosevka;
128    }
129
130    #clock.time,
131    #workspaces button.focused {
132        color: white;
133        background: black;
134    }
135  '';
136}