From 0776285cc505846e0487f6be05b5c41f9c169fa2 Mon Sep 17 00:00:00 2001 From: shockrah Date: Sat, 19 Oct 2019 20:33:26 -0700 Subject: [PATCH] soundcloud support for ytdl;newbga actually does second monitor check properly; new music video background script --- musicbg | 17 +++++++++++++++++ newbga | 9 +++++---- ytdl | 8 ++++++-- 3 files changed, 28 insertions(+), 6 deletions(-) create mode 100755 musicbg diff --git a/musicbg b/musicbg new file mode 100755 index 0000000..c0e3986 --- /dev/null +++ b/musicbg @@ -0,0 +1,17 @@ +#!/bin/sh +pkill -9 xwinwrap + +cacheFile="${HOME}/.cache/mpvbg.pid" + +# pick out the music video we want to play in the background +base="$HOME/Videos/Music/" +pape=`ls "${HOME}/Videos/Music/" | shuf | head -n 1` + +mpv="mpv --wid WID --no-config --keepaspect=no --loop \ + --no-border --vd-lavc-fast --x11-bypass-compositor=no \ + --gapless-audio=yes --vo=x11 --hwdec=auto \ + --x11-name=mpvbg" + +xwinwrap -g 1920x1080 -ni -fdt -sh rectangle -un -b -nf -ov -- $mpv "$base/$pape" & #> /dev/null 2>&1 & +echo $! > ${HOME}/.cache/mpvmusic.pid + diff --git a/newbga b/newbga index 0d43248..65d8a2d 100755 --- a/newbga +++ b/newbga @@ -37,8 +37,9 @@ c=`xrandr | grep ' connected' | wc -l` if $c = "1" then exit +else + # Second monitor + xwinwrap -g 1920x1080+1920+0 -ni -fdt -sh rectangle -un -b -nf -ov -- $mpv "$base/$pape2" & > /dev/null 2>&1 & + echo $! >> ${HOME}/.cache/mpvbg.pid + echo "$pape1" >> $HOME/.cache/newbga_img fi -# Second monitor -xwinwrap -g 1920x1080+1920+0 -ni -fdt -sh rectangle -un -b -nf -ov -- $mpv "$base/$pape2" & > /dev/null 2>&1 & -echo $! >> ${HOME}/.cache/mpvbg.pid -echo "$pape1" >> $HOME/.cache/newbga_img diff --git a/ytdl b/ytdl index 324561d..c7be8d4 100755 --- a/ytdl +++ b/ytdl @@ -14,12 +14,16 @@ url=`echo '' | dmenu -p 'Enter a url'` if [ -z "$url" ]; then exit; fi # youtube-dl constantly breaks so --verbose is here for your pleasure -cmd='youtube-dl --extract-audio --verbose --audio-format mp3 -o' +cmd='youtube-dl --extract-audio --verbose --audio-format mp3' outplaylist="$HOME/Music/${dir}/%(autonumber)02d - %(title)s.%(ext)s" outsingle="$HOME/Music/${dir}/%(title)s.%(ext)s" +# youtube playlists if echo "$url" | grep -q '&list='; then - $cmd "$outplaylist" "$url" + $cmd -o "$outplaylist" "$url" +# soundcloud sets +elif echo "$url" | grep -q '/sets/'; then + $cmd -o "$outplaylist" "$url" else $cmd "$outsingle" "$url" fi