~guidocella/mpv-image-config

2ef1c2261a497452071e73af1683ecee35f46300 — Guido Cella 1 year, 3 months ago e381c75
s/keybindings/bindings/

Since there are now more mouse bindings that keyboard ones.
5 files changed, 5 insertions(+), 5 deletions(-)

M README.md
M input.conf
M mpv.conf
R script-opts/{image_keybindings.conf => image_bindings.conf}
R scripts/{image-keybindings.lua => image-bindings.lua}
M README.md => README.md +2 -2
@@ 1,8 1,8 @@
This is an example configuration for using mpv as an image viewer. Version 0.34 is needed for the `track-list/N/image` sub-property. Use this by copying what you want to use from `mpv.conf` and `input.conf` into your versions of these files, and copying or symlinking into `~~/scripts` `scripts/align-images.lua` for automatically aligning images, and `scripts/image-keybindings.lua` for the script messages used by `input.conf`.
This is an example configuration for using mpv as an image viewer. Version 0.34 is needed for the `track-list/N/image` sub-property. Use this by copying what you want to use from `mpv.conf` and `input.conf` into your versions of these files, and copying or symlinking into `~~/scripts` `scripts/align-images.lua` for automatically aligning images, and `scripts/image-bindings.lua` for the script messages used by `input.conf`.

## Why?

* mpv is feature rich and far more extensible than any image viewer. You can easily add original keybindings, set up conditional profiles and do pretty much anything with Lua scripts
* mpv is feature rich and far more extensible than any image viewer. You can easily add original key bindings, set up conditional profiles and do pretty much anything with Lua scripts
* Zoomed images with a good scaling filter look better than in image viewers (or at least the ones I previously used), and you can even improve image quality further with GLSL shaders like https://github.com/bloc97/Anime4K
* You can use quit-watch-later with directories of images
* You can browse directories with both videos and images in one application

M input.conf => input.conf +2 -2
@@ 12,7 12,7 @@ G      no-osd set playlist-pos-1 ${playlist-count} # add sub-scale +0.1
# warning: this permanently deletes the current file from the filesystem
Ctrl+Shift+r script-message rm-file

# Image-only keybindings
# Image-only bindings
SPACE {image} repeatable playlist-next force
]     {image} no-osd add playlist-pos 10
[     {image} no-osd add playlist-pos -10


@@ 73,7 73,7 @@ a      {image} apply-profile image-hq
# https://github.com/Dudemanguy/mpv-manga-reader
d {image} script-message double-page-mode

# This mouse gesture executes one of 5 commands configured in script-opts/image_keybindings.conf depending on the direction you drag the mouse.
# This mouse gesture executes one of 5 commands configured in script-opts/image_bindings.conf depending on the direction you drag the mouse.
MBTN_LEFT  {image} script-binding gesture
MBTN_LEFT_DBL {image} ignore
MBTN_MID   {image} script-binding align-to-cursor

M mpv.conf => mpv.conf +1 -1
@@ 39,7 39,7 @@ sigmoid-upscaling

# Set options for stand-alone images (not cover art).
# Also use profile conditions to enable and disable the image input section,
# which is what makes image-only keybindings in input.conf work.
# which is what makes image-only bindings in input.conf work.
[image]
profile-cond=get('current-tracks/video/image') and not get('current-tracks/video/albumart') and mp.command('enable-section image')
profile-restore=copy

R script-opts/image_keybindings.conf => script-opts/image_bindings.conf +0 -0
R scripts/image-keybindings.lua => scripts/image-bindings.lua +0 -0