From 84c6badd7370884d234887bdfda17f1d011b9f79 Mon Sep 17 00:00:00 2001 From: Amolith Date: Fri, 16 Feb 2024 16:39:16 -0500 Subject: [PATCH] Clean up config, include .beats and updates --- dot_config/polybar/config.ini.tmpl | 5 +++-- .../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(-) delete mode 100644 dot_config/polybar/executable_updates-pacman-aurhelper.sh create mode 100644 dot_local/bin/executable_beats create mode 100644 dot_local/bin/executable_pending-updates diff --git a/dot_config/polybar/config.ini.tmpl b/dot_config/polybar/config.ini.tmpl index aef091944d36ed36e03ade4994f1c10937cad669..374a62cb8430710fe8a58ff3af38ac7eea945edc 100644 --- a/dot_config/polybar/config.ini.tmpl +++ b/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 diff --git a/dot_config/polybar/executable_updates-pacman-aurhelper.sh b/dot_config/polybar/executable_updates-pacman-aurhelper.sh deleted file mode 100644 index a3dce036da173567da94769f6b4f5c185a123c25..0000000000000000000000000000000000000000 --- a/dot_config/polybar/executable_updates-pacman-aurhelper.sh +++ /dev/null @@ -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 diff --git a/dot_config/waybar/config.tmpl b/dot_config/waybar/config.tmpl index 1e7f9abd7e25a6c60a8b02f6aef040753d345852..d297984dee3a3929c077083fba0b306bd2123fe8 100644 --- a/dot_config/waybar/config.tmpl +++ b/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}% ", diff --git a/dot_config/waybar/style.css.tmpl b/dot_config/waybar/style.css.tmpl index 536084cf99428912c8ba1ed10f35c2ed1ec8cb90..3863000dd6ce59cb0107ad0ec9eebf950da4438d 100644 --- a/dot_config/waybar/style.css.tmpl +++ b/dot_config/waybar/style.css.tmpl @@ -58,6 +58,7 @@ button { #battery, #cpu, #custom-beats, +#custom-pending-updates, #memory, #disk, #temperature, diff --git a/dot_local/bin/executable_beats b/dot_local/bin/executable_beats new file mode 100644 index 0000000000000000000000000000000000000000..be48d0e417941a48499db624495b981507f8095f --- /dev/null +++ b/dot_local/bin/executable_beats @@ -0,0 +1,3 @@ +#!/usr/bin/dash + +printf "@$(( ( ( ( $(date "+%s") + 3600 ) % 86400 ) * 10 ) / 864 ))\n" diff --git a/dot_local/bin/executable_pending-updates b/dot_local/bin/executable_pending-updates new file mode 100644 index 0000000000000000000000000000000000000000..b2e051d65de8f37046ba472ec5e37a8bb0d0ceaa --- /dev/null +++ b/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