From 9c7344efb4e3d663d26ddb81699c6572bbcfd148 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sun, 28 May 2023 16:32:53 -0700 Subject: tools/waybar-systemd-units: get a list of failed systemd units Get a list of failed systemd units (both user and systems), and generate an output compatible to what waybar expects. Refer to https://github.com/Alexays/Waybar/wiki/Module:-Custom for more details about the format. --- home/profiles/dev.nix | 1 + home/profiles/waybar.nix | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'home/profiles') diff --git a/home/profiles/dev.nix b/home/profiles/dev.nix index c1323d6..3dc5271 100644 --- a/home/profiles/dev.nix +++ b/home/profiles/dev.nix @@ -10,6 +10,7 @@ let }); pythonEnv = pkgs.python3.withPackages (p: with p; [ black + click isort pylsp-mypy requests diff --git a/home/profiles/waybar.nix b/home/profiles/waybar.nix index a7e1ff0..4a31377 100644 --- a/home/profiles/waybar.nix +++ b/home/profiles/waybar.nix @@ -13,7 +13,7 @@ margin-right = 0; margin-bottom = 0; modules-left = [ "sway/workspaces" "sway/mode" ]; - modules-right = [ "pulseaudio" "network" "battery" "clock" "tray" ]; + modules-right = [ "custom/systemd" "pulseaudio" "network" "battery" "clock" "tray" ]; "sway/workspaces" = { format = "{name}"; disable-scroll = true; @@ -30,6 +30,12 @@ tooltip = true; tooltip-format = "{timeTo} ({capacity}%)"; }; + "custom/systemd" = { + exec = "${pkgs.tools.waybar-systemd-units}/bin/waybar-systemd-units"; + format = "failed units: {}"; + return-type = "json"; + interval = 60; + }; pulseaudio = { format = "vol:{volume}%"; format-bluetooth = "bt:{volume}%"; @@ -101,5 +107,8 @@ #pulseaudio.muted { color: #8c8f91; } + #custom-systemd.errors { + border-bottom: 2px solid #ef8773; + } ''; } -- cgit 1.4.1