aboutsummaryrefslogtreecommitdiff
path: root/.local/bin
diff options
context:
space:
mode:
authorawy <awy@awy.one>2025-10-02 18:35:12 +0300
committerawy <awy@awy.one>2025-10-02 18:35:12 +0300
commit0a1a0582e07910f59de1ea10d2bd984668cfb442 (patch)
tree5c81f07ac82adab1eccab834dfcd3cbabffa2fd0 /.local/bin
parent871880e95058f65537f54cc669cbcf3100931f28 (diff)
downloadhyprdots-0a1a0582e07910f59de1ea10d2bd984668cfb442.tar.gz
upd
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/cron/newsup4
-rwxr-xr-x.local/bin/sb-news10
-rwxr-xr-x.local/bin/sb-pacpackages29
-rwxr-xr-x.local/bin/sb-popupgrade9
4 files changed, 45 insertions, 7 deletions
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
-<b>Note:</b> Only one instance of newsraft (including updates) may be running at a time." ;;
+<b>Note:</b> 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 <Enter> to exit window.\\n\\n"
+read -r _