summaryrefslogtreecommitdiff
path: root/waybar.nix
diff options
context:
space:
mode:
Diffstat (limited to 'waybar.nix')
-rw-r--r--waybar.nix136
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;
+ }
+ '';
+}