aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/scripts/mpvbg
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2019-09-05 07:48:16 +0200
committerneodarz <neodarz@neodarz.net>2019-09-05 07:48:16 +0200
commit9b19480228d8421c3987a634a602012c953a993e (patch)
tree4bce21766502f3a72bb2002daeea2a406c2a3bda /dotfiles/scripts/mpvbg
parent40dddc15f4a323d3c84c84be7bb2c5ca94d3c07c (diff)
downloaddotfiles_dotdrop-9b19480228d8421c3987a634a602012c953a993e.tar.xz
dotfiles_dotdrop-9b19480228d8421c3987a634a602012c953a993e.zip
Add some scripts
Diffstat (limited to 'dotfiles/scripts/mpvbg')
-rwxr-xr-xdotfiles/scripts/mpvbg27
1 files changed, 27 insertions, 0 deletions
diff --git a/dotfiles/scripts/mpvbg b/dotfiles/scripts/mpvbg
new file mode 100755
index 0000000..5afba5c
--- /dev/null
+++ b/dotfiles/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