diff options
author | Gabriel A. Giovanini <g.giovanini@gridx.de> | 2025-06-23 15:41:24 +0200 |
---|---|---|
committer | Gabriel A. Giovanini <g.giovanini@gridx.de> | 2025-06-23 16:05:33 +0200 |
commit | 9fcdfe5d6b1c5d518d79345571038d90b6bd6dbf (patch) | |
tree | 9400df8e05a8de8a7c0b227b1f7fba16783aa6e0 /waybar.nix | |
download | home-manager-9fcdfe5d6b1c5d518d79345571038d90b6bd6dbf.tar.gz home-manager-9fcdfe5d6b1c5d518d79345571038d90b6bd6dbf.tar.bz2 home-manager-9fcdfe5d6b1c5d518d79345571038d90b6bd6dbf.zip |
feat: Add configuration from private dotfiles repo
Diffstat (limited to 'waybar.nix')
-rw-r--r-- | waybar.nix | 136 |
1 files changed, 136 insertions, 0 deletions
diff --git a/waybar.nix b/waybar.nix new file mode 100644 index 0000000..dfa6d8d --- /dev/null +++ b/waybar.nix @@ -0,0 +1,136 @@ +{ + pkgs, + inputs, + ... +}: let + jsonFormat = pkgs.formats.json {}; +in { + xdg.configFile."waybar/config".source = jsonFormat.generate "config" { + layer = "top"; + position = "left"; + "modules-left" = [ + "niri/workspaces" + "niri/scratchpad" + ]; + modules-center = [ + "niri/window" + ]; + modules-right = [ + "wireplumber" + "bluetooth" + "temperature" + "battery" + "cpu" + "memory" + "clock#time" + "clock#date" + "tray" + ]; + "clock#time" = { + interval = 10; + format = "{:%H\n%M}"; + tooltip = false; + }; + "clock#date" = { + interval = 20; + format = "{:%d\n%m}"; + tooltip = false; + }; + cpu = { + "format" = "{usage}"; + "tooltip" = false; + }; + memory = { + "format" = "{:2}"; + }; + "temperature" = { + "thermal-zone" = 2; + "hwmon-path" = "/sys/class/hwmon/hwmon2/temp1_input"; + "critical-threshold" = 80; + "format-icons" = [ + "" + "" + "" + "" + "" + ]; + "format" = "{icon}"; + "on-click" = "ghostty -e btop"; + }; + "battery" = { + "states" = { + "warning" = 30; + "critical" = 15; + }; + "format" = "{icon}"; + "format-charging" = ""; + "format-plugged" = "{icon}"; + "format-alt" = "{capacity} {time} {icon}"; + "format-icons" = [ + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + ]; + }; + "wireplumber" = { + "format" = "{icon}"; + "return-type" = "json"; + "signal" = 8; + "interval" = "once"; + "format-icons" = { + "mute" = ""; + "default" = [ + "" + "" + "" + ]; + }; + "exec" = "pw-volume status"; + "on-click" = "pavucontrol"; + }; + "bluetooth" = { + "format-on" = ""; + "format-off" = ""; + "format-disabled" = ""; + "format-connected" = ""; + "tooltip-format-connected" = "{device_enumerate}"; + "tooltip-format-enumerate-connected" = "{device_alias}\t{device_address}"; + }; + "niri/window" = { + "format" = "{title}"; + "icon" = false; + "max-length" = 300; + "rotate" = 90; + }; + }; + + xdg.configFile."waybar/style.css".text = '' + * { + border: none; + border-radius: 0; + min-height: 0; + margin: 0; + padding: 0; + box-shadow: none; + text-shadow: none; + } + + #waybar { + font-family: iosevka; + } + + #clock.time, + #workspaces button.focused { + color: white; + background: black; + } + ''; +} |