From ff4007d988d95d69dbe59b24c4234dc454f98d84 Mon Sep 17 00:00:00 2001 From: mitchell Date: Mon, 28 Feb 2022 03:13:49 -0500 Subject: [PATCH] Add ytmpv function and scripts folder --- .config/fish/functions/ytmpv.fish | 34 +++++++++++++++++++++++++++++++ scripts/jmpv | 2 ++ scripts/redisco | 2 ++ scripts/ytmpv | 2 ++ sync | 5 +++++ 5 files changed, 45 insertions(+) create mode 100644 .config/fish/functions/ytmpv.fish create mode 100755 scripts/jmpv create mode 100755 scripts/redisco create mode 100755 scripts/ytmpv diff --git a/.config/fish/functions/ytmpv.fish b/.config/fish/functions/ytmpv.fish new file mode 100644 index 0000000..2413481 --- /dev/null +++ b/.config/fish/functions/ytmpv.fish @@ -0,0 +1,34 @@ +function ytmpv -d 'A script to help queue youtube videos on MPV' + if not set -Uq _ytmpv_video_queue + set -U _ytmpv_video_queue + end + + while read -P 'url(s)/command (play)> ' -l video + switch $video + case cl clear + clear + case c copy + set -l video (fromcb) + set -U _ytmpv_video_queue $_ytmpv_video_queue (string split ' ' $video) + case d destroy + set -Ue _ytmpv_video_queue + case f fg + tmux attach -t ytmpv + case h help + functions ytmpv + case l list + string split ' ' $_ytmpv_video_queue + case p play + break + case q quit + return + case '*' + test -z "$video"; and break + set -U _ytmpv_video_queue $_ytmpv_video_queue (string split ' ' $video) + end + end + + tmux attach -t ytmpv + tmux new-session -s ytmpv -- mpv --save-position-on-quit $_ytmpv_video_queue + ytmpv +end diff --git a/scripts/jmpv b/scripts/jmpv new file mode 100755 index 0000000..ce521a8 --- /dev/null +++ b/scripts/jmpv @@ -0,0 +1,2 @@ +#!/usr/bin/sh +kitty tmux new-session -s jmpv jellyfin-mpv-shim diff --git a/scripts/redisco b/scripts/redisco new file mode 100755 index 0000000..e3271ce --- /dev/null +++ b/scripts/redisco @@ -0,0 +1,2 @@ +#!/usr/bin/env fish +redisco diff --git a/scripts/ytmpv b/scripts/ytmpv new file mode 100755 index 0000000..7c22d0f --- /dev/null +++ b/scripts/ytmpv @@ -0,0 +1,2 @@ +#!/usr/bin/sh +kitty fish -c ytmpv diff --git a/sync b/sync index f1962d7..898c83e 100755 --- a/sync +++ b/sync @@ -56,6 +56,10 @@ function sync_terminal_env mkdir ~/.config end + if ! test -e ~/code/scripts + mkdir -p ~/code/scripts + end + rsync -aP ./.config/fish ~/.config/ and rsync -aP ./.config/nvim ~/.config/ and rsync -aP ./.tmux-line.conf ~/ @@ -63,6 +67,7 @@ function sync_terminal_env and rsync -aP ./.vim ~/ and rsync -aP ./.vimrc ~/ and rsync -aP ./.taskrc ~/ + and rsync -aP ./scripts/ ~/code/scripts/ end function sync_desktop_env -a uname