From 0c36d35d99dbdfac71ccec4eb47afca22d39bd25 Mon Sep 17 00:00:00 2001 From: meliurwen Date: Mon, 6 Dec 2021 16:46:03 +0100 Subject: [PATCH] Added `mpv-pip` alias and improved mpv configuration and integration. --- common-shells/.aliases | 2 ++ i3/.config/i3/config | 7 ++++--- i3/.config/i3/scripts/webcam-toggle.sh | 3 ++- mpv/.config/mpv/mpv.conf | 25 ++++++++++++++++++------- polybar/.config/polybar/config | 2 +- 5 files changed, 27 insertions(+), 12 deletions(-) mode change 100644 => 100755 i3/.config/i3/config diff --git a/common-shells/.aliases b/common-shells/.aliases index e48a64e..dcf5e64 100644 --- a/common-shells/.aliases +++ b/common-shells/.aliases @@ -8,3 +8,5 @@ alias diff='diff --color' alias ls='ls --color=tty' alias mutt='TERM=${TERM}-256color mutt' alias neomutt='TERM=${TERM}-256color neomutt' + +alias mpv-pip='mpv --profile="pip"' diff --git a/i3/.config/i3/config b/i3/.config/i3/config old mode 100644 new mode 100755 index ec78c59..09ddb7c --- a/i3/.config/i3/config +++ b/i3/.config/i3/config @@ -1,3 +1,4 @@ +#!/bin/i3 -c # i3 config file (v4) # # Please see https://i3wm.org/docs/userguide.html for a complete reference! @@ -187,9 +188,9 @@ bindsym $mod+Mod1+x mark --add quickswap bindsym $mod+x swap container with mark quickswap; [con_mark="quickswap"] focus # Webcam 1 dropdown -for_window [title="video0 - mpv"] floating enable -for_window [title="video0 - mpv"] sticky enable -for_window [title="video0 - mpv"] border none +for_window [title="mpv-floating-window"] floating enable +for_window [title="mpv-floating-window"] sticky enable +for_window [title="mpv-floating-window"] border none # WebCam Toggle bindsym XF86WebCam exec ~/.config/i3/scripts/webcam-toggle.sh diff --git a/i3/.config/i3/scripts/webcam-toggle.sh b/i3/.config/i3/scripts/webcam-toggle.sh index ede2b39..706252f 100755 --- a/i3/.config/i3/scripts/webcam-toggle.sh +++ b/i3/.config/i3/scripts/webcam-toggle.sh @@ -1,7 +1,8 @@ #!/bin/sh pkill -f /dev/video || \ - mpv --input-ipc-server="$HOME/.cache/mpvsocket-webcam" \ + mpv --title="mpv-floating-window" \ + --input-ipc-server="$HOME/.cache/mpvsocket-webcam" \ --no-osc \ --no-input-default-bindings \ --input-conf=/dev/null \ diff --git a/mpv/.config/mpv/mpv.conf b/mpv/.config/mpv/mpv.conf index c800cc4..f66b418 100644 --- a/mpv/.config/mpv/mpv.conf +++ b/mpv/.config/mpv/mpv.conf @@ -6,24 +6,35 @@ #ytdl-format=bestvideo[height<=?1080][fps<=?30][vcodec!=?vp9]+bestaudio/best ytdl-format=bestvideo[height<=?720][fps<=?30][vcodec!=?vp9]+bestaudio/best - -# In order to communicate to the Polybar's mpv module -input-ipc-server=~/.cache/mpvsocket - # Enable hardware acceleration (Intel specific) ## See: ## https://github.com/mpv-player/mpv/wiki/Hardware-decoding-on-Linux ## https://wiki.archlinux.org/index.php/Mpv#Hardware_video_acceleration hwdec=vaapi +[default] + +# In order to communicate to the Polybar's mpv module +input-ipc-server=~/.cache/mpvsocket + save-position-on-quit +[pip] +profile-desc="Floating Picture in Picture window" +title="mpv-floating-window" +no-osc +geometry=-0-0 +autofit=30% + # File specific -[extension.webm] +[webm] +profile-cond=(get('filename', ''):match('%.webm$') ~= nil) and (duration<=20) loop-file=yes -[extension.gifv] +[gifv] +profile-cond=(get('filename', ''):match('%.gifv$') ~= nil) loop-file=yes -[extension.gif] +[gif] +profile-cond=(get('filename', ''):match('%.gif$') ~= nil) loop-file=yes diff --git a/polybar/.config/polybar/config b/polybar/.config/polybar/config index b2d73d9..bad3fca 100644 --- a/polybar/.config/polybar/config +++ b/polybar/.config/polybar/config @@ -264,7 +264,7 @@ interval = 1 format = 