From 1806326c4a4ec9a7a01063edf84b0767c6c0e1c9 Mon Sep 17 00:00:00 2001 From: Stephan Raabe Date: Sun, 10 Sep 2023 15:03:00 +0200 Subject: [PATCH] New check updates module with color indicators for threshholds --- scripts/updatewal-swww.sh | 3 +-- scripts/wallpaper-swww.sh | 3 +-- waybar/modules.json | 7 +++++-- waybar/style.css | 16 +++++++++++++++- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/scripts/updatewal-swww.sh b/scripts/updatewal-swww.sh index d0821ef..a4a5c00 100755 --- a/scripts/updatewal-swww.sh +++ b/scripts/updatewal-swww.sh @@ -20,9 +20,8 @@ wal -q -i ~/wallpaper/ source "$HOME/.cache/wal/colors.sh" # ----------------------------------------------------- -# Copy color file to waybar folder +# Copy selected wallpaper into .cache folder # ----------------------------------------------------- -cp ~/.cache/wal/colors-waybar.css ~/dotfiles/waybar/ cp $wallpaper ~/.cache/current_wallpaper.jpg # ----------------------------------------------------- diff --git a/scripts/wallpaper-swww.sh b/scripts/wallpaper-swww.sh index 2afbd78..3cf3d0e 100755 --- a/scripts/wallpaper-swww.sh +++ b/scripts/wallpaper-swww.sh @@ -28,9 +28,8 @@ if [ "$selected" ]; then source "$HOME/.cache/wal/colors.sh" # ----------------------------------------------------- - # Copy color file to waybar folder + # Copy selected wallpaper into .cache folder # ----------------------------------------------------- - cp ~/.cache/wal/colors-waybar.css ~/dotfiles/waybar/ cp $wallpaper ~/.cache/current_wallpaper.jpg newwall=$(echo $wallpaper | sed "s|$HOME/wallpaper/||g") diff --git a/waybar/modules.json b/waybar/modules.json index 8d69c11..38b3d78 100644 --- a/waybar/modules.json +++ b/waybar/modules.json @@ -67,10 +67,13 @@ // Updates Count "custom/updates": { - "format": " {}", + "format": " {}", + "tooltip-format": "{}", + "escape": true, + "return-type": "json", "exec": "~/dotfiles/scripts/updates.sh", "restart-interval": 600, - "on-click": "alacritty -e yay", + "on-click": "alacritty -e ~/dotfiles/scripts/installupdates.sh", "tooltip": false }, diff --git a/waybar/style.css b/waybar/style.css index 52f064e..1dc6ece 100644 --- a/waybar/style.css +++ b/waybar/style.css @@ -13,7 +13,7 @@ /* ----------------------------------------------------- * Import Pywal colors * ----------------------------------------------------- */ -@import 'colors-waybar.css'; +@import '../../.cache/wal/colors-waybar.css'; /* ----------------------------------------------------- * General @@ -191,6 +191,20 @@ window#waybar.empty #window { opacity:0.8; } +#custom-updates.green { + background-color: #FFFFFF; +} + +#custom-updates.yellow { + background-color: #ff9a3c; + color: #ffffff; +} + +#custom-updates.red { + background-color: #dc2f2f; + color: #ffffff; +} + /* ----------------------------------------------------- * Custom Youtube * ----------------------------------------------------- */