about summary refs log tree commit diff
path: root/home/wm/waybar/waybar-systemd.sh
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2023-05-05 19:41:58 -0700
committerFranck Cuny <franck@fcuny.net>2023-05-05 19:41:58 -0700
commit43da9edb4598eef509c481ae0b305384418c45de (patch)
treea0ad614c90102757143e026e4fe1806431a3dbf4 /home/wm/waybar/waybar-systemd.sh
parentprofiles/default: users are immutable (diff)
downloadworld-43da9edb4598eef509c481ae0b305384418c45de.tar.gz
home/profiles: move (almost) all modules to profiles
This is a major refactor, similar to what was done for the hosts, but in
a single commit.
Diffstat (limited to 'home/wm/waybar/waybar-systemd.sh')
-rwxr-xr-xhome/wm/waybar/waybar-systemd.sh22
1 files changed, 0 insertions, 22 deletions
diff --git a/home/wm/waybar/waybar-systemd.sh b/home/wm/waybar/waybar-systemd.sh
deleted file mode 100755
index bf4e8b8..0000000
--- a/home/wm/waybar/waybar-systemd.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/env bash
-
-failed_user="$(systemctl --plain --no-legend --user list-units --state=failed | awk '{ print $1 }')"
-failed_system="$(systemctl --plain --no-legend list-units --state=failed | awk '{ print $1 }')"
-
-failed_systemd_count="$(echo -n "$failed_system" | grep -c '^')"
-failed_user_count="$(echo -n "$failed_user" | grep -c '^')"
-
-text=$(( failed_systemd_count + failed_user_count ))
-
-if [ "$text" -eq 0 ]; then
-    printf '{"text": ""}\n'
-else
-    tooltip=""
-
-    [ -n "$failed_system" ] && tooltip="Failed system services:\n\n${failed_system}\n\n${tooltip}"
-    [ -n "$failed_user" ]   && tooltip="Failed user services:\n\n${failed_user}\n\n${tooltip}"
-
-    tooltip="$(printf  "%s" "$tooltip" | perl -pe 's/\n/\\n/g' | perl -pe 's/(?:\\n)+$//')"
-
-    printf '{"text": "%s", "tooltip": "%s" }\n' "$text" "$tooltip"
-fi