aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin
diff options
context:
space:
mode:
Diffstat (limited to 'dotfiles/.local/bin')
-rwxr-xr-xdotfiles/.local/bin/bartorrentstatus9
-rwxr-xr-xdotfiles/.local/bin/launch-transmission9
-rwxr-xr-xdotfiles/.local/bin/toggletorrent18
3 files changed, 36 insertions, 0 deletions
diff --git a/dotfiles/.local/bin/bartorrentstatus b/dotfiles/.local/bin/bartorrentstatus
new file mode 100755
index 0000000..637080b
--- /dev/null
+++ b/dotfiles/.local/bin/bartorrentstatus
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# TODO: Count how many torrents are downloading and how many are uploading
+
+if [ -f "$HOME/.cache/transdaemonpid" ] ; then
+ echo ""
+fi
+
+printf ""
diff --git a/dotfiles/.local/bin/launch-transmission b/dotfiles/.local/bin/launch-transmission
new file mode 100755
index 0000000..568d12e
--- /dev/null
+++ b/dotfiles/.local/bin/launch-transmission
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# Start transmission's remote gtk frontend, if the daemon is not running, then start it as well
+
+if ! [ -f "$HOME/.cache/transdaemonpid" ] ; then
+ toggletorrent
+fi
+
+transmission-remote-gtk
diff --git a/dotfiles/.local/bin/toggletorrent b/dotfiles/.local/bin/toggletorrent
new file mode 100755
index 0000000..4c67cc5
--- /dev/null
+++ b/dotfiles/.local/bin/toggletorrent
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+if ! [ -f "$HOME/.cache/transdaemonpid" ] ; then
+ transmission-daemon
+ TRANSPID=$!
+ TRANSEXIT=$?
+ if [ $TRANSEXIT -eq 0 ]; then
+ pkill -RTMIN+10 waybar
+ echo "$TRANSPID" > ~/.cache/transdaemonpid
+ exit
+ fi
+ notify-send " Torrent server" "Error while trying to start Transmission daemon"
+ exit 1
+fi
+
+pkill -f "transmission-daemon"
+rm ~/.cache/transdaemonpid
+pkill -RTMIN+10 waybar