diff options
| author | Robert Günzler <r@gnzler.io> | 2020-12-03 12:56:51 +0100 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2020-12-07 19:28:05 +0100 |
| commit | 0eb11ed2c3dc235349b87d20bf657f2fb9729994 (patch) | |
| tree | ceba665d591328bb47418ab82bb0de31abff98e5 /.config/mvi/script-opts | |
| parent | e93cee56264c7e1d07b422d66430d996fd8b0c40 (diff) | |
Add bin/mvi and config; mpv-based image viewer
Diffstat (limited to '.config/mvi/script-opts')
| -rw-r--r-- | .config/mvi/script-opts/autoload.conf | 4 | ||||
| -rw-r--r-- | .config/mvi/script-opts/detect_image.conf | 17 | ||||
| -rw-r--r-- | .config/mvi/script-opts/gallery_worker.conf | 13 | ||||
| -rw-r--r-- | .config/mvi/script-opts/image_positioning.conf | 8 | ||||
| -rw-r--r-- | .config/mvi/script-opts/minimap.conf | 19 | ||||
| -rw-r--r-- | .config/mvi/script-opts/playlist_view.conf | 113 | ||||
| -rw-r--r-- | .config/mvi/script-opts/ruler.conf | 21 | ||||
| -rw-r--r-- | .config/mvi/script-opts/status_line.conf | 11 |
8 files changed, 206 insertions, 0 deletions
diff --git a/.config/mvi/script-opts/autoload.conf b/.config/mvi/script-opts/autoload.conf new file mode 100644 index 0000000..65feea5 --- /dev/null +++ b/.config/mvi/script-opts/autoload.conf @@ -0,0 +1,4 @@ +disabled=no +images=yes +videos=no +audio=no diff --git a/.config/mvi/script-opts/detect_image.conf b/.config/mvi/script-opts/detect_image.conf new file mode 100644 index 0000000..1ddd9ca --- /dev/null +++ b/.config/mvi/script-opts/detect_image.conf @@ -0,0 +1,17 @@ +# commands to execute when a file detected as an image (1 frame, no audio) is loaded or unloaded + +# an image was loaded, and the previous file was not an image (or there was no previous file) +command_on_first_image_loaded= +# an image was loaded (regardless of what the previous file was) +command_on_image_loaded= +# a non-image was loaded, and the previous file was an image +command_on_non_image_loaded= + +# the purpose of these "hooks" is to let you change bindings, profiles, reset properties... +# see https://mpv.io/manual/master/#list-of-input-commands for general command information +# note that there is no such thing as "unloading a profile", to emulate this you must create an opposite profile and load that + +# example possible values: +#command_on_first_image_loaded=apply-profile image; enable-section image-viewer; script-message enable-status-line +#command_on_image_loaded=no-osd set video-pan-x 0; script-message align-border "" -1 +#command_on_non_image_loaded=disable-section image-viewer; no-osd set video-pan-x 0; no-osd set video-pan-y 0; no-osd set video-zoom 0; script-message disable-status-line diff --git a/.config/mvi/script-opts/gallery_worker.conf b/.config/mvi/script-opts/gallery_worker.conf new file mode 100644 index 0000000..499d25e --- /dev/null +++ b/.config/mvi/script-opts/gallery_worker.conf @@ -0,0 +1,13 @@ +# accepts a |-separated list of URL patterns which gallery.lua should thumbnail using youtube-dl. +# The patterns are matched after the http(s):// part of the URL. +#^ matches the beginning of the URL, $ matches its end, and you should use % before any of the characters ^$()%|,.[]*+-? to match that character. +# +#Examples +# will exclude any URL that starts with http://youtube.com or https://youtube.com: +# ytdl_exclude=^youtube%.com +# will exclude any URL that ends with .mkv or .mp4: +# ytdl_exclude=%.mkv$|%.mp4$ +# See more lua patterns here: https://www.lua.org/manual/5.1/manual.html#5.4.1 +# +#See also: ytdl_hook-exclude in mpv's manpage. +ytdl_exclude= diff --git a/.config/mvi/script-opts/image_positioning.conf b/.config/mvi/script-opts/image_positioning.conf new file mode 100644 index 0000000..5b72fb9 --- /dev/null +++ b/.config/mvi/script-opts/image_positioning.conf @@ -0,0 +1,8 @@ +# size of the margins with drag-to-pan +drag_to_pan_margin=50 +drag_to_pan_move_if_full_view=no + +# size of the margins with pan-follows-cursor +pan_follows_cursor_margin=50 +# whether pan-follows-cursor should pan when the entire image is visible +pan_follows_cursor_move_if_full_view=no diff --git a/.config/mvi/script-opts/minimap.conf b/.config/mvi/script-opts/minimap.conf new file mode 100644 index 0000000..72a05ea --- /dev/null +++ b/.config/mvi/script-opts/minimap.conf @@ -0,0 +1,19 @@ +# whether to show by default +enabled=yes +# the position of the center of the minimap, in percentage of the window (x, y) +center=92,92 +# the scale of the minimap (i.e. the view rectangle is scale / 100 times the size of the window) +scale=12 +# the cutoff size of the minimap (i.e. the image rectangle is clipped if it falls outside of the this zone) +max_size=16,16 +# opacity of the "image" (from 00=opaque to FF=transparent) +image_opacity=88 +# color of the "image" (#BBGGRR where each component rages from 00 to FF) +image_color=BBBBBB +# opacity of the "view" +view_opacity=BB +view_color=222222 +# whether the view should be drawn above the image +view_above_image=yes +# whether to show the minimap if the current image is fully visible +hide_when_full_image_in_view=yes diff --git a/.config/mvi/script-opts/playlist_view.conf b/.config/mvi/script-opts/playlist_view.conf new file mode 100644 index 0000000..e5942b7 --- /dev/null +++ b/.config/mvi/script-opts/playlist_view.conf @@ -0,0 +1,113 @@ +# thumbnail directory in which to create and look for thumbnails +# on Unix-like platforms: +#thumbs_dir=~/.mpv_thumbs_dir +thumbs_dir=~/.mpv-thumbs +# on Windows: +#thumbs_dir=%APPDATA%\mpv\gallery-thumbs-dir +# note that not all env vars get expanded, only '~' and 'APPDATA' do + +# use mpv instead of ffmpeg for thumbnail generation +# slightly slower and does not support transparency, but does not require additional ffmpeg/ffprobe executables +# yes on Windows, no on other plateforms +#generate_thumbnails_with_mpv=no + +# all options below are platform-independent + +# fine-grained controls for the geometry of the gallery +# each option can have a fixed value, or dynamic by using the following variables: +# ww, wh: mpv window width, mpv window height (always available) +# gx, gy: gallery horizontal position, gallery vertical position +# gw, gh: gallery width, gallery height +# sw, sh: minimum spacing width, minimum spacing height +# tw, th: thumbnail width, thumbnail height +# these strings are interpreted using the lua equivalent of "eval" so math functions and logical conditions can be used +# if an option references variables, they will be computed in the appropriate order +# (for example, if gallery_width == 5 * thumbnail_width, thumbnail_size will be computed before gallery_size) +# in case of cyclical dependencies, the script will abort +# example +# ------- +# make the gallery centered +gallery_position={ (ww - gw) / 2, (wh - gh) / 2 } +# make the gallery's size 9/10 the size of the window +gallery_size={ 10 * ww / 10, 10 * wh / 10 } +# with at least 15 pixels of spacing between each thumbnail +min_spacing={ 5, 5 } +# and two thumbnail size presets for Windows smaller/bigger than 1366 x 768 +thumbnail_size=(ww * wh <= 1366 * 768) and {192, 108} or {288, 162} +# it is recommended to use discrete increments for thumbnail_size since a new thumbnail needs to be generated for each size + +# limit the number of thumbnails visible, even if more could be shown +# 64 is the maximum due to limitations in mpv +max_thumbnails=64 + +# the position in the file at which to take the thumbnail +# can either be a percentage of the video duration, or a number of seconds +take_thumbnail_at=20% + +# load to the selected video when the playlist-view is toggled off +load_file_on_toggle_off=no +# close the playlist-view when loading a video +close_on_load_file=yes +# pause the current video when the playlist-view is opened +pause_on_start=yes +# resume the current video when the playlist-view is closed +# can be yes, no, or only-if-did-pause +# in the latter case, will only resume if the video was actually paused by opening the playlist-view +resume_on_stop=only-if-did-pause +# automatically start the playlist-view when mpv is started +start_on_mpv_startup=no +# automatically start the playlist-view when the current file is finished +# only has an effect when keep-open=always +start_on_file_end=yes +# if the currently playing file changes, set the selection to the new one +follow_playlist_position=yes +# when loading a file, remember the time-position of the previous +# and restart from there if it's loaded again +remember_time_position=yes + +# show the filename below each thumbnail +show_text=yes +# use the playlist title if it exists instead of the filename +show_title=yes +strip_directory=yes +strip_extension=yes +text_size=24 + +# colors are defined in hexadecimal in Blue Green Red (BGR) order +# opacity is defined between 00 (opaque) and FF (transparent) +background_color=333333 +background_opacity=33 +background_roundness=0 +normal_border_color=BBBBBB +normal_border_size=0.5 +selected_border_color=DDDDDD +selected_border_size=2 +flagged_border_color=AF5C00 +flagged_border_size=4 +selected_flagged_border_color=6F340B +placeholder_color=222222 + +# arbitrary commands that are run when the playlist-view is opened/closed +# this can be used for lowering video settings when the gallery is active, since +# high-quality video settings can result in slowdown of the gallery +command_on_open= +command_on_close= + +# the path of the 'flags' file that is written when you exit mpv +flagged_file_path=./mpv_gallery_flagged + +mouse_support=yes +UP=k +DOWN=j +LEFT=h +RIGHT=l +PAGE_UP=PGUP +PAGE_DOWN=PGDWN +FIRST=HOME +LAST=END +RANDOM=r +ACCEPT=ENTER +CANCEL=ESC +# this only removes entries from the playlist, not the underlying file +REMOVE=DEL +FLAG=SPACE diff --git a/.config/mvi/script-opts/ruler.conf b/.config/mvi/script-opts/ruler.conf new file mode 100644 index 0000000..5e6f48d --- /dev/null +++ b/.config/mvi/script-opts/ruler.conf @@ -0,0 +1,21 @@ +# whether to show the length of the lines between the two points +show_distance=yes +# whether to show the coordinates of the two points +show_coordinates=yes +# the coordinate space of the text shown. Can be "image", "window", "both" +coordinates_space=image +# can be "degrees", "radians", "both", or "no" +show_angles=degrees +line_width=2 +dots_radius=3 +font_size=36 +# ranges from 00 (black) to FF (white) +line_color=33 +# bindings used to set points. The binding to trigger ruler mode can also be used. Comma-separated list +confirm_bindings=MBTN_LEFT,ENTER +# bindings used to set points. The binding to trigger ruler mode can also be used. Comma-separated list +exit_bindings=ESC +# if yes, the first point will be immediately set at the cursor position when calling 'ruler' +set_first_point_on_begin=no +# if yes, the ruler overlay will be immediately cleared when setting the second point +clear_on_second_point_set=no diff --git a/.config/mvi/script-opts/status_line.conf b/.config/mvi/script-opts/status_line.conf new file mode 100644 index 0000000..2245494 --- /dev/null +++ b/.config/mvi/script-opts/status_line.conf @@ -0,0 +1,11 @@ +# whether to show by default +enabled=yes +# its position, possible values: (bottom|top)-(left|right) +position=bottom-left +# its font size +size=36 +# the text to be expanded +# see property expansion: https://mpv.io/manual/master/#property-expansion +# \N can be used for line breaks +# you can also use ass tags, see here: http://docs.aegisub.org/3.2/ASS_Tags/ +text=${filename} [${playlist-pos-1}/${playlist-count}] |