diff options
| author | Craig Jennings <c@cjennings.net> | 2026-01-27 08:51:31 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-01-27 08:51:31 -0600 |
| commit | ea569d1a0279674863661c7f6694c0ba6fc5cb7d (patch) | |
| tree | 4a17d53d7574b4062c7626915bdf9e1897f194c8 /dotfiles/hyprland | |
| parent | 7f07e47237606425d45f628f25c6029223b420e7 (diff) | |
feat(waybar): add warning/critical color thresholds for temperature and disk
Temperature turns yellow at 70°C, red at 80°C using built-in waybar
states. Disk replaced with custom script that turns yellow at 80% full,
red at 90%, working across ZFS/btrfs/ext4. Colors themed per dupre/hudson.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'dotfiles/hyprland')
| -rw-r--r-- | dotfiles/hyprland/.config/themes/dupre/waybar.css | 20 | ||||
| -rw-r--r-- | dotfiles/hyprland/.config/themes/hudson/waybar.css | 20 | ||||
| -rw-r--r-- | dotfiles/hyprland/.config/waybar/config | 10 | ||||
| -rw-r--r-- | dotfiles/hyprland/.config/waybar/style.css | 20 | ||||
| -rwxr-xr-x | dotfiles/hyprland/.local/bin/waybar-disk | 7 |
5 files changed, 67 insertions, 10 deletions
diff --git a/dotfiles/hyprland/.config/themes/dupre/waybar.css b/dotfiles/hyprland/.config/themes/dupre/waybar.css index c5333f5..18ba0f1 100644 --- a/dotfiles/hyprland/.config/themes/dupre/waybar.css +++ b/dotfiles/hyprland/.config/themes/dupre/waybar.css @@ -49,7 +49,7 @@ window#waybar { #cpu, #temperature, #memory, -#disk, +#custom-disk, #custom-netspeed, #battery, #wireplumber, @@ -73,7 +73,7 @@ window#waybar { #cpu:hover, #temperature:hover, #memory:hover, -#disk:hover, +#custom-disk:hover, #custom-netspeed:hover, #wireplumber:hover, #sysmonitor:hover, @@ -94,6 +94,22 @@ window#waybar { color: #d47c59; } +#temperature.warning { + color: #d7af5f; +} + +#temperature.critical { + color: #d47c59; +} + +#custom-disk.warning { + color: #d7af5f; +} + +#custom-disk.critical { + color: #d47c59; +} + #battery.warning { color: #d7af5f; } diff --git a/dotfiles/hyprland/.config/themes/hudson/waybar.css b/dotfiles/hyprland/.config/themes/hudson/waybar.css index 4ee0615..299f1c2 100644 --- a/dotfiles/hyprland/.config/themes/hudson/waybar.css +++ b/dotfiles/hyprland/.config/themes/hudson/waybar.css @@ -49,7 +49,7 @@ window#waybar { #cpu, #temperature, #memory, -#disk, +#custom-disk, #custom-netspeed, #battery, #wireplumber, @@ -73,7 +73,7 @@ window#waybar { #cpu:hover, #temperature:hover, #memory:hover, -#disk:hover, +#custom-disk:hover, #custom-netspeed:hover, #wireplumber:hover, #sysmonitor:hover, @@ -94,6 +94,22 @@ window#waybar { color: #ff5858; } +#temperature.warning { + color: #daa520; +} + +#temperature.critical { + color: #ff5858; +} + +#custom-disk.warning { + color: #daa520; +} + +#custom-disk.critical { + color: #ff5858; +} + #battery.warning { color: #daa520; } diff --git a/dotfiles/hyprland/.config/waybar/config b/dotfiles/hyprland/.config/waybar/config index 5b9879e..fdff160 100644 --- a/dotfiles/hyprland/.config/waybar/config +++ b/dotfiles/hyprland/.config/waybar/config @@ -28,7 +28,7 @@ "cpu", "temperature", "memory", - "disk", + "custom/disk", "battery" ] }, @@ -62,6 +62,7 @@ "interval": 10, "hwmon-path-abs": "/sys/devices/pci0000:00/0000:00:18.3/hwmon", "input-filename": "temp1_input", + "warning-threshold": 70, "critical-threshold": 80, "format": "<span size='large'></span> {temperatureC}°C", "format-critical": "<span size='large'></span> {temperatureC}°C", @@ -74,10 +75,11 @@ "on-click": "toggle-scratchpad monitor" }, - "disk": { + "custom/disk": { + "exec": "waybar-disk", + "return-type": "json", "interval": 30, - "format": "<span size='large'></span> {percentage_used}%", - "path": "/", + "format": "<span size='large'></span> {}", "on-click": "toggle-scratchpad monitor" }, diff --git a/dotfiles/hyprland/.config/waybar/style.css b/dotfiles/hyprland/.config/waybar/style.css index 4ee0615..299f1c2 100644 --- a/dotfiles/hyprland/.config/waybar/style.css +++ b/dotfiles/hyprland/.config/waybar/style.css @@ -49,7 +49,7 @@ window#waybar { #cpu, #temperature, #memory, -#disk, +#custom-disk, #custom-netspeed, #battery, #wireplumber, @@ -73,7 +73,7 @@ window#waybar { #cpu:hover, #temperature:hover, #memory:hover, -#disk:hover, +#custom-disk:hover, #custom-netspeed:hover, #wireplumber:hover, #sysmonitor:hover, @@ -94,6 +94,22 @@ window#waybar { color: #ff5858; } +#temperature.warning { + color: #daa520; +} + +#temperature.critical { + color: #ff5858; +} + +#custom-disk.warning { + color: #daa520; +} + +#custom-disk.critical { + color: #ff5858; +} + #battery.warning { color: #daa520; } diff --git a/dotfiles/hyprland/.local/bin/waybar-disk b/dotfiles/hyprland/.local/bin/waybar-disk new file mode 100755 index 0000000..6050653 --- /dev/null +++ b/dotfiles/hyprland/.local/bin/waybar-disk @@ -0,0 +1,7 @@ +#!/bin/sh +# Waybar disk usage module with warning/critical states +PCT=$(df --output=pcent / | tail -1 | tr -d ' %') +CLASS="" +[ "$PCT" -ge 80 ] && CLASS="warning" +[ "$PCT" -ge 90 ] && CLASS="critical" +printf '{"text": "%s%%", "class": "%s", "tooltip": "Root: %s%% used"}\n' "$PCT" "$CLASS" "$PCT" |
