From 71ddd52bcba8977489d68ac3a8b0e4f8db3136fb Mon Sep 17 00:00:00 2001 From: neodarz Date: Thu, 16 May 2019 23:43:22 +0200 Subject: Little screen modified to launch video wallpaper on multiscreen --- scripts/.scripts/mpvbg | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 scripts/.scripts/mpvbg diff --git a/scripts/.scripts/mpvbg b/scripts/.scripts/mpvbg new file mode 100755 index 0000000..5afba5c --- /dev/null +++ b/scripts/.scripts/mpvbg @@ -0,0 +1,27 @@ +#!/bin/bash +# +# http://github.com/mitchweaver/bin +# +# play a video on the root window +# +# Multi screen mode by neodarz + +[ -f "$1" ] || exit 1 + +pkill -9 xwinwrap + +readarray -t screen_connected < <(xrandr | grep " connected") +nb_screen_connected=${#screen_connected[@]} +for (( num_screen=0; num_screen<$nb_screen_connected; num_screen++)); do + screen_geo=$(echo ${screen_connected[num_screen]} | awk '{ print $3 }') + + xwin="xwinwrap -ni -fdt -sh rectangle -un -b -nf -ov -g $screen_geo -- " + + mpv="mpv --wid WID --no-config --keepaspect=no --loop \ + --no-border --vd-lavc-fast --x11-bypass-compositor=no \ + --gapless-audio=yes --vo=xv --hwdec=auto --really-quiet \ + --name=mpvbg" + + $xwin $mpv "$1" > /dev/null 2>&1 & + echo -n $! > ${HOME}/.cache/mpvbg-$num_screen.pid +done -- cgit v1.2.1