From 1befab8b2230419d12bfe0a41b5867095a671d7d Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Thu, 19 Feb 2026 19:15:35 +0900 Subject: modified shell/aliasrc, modified cron/crontog, modified statusbar/sb-clock --- ar/.config/shell/aliasrc | 12 ++++++------ ar/.local/bin/cron/crontog | 5 ++++- ar/.local/bin/statusbar/sb-clock | 14 +++++++------- 3 files changed, 17 insertions(+), 14 deletions(-) (limited to 'ar') diff --git a/ar/.config/shell/aliasrc b/ar/.config/shell/aliasrc index e5a2bc9..3b2b693 100644 --- a/ar/.config/shell/aliasrc +++ b/ar/.config/shell/aliasrc @@ -493,10 +493,10 @@ alias ylogh='ylog -s hidden -c us | grep $(LC_TIME=C date +%d/%b) | grep -E "[0- alias ylogH='ylog -s hidden -c us | grep $(LC_TIME=C date -d "1 days ago" +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' alias ylogp='ylog -s peertube | grep $(LC_TIME=C date +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' alias ylogP='ylog -s peertube | grep $(LC_TIME=C date -d "1 days ago" +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' -alias ylogy='ylog -s diary -c us | grep $(LC_TIME=C date -d "1 days ago" +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' -alias ylogY='ylog -s diary -c us | grep $(LC_TIME=C date +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' -alias ylogr='ylog -s diary -c us | grep $(LC_TIME=C date -d "2 days ago" +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' -alias ylogR='ylog -s recordings -c us | grep $(LC_TIME=C date -d "2 days ago" +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' -alias ylogt='ylog -s recordings -c us | grep $(LC_TIME=C date +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' -alias ylogT='ylog -s recordings -c us | grep $(LC_TIME=C date -d "1 days ago" +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' +alias ylogd='ylog -s diary -c us | grep $(LC_TIME=C date +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' +alias ylogD='ylog -s diary -c us | grep $(LC_TIME=C date -d "1 days ago" +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' +alias ylogt='ylog -s diary -c us | grep $(LC_TIME=C date -d "2 days ago" +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' +alias ylogr='ylog -s recordings -c us | grep $(LC_TIME=C date +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' +alias ylogR='ylog -s recordings -c us | grep $(LC_TIME=C date -d "1 days ago" +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' +alias ylogT='ylog -s recordings -c us | grep $(LC_TIME=C date -d "2 days ago" +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "' alias ylogu='ylog -s diary -c us' diff --git a/ar/.local/bin/cron/crontog b/ar/.local/bin/cron/crontog index ccabe61..68fcd5a 100755 --- a/ar/.local/bin/cron/crontog +++ b/ar/.local/bin/cron/crontog @@ -6,7 +6,7 @@ cron_file="${XDG_CONFIG_HOME:-$HOME/.config}/crons" # Check if there are any active cronjobs -if crontab -l 2>/dev/null | grep -q '^[^#[:space:]]'; then +if crontab -l 2>/dev/null | grep -qv '^#\|^$'; then # If active cronjobs are found, save and disable them ln -sf "${XDG_DOTFILES_DIR:-${HOME}/.dotfiles}/$(whereami)/.config/crons" "${XDG_CONFIG_HOME:-${HOME}/.config}/crons" crontab -r @@ -22,5 +22,8 @@ else fi fi +# Invalidate sb-clock cache so icon updates immediately +rm -f "${XDG_CACHE_HOME:-${HOME}/.cache}/crontab/cronjobs" + # Notify status bar to update pkill -RTMIN+2 "${STATUSBAR:-dwmblocks}" diff --git a/ar/.local/bin/statusbar/sb-clock b/ar/.local/bin/statusbar/sb-clock index 6aa1bb4..ddfa28b 100755 --- a/ar/.local/bin/statusbar/sb-clock +++ b/ar/.local/bin/statusbar/sb-clock @@ -5,14 +5,14 @@ calendar="🗓" hour=$(date '+%I') minute=$(date '+%M') -# Cache crontab check for 5 minutes -crontab_cache="${XDG_CACHE_HOME:-${HOME}/.cache}/statusbar/has_crontab" +# Cache cron daemon check for 5 minutes +crontab_cache="${XDG_CACHE_HOME:-${HOME}/.cache}/crontab/cronjobs" if [ ! -f "$crontab_cache" ] || [ $(($(date +%s) - $(stat -c %Y "$crontab_cache" 2>/dev/null || echo 0))) -gt 300 ]; then - mkdir -p "${XDG_CACHE_HOME:-${HOME}/.cache}/statusbar" - if crontab -l 2>/dev/null | grep -q '^[^#[:space:]]'; then - echo "1" > "$crontab_cache" + mkdir -p "${XDG_CACHE_HOME:-${HOME}/.cache}/crontab" + if crontab -l 2>/dev/null | grep -qv '^#\|^$'; then + echo "1" >"$crontab_cache" else - echo "0" > "$crontab_cache" + echo "0" >"$crontab_cache" fi fi @@ -60,7 +60,7 @@ moonfile="${XDG_DATA_HOME:-${HOME}/.local/share}/wallpapers/moonphase" # Cache location for 24 hours if [ ! -s "$locationfile" ] || [ $(($(date +%s) - $(stat -c %Y "$locationfile" 2>/dev/null || echo 0))) -gt 86400 ]; then mkdir -p "${XDG_CACHE_HOME:-${HOME}/.cache}/statusbar" - curl -s --max-time 2 http://ip-api.com/json | jq -r '[.regionName, .countryCode] | join(",")' > "$locationfile" 2>/dev/null & + curl -s --max-time 2 http://ip-api.com/json | jq -r '[.regionName, .countryCode] | join(",")' >"$locationfile" 2>/dev/null & fi location=$(cat "$locationfile" 2>/dev/null || echo "") -- cgit v1.2.3