From 0a1a0582e07910f59de1ea10d2bd984668cfb442 Mon Sep 17 00:00:00 2001 From: awy Date: Thu, 2 Oct 2025 18:35:12 +0300 Subject: upd --- .local/bin/cron/newsup | 4 ++-- .local/bin/sb-news | 10 +++++----- .local/bin/sb-pacpackages | 29 +++++++++++++++++++++++++++++ .local/bin/sb-popupgrade | 9 +++++++++ 4 files changed, 45 insertions(+), 7 deletions(-) create mode 100755 .local/bin/sb-pacpackages create mode 100755 .local/bin/sb-popupgrade (limited to '.local/bin') diff --git a/.local/bin/cron/newsup b/.local/bin/cron/newsup index a7cc907..2fb090c 100755 --- a/.local/bin/cron/newsup +++ b/.local/bin/cron/newsup @@ -10,9 +10,9 @@ export WAYLAND_DISPLAY=wayland-1 pgrep -f newsraft$ && hyprctl --instance 0 dispatch sendshortcut ,R ,title:newsraft && exit -echo "" > /tmp/newsupdate +echo 🔃 > /tmp/newsupdate pkill -RTMIN+6 "${STATUSBAR:-waybar}" /usr/bin/newsraft -e reload-all rm -f /tmp/newsupdate pkill -RTMIN+6 "${STATUSBAR:-waybar}" -/usr/bin/notify-send "󰎕 RSS feed update complete." +/usr/bin/notify-send "📰 RSS feed update complete." diff --git a/.local/bin/sb-news b/.local/bin/sb-news index 01ec705..a95576d 100755 --- a/.local/bin/sb-news +++ b/.local/bin/sb-news @@ -6,12 +6,12 @@ case $BLOCK_BUTTON in 1) setsid "$TERMINAL" -T newsraft -e newsraft >/dev/null 2>&1 ;; 2) setsid -f newsup >/dev/null && exit ;; - 3) notify-send "󰎕 News module" "\- Shows unread news items -- Shows  if updating with \`newsup\` -- Left click opens newsraft + 3) notify-send "📰 News module" "\- Shows unread news items +- Shows 🔃 if updating with \`newsup\` +- Left click opens newsboat - Middle click syncs RSS feeds -Note: Only one instance of newsraft (including updates) may be running at a time." ;; +Note: Only one instance of newsboat (including updates) may be running at a time." ;; 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;; esac -bat /tmp/newsupdate 2>/dev/null || echo "$(newsraft -e print-unread-items-count | awk '{ if($1>0) print "󰎕 " $1}')$(bat "${XDG_CONFIG_HOME:-$HOME/.config}"/newsraft/.update 2>/dev/null)" +bat /tmp/newsupdate 2>/dev/null || echo "$(newsraft -e print-unread-items-count | awk '{ if($1>0) print "📰" $1}')$(bat "${XDG_CONFIG_HOME:-$HOME/.config}"/newsraft/.update 2>/dev/null)" diff --git a/.local/bin/sb-pacpackages b/.local/bin/sb-pacpackages new file mode 100755 index 0000000..5ef09d3 --- /dev/null +++ b/.local/bin/sb-pacpackages @@ -0,0 +1,29 @@ +#!/bin/sh + +# Displays number of upgradeable packages. +# For this to work, have a `pacman -Sy` command run in the background as a +# cronjob every so often as root. This script will then read those packages. +# When clicked, it will run an upgrade via pacman. +# +# Add the following text as a file in /usr/share/libalpm/hooks/statusbar.hook: +# +# [Trigger] +# Operation = Upgrade +# Type = Package +# Target = * +# +# [Action] +# Description = Updating statusbar... +# When = PostTransaction +# Exec = /usr/bin/pkill -RTMIN+8 dwmblocks # Or i3blocks if using i3. + +case $BLOCK_BUTTON in + 1) setsid -f "$TERMINAL" -e sb-popupgrade >/dev/null 2>&1 ;; + 2) notify-send "$(/usr/bin/pacman -Qu)" ;; + 3) notify-send "󰚰 Upgrade module" ": number of upgradable packages +- Left click to upgrade packages +- Middle click to show upgradable packages" ;; + 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" >/dev/null 2>&1 ;; +esac + +pacman -Qu | rg -Fcv "[ignored]" | sed "s/^/ /;s/^ 0$//g" diff --git a/.local/bin/sb-popupgrade b/.local/bin/sb-popupgrade new file mode 100755 index 0000000..94279c8 --- /dev/null +++ b/.local/bin/sb-popupgrade @@ -0,0 +1,9 @@ +#!/bin/sh + +printf "Beginning upgrade.\\n" + +paru +pkill -RTMIN+8 "${STATUSBAR:-waybar}" + +printf "\\nUpgrade complete.\\nPress to exit window.\\n\\n" +read -r _ -- cgit v1.2.3