diff options
| author | Anton Bobov <anton@bobov.name> | 2023-09-02 00:50:13 +0500 |
|---|---|---|
| committer | Anton Bobov <anton@bobov.name> | 2023-09-03 20:19:45 +0500 |
| commit | f2489385f752b85e786565b8fa751b1838904324 (patch) | |
| tree | 833b4fd464fca451493ae97c275ff0027df6369c /files/.config | |
| parent | 45176092a9788a6d798da30e8892b29fe4ef8678 (diff) | |
[mpv] Updates
Diffstat (limited to 'files/.config')
| -rw-r--r-- | files/.config/mpv/input.conf | 10 | ||||
| -rw-r--r-- | files/.config/mpv/mpv.conf | 69 | ||||
| m--------- | files/.config/mpv/reload | 0 | ||||
| -rw-r--r-- | files/.config/mpv/script-opts/uosc.conf | 4 | ||||
| l--------- | files/.config/mpv/scripts/reload.lua | 1 | ||||
| -rw-r--r-- | files/.config/mpv/scripts/toggle-redshift-on-play.lua | 49 | ||||
| -rw-r--r-- | files/.config/youtube-dl/config | 3 |
7 files changed, 114 insertions, 22 deletions
diff --git a/files/.config/mpv/input.conf b/files/.config/mpv/input.conf index 40f89cd..327a604 100644 --- a/files/.config/mpv/input.conf +++ b/files/.config/mpv/input.conf @@ -6,9 +6,19 @@ # Disable: Activate/deactivate deinterlacer. d ignore +# Pause/resume all running mpv Alt+p run "/bin/sh" "-c" "xdotool search --class mpv | xargs -I{} xdotool key --window {} p" # default loudnorm I=-24 # I=-15 -- louder volume # anull -- disable audio filter a cycle_values af loudnorm loudnorm=I=-15 anull + +Shift+Up add chapter 1 +Shift+Down add chapter -1 + +m script-binding uosc/menu +n script-message-to uosc show-submenu "Navigation" +Tab script-binding uosc/toggle-ui + +M cycle mute diff --git a/files/.config/mpv/mpv.conf b/files/.config/mpv/mpv.conf index ea97994..8bed5a8 100644 --- a/files/.config/mpv/mpv.conf +++ b/files/.config/mpv/mpv.conf @@ -1,35 +1,50 @@ -osc=no -osd-bar=no - -# Speed up playback by the factor -speed=1.33 +# +# GENERAL +# -# Create a video output window even if there is no video -force-window=immediate +keep-open=yes +autofit-larger=70%x70% # Don't create window larger than 70 % +autofit-smaller=30%x30% # Don't create window smaller than 30% +no-terminal # Disable any use of the terminal and stdin/stdout/stderr -# Always save the current playback position on quit -save-position-on-quit +save-position-on-quit # Always save the current playback position on quit +watch-later-options-remove=fullscreen +watch-later-options-remove=volume +watch-later-options-remove=mute ignore-path-in-watch-later-config -# Disable any use of the terminal and stdin/stdout/stderr -no-terminal - -# Enable any whitelisted hardware video decoding API -hwdec=auto-safe +screenshot-format=png +screenshot-high-bit-depth=yes +screenshot-png-compression=0 +screenshot-directory=~/Documents/mpv-screenshots +screenshot-template=mpv-shot-%F-%{media-title}-%p-%n +hwdec=auto-safe # Enable any whitelisted hardware video decoding API interpolation=yes video-sync=display-resample -# If the current file is an image, kept open forever -image-display-duration=inf # -screenshot-template=mpv-shot-%F-%{media-title}-%p-%n -screenshot-directory=~/mpv-screenshots +# OSD/OSC +# + +osc=no +osd-bar=no -# Cache size -demuxer-max-bytes=500M +# +# PLAYBACK +# + +speed=1.33 # Speed up playback by the factor +volume-max=100 +image-display-duration=inf # If the current file is an image, kept open forever + +demuxer-max-bytes=500M # Cache size demuxer-max-back-bytes=100M +# +# STREAMING +# + ytdl-format="bestvideo[height<=?1080]+bestaudio/best" ytdl-raw-options=sponsorblock-mark=all @@ -43,6 +58,20 @@ af=lavfi=[loudnorm] [audio] speed=1 +[streams] +profile-cond=path:match('/streams/') ~= nil +profile-restore=copy +cache=no + +[protocol.https] +force-window=immediate # Create a video output window even if there is no video + +[protocol.http] +force-window=immediate # Create a video output window even if there is no video + +[protocol.ytdl] +profile=protocol.https + # # EXTENSIONS # diff --git a/files/.config/mpv/reload b/files/.config/mpv/reload new file mode 160000 +Subproject c1219b6ac3ee3de887e6a36ae41a8e478835ae9 diff --git a/files/.config/mpv/script-opts/uosc.conf b/files/.config/mpv/script-opts/uosc.conf index 9666f70..af15b4b 100644 --- a/files/.config/mpv/script-opts/uosc.conf +++ b/files/.config/mpv/script-opts/uosc.conf @@ -123,7 +123,7 @@ top_bar_size=40 top_bar_size_fullscreen=46 top_bar_controls=no # Can be: `no` (hide), `yes` (inherit title from mpv.conf), or a custom template string -top_bar_title=no +top_bar_title=yes # Template string to enable alternative top bar title. If alt title matches main title, # it'll be hidden. Tip: use `${media-title}` for main, and `${filename}` for alt title. top_bar_alt_title= @@ -141,7 +141,7 @@ window_border_opacity=0.8 # If there's no playlist and file ends, load next file in the directory # Requires `keep-open=yes` in `mpv.conf`. -autoload=no +autoload=yes # What types to accept as next item when autoloading or requesting to play next file # Can be: video, audio, image, subtitle autoload_types=video,audio,image diff --git a/files/.config/mpv/scripts/reload.lua b/files/.config/mpv/scripts/reload.lua new file mode 120000 index 0000000..3ecade0 --- /dev/null +++ b/files/.config/mpv/scripts/reload.lua @@ -0,0 +1 @@ +../reload/reload.lua
\ No newline at end of file diff --git a/files/.config/mpv/scripts/toggle-redshift-on-play.lua b/files/.config/mpv/scripts/toggle-redshift-on-play.lua new file mode 100644 index 0000000..4897abd --- /dev/null +++ b/files/.config/mpv/scripts/toggle-redshift-on-play.lua @@ -0,0 +1,49 @@ +-- Taken from: https://gist.github.com/CreamyCookie/d036b66af4e17ea527d08e303eb96145 +-- +-- Toggle redshift when viewing videos with mpv +-- When pausing redshift is reenabled (and disabled again when continuing) +-- This script assumes that redshift is running + +rs_enabled = true + +function rs_toggle() + os.execute("pkill -x -USR1 redshift") +end + +function rs_disable() + if rs_enabled then + rs_toggle() + rs_enabled = false + mp.msg.log("info", "Disabling redshift") + end +end + +function rs_enable() + if not rs_enabled then + rs_toggle() + rs_enabled = true + mp.msg.log("info", "Reenabling redshift") + end +end + +function rs_handler() + if mp.get_property("video") ~= "no" then + rs_disable() + else + rs_enable() + end +end + + +function on_pause_change(name, value) + if value then --pause started + rs_enable() + else + rs_disable() + end +end + + +mp.register_event("file-loaded", rs_handler) +mp.register_event("shutdown", rs_enable) +mp.observe_property("pause", "bool", on_pause_change) diff --git a/files/.config/youtube-dl/config b/files/.config/youtube-dl/config index 8940ded..aa888f4 100644 --- a/files/.config/youtube-dl/config +++ b/files/.config/youtube-dl/config @@ -3,3 +3,6 @@ --force-ipv4 --add-metadata --sponsorblock-mark all +--xff default +--downloader aria2c +--downloader-args aria2c:"-x8 -s8 -k1M" |
