diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/common/ytclipo | 2 | ||||
-rwxr-xr-x | bin/extra/append2mpv | 30 | ||||
-rwxr-xr-x | bin/extra/sgimg | 6 |
3 files changed, 37 insertions, 1 deletions
diff --git a/bin/common/ytclipo b/bin/common/ytclipo index 5d86c3f..8997539 100755 --- a/bin/common/ytclipo +++ b/bin/common/ytclipo @@ -23,5 +23,5 @@ yt-dlp "$inp" \ -f "b" \ -S "res:1080" \ -P "$HOME/vids/youtube/" \ - -o "%(channel)s - %(title)s.%(ext)s" + -o "%(channel)s/%(title)s.%(ext)s" notify-send "ytclipo" "finished downloading." || : diff --git a/bin/extra/append2mpv b/bin/extra/append2mpv new file mode 100755 index 0000000..28c3916 --- /dev/null +++ b/bin/extra/append2mpv @@ -0,0 +1,30 @@ +#!/bin/sh +IPC="/tmp/mpvsocket" + +die () { >&2 printf '%s\n' "$@"; exit 1; } +append_to_mpv() +{ + file="$(readlink -f "$1")" + if [ ! -r "$file" ] + then + >&2 printf '%s\n' "'$file' not found" + return + fi + + echo '{ "command": ["loadfile", "'"$file"'", "append"] }' | + socat - "$IPC" +} + +[ -S "$IPC" ] || die "$IPC is not a socket or doesn't exist" +which socat > /dev/null || exit 1 + + +if [ -t 0 ] +then + append_to_mpv "$1" +else + while read -r file + do + append_to_mpv "$file" + done +fi diff --git a/bin/extra/sgimg b/bin/extra/sgimg new file mode 100755 index 0000000..7c1823c --- /dev/null +++ b/bin/extra/sgimg @@ -0,0 +1,6 @@ +#!/bin/sh + +imv "$(find ~/.local/share/gurk/ -type f -printf "%A@\t%p\n" | + sort -n | + tail -n 1 | + cut -f 2-)" |