summaryrefslogtreecommitdiff
path: root/mac/.local/bin/tordone
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-08-23 13:36:06 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-08-23 13:36:06 +0900
commit6baef1437fcf40b1d51c5255af78ab297d361d2c (patch)
treec3c257e026ec3fb32b787839f81d8af0c2e6c7ce /mac/.local/bin/tordone
parent07d294425a98ee5d1e22d03e2b24ae2c76e487c0 (diff)
updates
Diffstat (limited to 'mac/.local/bin/tordone')
-rwxr-xr-xmac/.local/bin/tordone10
1 files changed, 10 insertions, 0 deletions
diff --git a/mac/.local/bin/tordone b/mac/.local/bin/tordone
new file mode 100755
index 0000000..4e097a0
--- /dev/null
+++ b/mac/.local/bin/tordone
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+completed_torrents=$(transmission-remote -n "$USER" -l | grep 100% | awk '{print $1}')
+if [ -n "$completed_torrents" ]; then
+ for torrent_id in $completed_torrents; do
+ transmission-remote -n "$USER" -t "$torrent_id" -r
+ done
+ pkill -RTMIN+22 "${STATUSBAR:-dwmblocks}" && notify-send "✅ Transmission-daemon" "Torrent(s) $TR_TORRENT_NAME has completed downloading. Deleting torrent files."
+ [ -z "$(transmission-remote -n "$USER" -l | grep -v "Sum:")" ] && killall transmission-daemon && notify-send "❌ Transmission-daemon disabled."
+fi