From 05079e906829efb6ebfc05bd538c747fb4b5af6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20=E2=80=9CFrogeye=E2=80=9D=20Preud=27homme?= Date: Mon, 22 Apr 2019 21:58:05 +0200 Subject: [PATCH] Overdue tmux commit --- config/shell/shenv | 2 +- termux/scripts/{tsu => tsu.old} | 0 termux/scripts/yt | 3 ++ termux/services/syncthing.user | 59 +++++++++++++++++++++++++++++++++ 4 files changed, 63 insertions(+), 1 deletion(-) rename termux/scripts/{tsu => tsu.old} (100%) create mode 100755 termux/scripts/yt create mode 100755 termux/services/syncthing.user diff --git a/config/shell/shenv b/config/shell/shenv index cfc5c9d..1738fe9 100644 --- a/config/shell/shenv +++ b/config/shell/shenv @@ -38,7 +38,7 @@ appendpath() { } appendpath '/usr/lib/ccache/bin' -appendpath "$GOPATH" +appendpath "${GOPATH}/bin" appendpath "$HOME/.local/bin" appendpath "$HOME/.scripts" diff --git a/termux/scripts/tsu b/termux/scripts/tsu.old similarity index 100% rename from termux/scripts/tsu rename to termux/scripts/tsu.old diff --git a/termux/scripts/yt b/termux/scripts/yt new file mode 100755 index 0000000..acf97a2 --- /dev/null +++ b/termux/scripts/yt @@ -0,0 +1,3 @@ +#!/data/data/com.termux/files/usr/bin/env bash +cd ~/storage/shared/Movies/NewPipe/ +youtube-dl --all-subs "${@: -1}" diff --git a/termux/services/syncthing.user b/termux/services/syncthing.user new file mode 100755 index 0000000..f37a645 --- /dev/null +++ b/termux/services/syncthing.user @@ -0,0 +1,59 @@ +#!/data/data/com.termux/files/usr/bin/bash +# +# Start Syncthing synchronization service +# + +PIDFILE="$HOME/.local/run/syncthing.pid" +LOGFILE="$HOME/.local/log/syncthing.log" + +start() { + printf "Starting Syncthing: " + start-stop-daemon -p "$PIDFILE" -x syncthing -S -b -N 5 -m -- -logfile="$LOGFILE" -home ~/.config/syncthing + echo "OK" +} + +stop() { + printf "Stopping Syncthing: " + start-stop-daemon -p "$PIDFILE" -x syncthing -K + echo "OK" +} + +status() { + printf "Syncthing: " + PID="$(cat "$PIDFILE" 2> /dev/null)" + if [[ -n "$PID" && -d "/proc/$PID" ]] + then + echo "running" + else + echo "stopped" + fi +} + +log() { + tail "$@" "$LOGFILE" +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload) + stop + start + ;; + status) + status + ;; + log) + shift + log "$@" + ;; + *) + echo "Usage: $0 {start|stop|restart|status|log}" + exit 1 +esac + +exit $?