aboutsummaryrefslogtreecommitdiff
path: root/scripts/.scripts
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2019-05-16 23:43:22 +0200
committerneodarz <neodarz@neodarz.net>2019-05-16 23:43:22 +0200
commit71ddd52bcba8977489d68ac3a8b0e4f8db3136fb (patch)
tree306d47bb801894ab75d0996eaef5fe9685a346e1 /scripts/.scripts
parente6d3579a105b078d85d6f289c7735d29f29cabb8 (diff)
downloaddotfiles_ascii-71ddd52bcba8977489d68ac3a8b0e4f8db3136fb.tar.xz
dotfiles_ascii-71ddd52bcba8977489d68ac3a8b0e4f8db3136fb.zip
Little screen modified to launch video wallpaper on multiscreen
Diffstat (limited to '')
-rwxr-xr-xscripts/.scripts/mpvbg27
1 files changed, 27 insertions, 0 deletions
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