From 100315b057c943cb754eb8feac47172bbb47f191 Mon Sep 17 00:00:00 2001 From: shockrah Date: Thu, 26 Sep 2019 15:12:10 -0700 Subject: [PATCH 1/7] optional parameter works in dmenu+shell --- snip | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/snip b/snip index 4682780..a7a7d06 100755 --- a/snip +++ b/snip @@ -1,2 +1,6 @@ #!/bin/sh -scrot -sz $HOME/tmp.png +if [ -z "$1" ]; then + scrot -sz $HOME/tmp.png +else + scrot -sz $HOME/$1 +fi From 0326d64c96f3b064543abf085da18012a117f1e7 Mon Sep 17 00:00:00 2001 From: shockrah Date: Mon, 30 Sep 2019 15:31:44 -0700 Subject: [PATCH 2/7] added nightly theme for moc because the default is really ugly --- configs/moc/nightly_theme | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 configs/moc/nightly_theme diff --git a/configs/moc/nightly_theme b/configs/moc/nightly_theme new file mode 100644 index 0000000..f0b82f4 --- /dev/null +++ b/configs/moc/nightly_theme @@ -0,0 +1,35 @@ +# Author: Wim Speekenbrink + +background = blue default +frame = blue default bold +window_title = blue default bold +directory = blue default bold +selected_directory = black magenta +playlist = blue default bold +selected_playlist = black magenta +file = magenta default bold +selected_file = black magenta +marked_file = green default bold +marked_info = blue default bold +marked_selected_file = black magenta bold +info = green default bold +status = blue default bold +title = green default bold +state = blue default bold +current_time = magenta default bold +time_left = magenta default bold +total_time = magenta default bold +time_total_frames = blue default bold +sound_parameters = magenta default bold +legend = blue default bold +disabled = black default +enabled = blue default bold +empty_mixer_bar = blue default bold +filled_mixer_bar = black magenta +empty_time_bar = blue default bold +filled_time_bar = black magenta +entry = green default bold +entry_title = green default bold +error = red default bold +message = green default bold +plist_time = green default bold From 0776285cc505846e0487f6be05b5c41f9c169fa2 Mon Sep 17 00:00:00 2001 From: shockrah Date: Sat, 19 Oct 2019 20:33:26 -0700 Subject: [PATCH 3/7] 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 From f3d0763fc248f9594af8f145ea64e88177833b44 Mon Sep 17 00:00:00 2001 From: shockrah Date: Sat, 19 Oct 2019 21:11:25 -0700 Subject: [PATCH 4/7] redirecting output to /dev/null --- musicbg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/musicbg b/musicbg index c0e3986..ea5aca3 100755 --- a/musicbg +++ b/musicbg @@ -12,6 +12,6 @@ mpv="mpv --wid WID --no-config --keepaspect=no --loop \ --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 & +xwinwrap -g 1920x1080 -ni -fdt -sh rectangle -un -b -nf -ov -- $mpv "$base/$pape" & > /dev/null 2>&1 & echo $! > ${HOME}/.cache/mpvmusic.pid From 765d7c777d5a7705cf5ad92162b7a2f0edfe1977 Mon Sep 17 00:00:00 2001 From: shockrah Date: Sat, 19 Oct 2019 21:37:02 -0700 Subject: [PATCH 5/7] note about proc sigkills which is going to be anoying later on --- musicbg | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/musicbg b/musicbg index ea5aca3..1db4e04 100755 --- a/musicbg +++ b/musicbg @@ -1,7 +1,8 @@ #!/bin/sh -pkill -9 xwinwrap -cacheFile="${HOME}/.cache/mpvbg.pid" +# for some reason this still kills all xwinwrap processes +proc=`pgrep xwinwrap | head -1` +kill -9 $proc # pick out the music video we want to play in the background base="$HOME/Videos/Music/" @@ -13,5 +14,3 @@ mpv="mpv --wid WID --no-config --keepaspect=no --loop \ --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 - From 11fa2387fb105690a6ac730032214608d40f1e7f Mon Sep 17 00:00:00 2001 From: shockrah Date: Sat, 19 Oct 2019 21:44:49 -0700 Subject: [PATCH 6/7] removed pointless capture --- musicbg | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/musicbg b/musicbg index 1db4e04..5992ca4 100755 --- a/musicbg +++ b/musicbg @@ -1,8 +1,7 @@ #!/bin/sh # for some reason this still kills all xwinwrap processes -proc=`pgrep xwinwrap | head -1` -kill -9 $proc +kill -9 `pgrep xwinwrap | head -1` # pick out the music video we want to play in the background base="$HOME/Videos/Music/" From fe1f60e676c89af8d730b9eb57dd8c962b820c67 Mon Sep 17 00:00:00 2001 From: shockrah Date: Sun, 20 Oct 2019 13:08:45 -0700 Subject: [PATCH 7/7] fixed second monitor check for good xd --- newbga | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/newbga b/newbga index 65d8a2d..7004447 100755 --- a/newbga +++ b/newbga @@ -34,8 +34,9 @@ echo "$pape1" > $HOME/.cache/newbga_img # Quick check if we even have a second monitor at all c=`xrandr | grep ' connected' | wc -l` -if $c = "1" +if [ $c = "1" ] then + echo 'asdf' exit else # Second monitor