From b26a5435e792920da7fc9d3bf2a76762114c2cd0 Mon Sep 17 00:00:00 2001
From: Jacob Babor <jacob@babor.tech>
Date: Sat, 8 Feb 2025 23:31:38 -0600
Subject: [PATCH] Add module for staged rpm-ostree deployments

---
 hyprland/.config/waybar/config    | 9 ++++++++-
 hyprland/.config/waybar/style.css | 4 ++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/hyprland/.config/waybar/config b/hyprland/.config/waybar/config
index f491c217..9e175186 100644
--- a/hyprland/.config/waybar/config
+++ b/hyprland/.config/waybar/config
@@ -35,7 +35,7 @@
 	"margin-bottom": 16,
 	"margin-left": 16,
 	"margin-right": 16,
-	"modules-left": ["gamemode", "custom/flatpak", "custom/backup", "battery", "temperature", "cpu", "memory", "network"],
+	"modules-left": ["gamemode", "custom/flatpak", "custom/backup", "custom/rpm-ostree-staged", "battery", "temperature", "cpu", "memory", "network"],
 	"modules-center": [],
 	"modules-right": ["mpris", "pulseaudio", "backlight", "idle_inhibitor", "clock"],
 	"clock": {
@@ -132,6 +132,13 @@
 	"custom/backup": {
 		"interval": 60,
 		"format": "",
+		"tooltip-format": "The last backup job failed -- investigate backup.service for more details",
 		"exec": "systemctl is-failed backup.service"
+	},
+	"custom/rpm-ostree-staged": {
+		"interval": 60,
+		"format": "",
+		"tooltip-format": "An rpm-ostree deployment is pending and will be applied upon the next reboot",
+		"exec": "rpm-ostree status --json | jq -e '.deployments[0].staged'"
 	}
 }]
diff --git a/hyprland/.config/waybar/style.css b/hyprland/.config/waybar/style.css
index 57c7e72a..cd455f87 100644
--- a/hyprland/.config/waybar/style.css
+++ b/hyprland/.config/waybar/style.css
@@ -208,3 +208,7 @@ window#waybar.fullscreen #window {
 	color: rgba(235, 219, 178, 0.2);
 	padding: 0 1em;
 }
+#custom-rpm-ostree-staged {
+	color: rgba(235, 219, 178, 0.2);
+	padding: 0 1em;
+}