2019-08-04 01:50:14 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Shoutout to mitchweaver on gitgub for the script as a useful base for this one
|
2021-03-18 05:15:24 +00:00
|
|
|
# Link to exact script: https://github.com/mitchweaver/bin/blob/41f3d5c6cbc92173be232e48fd24213c91a16db1/mpv/mpvbg
|
|
|
|
# Original version of the script that I used to find this script
|
2019-08-04 01:50:14 +00:00
|
|
|
# There's lots of good scripts in that repository so check them all out
|
|
|
|
|
|
|
|
pkill -9 xwinwrap
|
2021-03-18 05:15:24 +00:00
|
|
|
#
|
|
|
|
#cacheFile="${HOME}/.cache/mpvbg.pid" # used in case we want a second proc but honestly kill + pgrep works
|
|
|
|
base="/home/shockrah/Videos/Papes"
|
2019-08-04 01:50:14 +00:00
|
|
|
|
2021-03-18 05:15:24 +00:00
|
|
|
# picking out the video to use here
|
|
|
|
pape=`ls ${HOME}/Videos/Papes/ | shuf | dmenu -i -l 10 -p 'Pick a pape :^)'`
|
|
|
|
if [ -z "$pape" ];then
|
|
|
|
exit
|
|
|
|
fi
|
2019-08-04 01:50:14 +00:00
|
|
|
|
2021-03-18 05:15:24 +00:00
|
|
|
|
|
|
|
#xwinwrap -g 1920x1080 -ov -- mpv -wid WID ~/.wallpapers/water.mp4
|
|
|
|
# WARNING: this mpv command is super outdated(like 2 years) but it might still be useful
|
|
|
|
# to someone out there
|
|
|
|
_unused_mpv="mpv --wid=0 --no-config --keepaspect=no --loop \
|
2019-08-04 01:50:14 +00:00
|
|
|
--no-border --vd-lavc-fast --x11-bypass-compositor=no \
|
|
|
|
--gapless-audio=yes --vo=x11 --hwdec=auto \
|
|
|
|
--x11-name=mpvbg"
|
|
|
|
|
|
|
|
|
2021-03-18 05:15:24 +00:00
|
|
|
# The magic here happens with xwinwrap the flags given to mpv don't really matter
|
|
|
|
# unless you have an mpv config the flags below are pretty much the only flags you
|
|
|
|
# need to get this working
|
|
|
|
xwinwrap -g 1920x1080 -ov -b -un -sh rectangle -fdt -ni -- \
|
|
|
|
mpv -wid WID --no-border --vo=x11 $base/"$pape" &
|
2019-08-26 04:03:36 +00:00
|
|
|
|