Clean up config, include .beats and updates

Amolith created

Change summary

dot_config/polybar/config.ini.tmpl                        |  5 +
dot_config/polybar/executable_updates-pacman-aurhelper.sh | 21 ---------
dot_config/waybar/config.tmpl                             | 18 +++++--
dot_config/waybar/style.css.tmpl                          |  1 
dot_local/bin/executable_beats                            |  3 +
dot_local/bin/executable_pending-updates                  | 17 +++++++
6 files changed, 37 insertions(+), 28 deletions(-)

Detailed changes

dot_config/polybar/config.ini.tmpl 🔗

@@ -218,9 +218,10 @@ ramp-volume-2 = "󰕾"
 
 [module/updates]
 type = custom/script
-exec = ~/.config/polybar/updates-pacman-aurhelper.sh
+exec = ~/.local/bin/pending-updates
 interval = 1800
-click-left = st zsh -c 'yay'
+click-left = elacritty -e zsh -c 'yay'
+format-prefix = "󱄋 "
 
 [global/wm]
 margin-top = 5

dot_config/polybar/executable_updates-pacman-aurhelper.sh 🔗

@@ -1,21 +0,0 @@
-#!/bin/sh
-
-if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then
-    updates_arch=0
-fi
-
-if ! updates_aur=$(yay -Qum 2> /dev/null | wc -l); then
-# if ! updates_aur=$(cower -u 2> /dev/null | wc -l); then
-# if ! updates_aur=$(trizen -Su --aur --quiet | wc -l); then
-# if ! updates_aur=$(pikaur -Qua 2> /dev/null | wc -l); then
-# if ! updates_aur=$(rua upgrade --printonly 2> /dev/null | wc -l); then
-    updates_aur=0
-fi
-
-updates=$(("$updates_arch" + "$updates_aur"))
-
-if [ "$updates" -gt 0 ]; then
-    echo "󱄋  $updates"
-else
-    echo ""
-fi

dot_config/waybar/config.tmpl 🔗

@@ -2,7 +2,7 @@
     "layer": "top", // Waybar at top layer
     "spacing": 5,
     "modules-left": ["hyprland/workspaces", "hyprland/window"],
-    "modules-right": ["idle_inhibitor", "pulseaudio", "network", "cpu", "memory", "temperature", "backlight",  "battery", {{ if eq .chezmoi.hostname "angmar" }}"clock#date", {{ end }}"clock#all", "custom/beats", "tray"],
+    "modules-right": ["idle_inhibitor", "custom/pending-updates", "pulseaudio", "network", "cpu", "memory", "temperature", "backlight",  "battery", {{ if eq .chezmoi.hostname "angmar" }}"clock#date", {{ end }}"clock#all", "custom/beats", "tray"],
     "hyprland/workspaces": {
         "disable-scroll": true,
         "all-outputs": true,
@@ -11,6 +11,13 @@
     "hyprland/window": {
         "format": "   {}"
     },
+    "custom/pending-updates": {
+        "format": "{} 󱄋",
+        "tooltip": false,
+        "exec-if": "/usr/bin/carpd",
+        "exec": "/usr/bin/carpd",
+        "restart-interval": 3600,
+    },
     "idle_inhibitor": {
         "format": "{icon}",
         "format-icons": {
@@ -58,11 +65,12 @@
         },
     },
     "custom/beats": {
-        "exec-if": "/usr/bin/swatchtime",
-        "exec": "echo \"@`swatchtime -f {Beat}`\"",
+        "format": "{} 󱇼",
+        "tooltip": false,
+        "exec-if": "/home/amolith/.local/bin/beats",
+        "exec": "/home/amolith/.local/bin/beats",
         "return-type": "",
-        "interval": 0.5,
-        "format": "{} 󱇼"
+        "restart-interval": 1,
     },
     "cpu": {
         "format": "{usage}% ",

dot_local/bin/executable_pending-updates 🔗

@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+
+if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then
+    updates_arch=0
+fi
+
+if ! updates_aur=$(yay -Qum 2> /dev/null | wc -l); then
+    updates_aur=0
+fi
+
+updates=$(("$updates_arch" + "$updates_aur"))
+
+if [ "$updates" -gt 0 ]; then
+    echo "$updates"
+else
+    echo ""
+fi