dots

default description
git clone https://git.awy.one/dots.git
Log | Files | Refs | README | LICENSE

commit 2350ba755e62ec49dee093cd357dfcc8cec3434e
parent e08495326c533ace39c35624586d09a86899f981
Author: awy <awy@awy.one>
Date:   Sun, 14 Dec 2025 23:44:05 +0300

newsraft

Diffstat:
M.local/bin/cron/newsup | 8++++----
M.local/bin/statusbar/sb-news | 9++++++++-
2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/.local/bin/cron/newsup b/.local/bin/cron/newsup @@ -1,15 +1,15 @@ #!/bin/sh -# Set as a cron job to check for new RSS entries for newsboat. -# If newsboat is open, sends it an "R" key to refresh. +# Set as a cron job to check for new RSS entries for newsraft. +# If newsraft is open, sends it an "R" key to refresh. export XDG_RUNTIME_DIR=/run/user/1000 export WAYLAND_DISPLAY=wayland-1 -pgrep -f newsboat$ && /usr/bin/wlrctl window focus title:newsboat && /usr/bin/wlrctl keyboard type R && exit +pgrep -f newsraft$ && /usr/bin/wlrctl window focus title:newsraft && /usr/bin/wlrctl keyboard type R && exit echo "<span color='#7F7F7F'>[updating]</span>" > /tmp/newsupdate pkill -RTMIN+6 "${STATUSBAR:-i3blocks}" -/usr/bin/newsboat -x reload +/usr/bin/newsraft -e reload-all rm -f /tmp/newsupdate pkill -RTMIN+6 "${STATUSBAR:-i3blocks}" diff --git a/.local/bin/statusbar/sb-news b/.local/bin/statusbar/sb-news @@ -6,4 +6,11 @@ case $BLOCK_BUTTON in 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;; esac -cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ if($1>0) print $1}')$(bat "${XDG_CONFIG_HOME:-$HOME/.config}"/newsboat/.update 2>/dev/null)" +if [ ! -f /tmp/newsupdate ]; then + count=$(newsraft -e print-unread-items-count) + if [ "$count" != 0 ]; then + printf "%s\n" "$count" + fi +else + cat /tmp/newsupdate 2>/dev/null +fi