add romote, yt, and yt_music scripts

This commit is contained in:
steven 2025-04-21 00:07:11 -04:00
parent 347b8b1d1c
commit 97ebea9a88
4 changed files with 78 additions and 2 deletions

13
scripts/yt Executable file
View file

@ -0,0 +1,13 @@
#!/bin/sh
search="https://music.youtube.com/search?q="
if [ -z "$format" ]; then
options="--keep-open=yes"
search="ytsearch"
format="bv[height<=720]+ba/b"
fi
[ "$#" -gt 0 ] && url="$*" || url="$(timeout 0.1 cat)"
[ -z "$url" ] && url="$(wl-paste)"
[ -z "$url" ] && url="https://youtu.be/dQw4w9WgXcQ"
notify-send -t 1000 "$url" & mpv $options --ytdl-raw-options=default-search=$search --ytdl-format="$format" ytdl://"$url" || notify-send -t 3000 "Failed to play youtube video"