dotfiles

personal dotfiles
git clone anongit@rnpnr.xyz:dotfiles.git
Log | Files | Refs | Feed | Submodules

Commit: ecbd2d114b5f1bd0d62d67407b300baf68098f11
Parent: fdab14f4ac141f26240729b792b2a59fad814be5
Author: Randy Palamar
Date:   Fri,  5 Mar 2021 00:20:41 -0700

set better mpv keybinds update mpvacious

Diffstat:
M.config/mpv/input.conf | 13+++++--------
A.config/mpv/scripts/chapters.lua | 19+++++++++++++++++++
M.config/mpv/scripts/gallery.lua | 10+++++-----
3 files changed, 29 insertions(+), 13 deletions(-)

diff --git a/.config/mpv/input.conf b/.config/mpv/input.conf @@ -1,22 +1,19 @@ -MOUSE_BTN3 add volume 1 -MOUSE_BTN4 add volume -1 -MOUSE_BTN7 playlist-prev -MOUSE_BTN8 playlist-next - +j add volume -1 +k add volume 1 J add sub-font-size -1 K add sub-font-size 1 r script-message rotate-video 90 R script-message rotate-video -90 -h cycle-values video-unscaled "yes" "no" +y cycle-values video-unscaled "yes" "no" -l cycle-values loop "inf" "no" +; cycle-values loop "inf" "no" F1 cycle stop-screensaver -MBTN_RIGHT {images} script-binding pan-follows-cursor MBTN_LEFT {images} script-binding drag-to-pan MBTN_MID {images} set video-pan-x 0; set video-pan-y 0; set video-zoom 0 +MBTN_RIGHT {images} script-binding pan-follows-cursor MOUSE_BTN3 {images} script-message cursor-centric-zoom 0.1 MOUSE_BTN4 {images} script-message cursor-centric-zoom -0.1 diff --git a/.config/mpv/scripts/chapters.lua b/.config/mpv/scripts/chapters.lua @@ -0,0 +1,19 @@ +-- move between chapters or files if no or no more chapters exist +function chapter_seek(direction) + local chapters = mp.get_property_number("chapters") + if chapters == nil then chapters = 0 end + local chapter = mp.get_property_number("chapter") + if chapter == nil then chapter = 0 end + if chapter+direction < 0 then + mp.command("playlist_prev") + --mp.commandv("script-message", "osc-playlist") + elseif chapter+direction >= chapters then + mp.command("playlist_next") + --mp.commandv("script-message", "osc-playlist") + else + mp.commandv("add", "chapter", direction) + mp.commandv("script-message", "osc-chapterlist") + end +end +mp.add_key_binding("h", "chapter_prev", function() chapter_seek(-1) end) +mp.add_key_binding("l", "chapter_next", function() chapter_seek(1) end) diff --git a/.config/mpv/scripts/gallery.lua b/.config/mpv/scripts/gallery.lua @@ -48,10 +48,10 @@ local opts = { max_generators = 8, mouse_support = true, - UP = "UP", - DOWN = "DOWN", - LEFT = "LEFT", - RIGHT = "RIGHT", + UP = "k", + DOWN = "j", + LEFT = "h", + RIGHT = "l", PAGE_UP = "PGUP", PAGE_DOWN = "PGDWN", FIRST = "HOME", @@ -60,7 +60,7 @@ local opts = { ACCEPT = "ENTER", CANCEL = "ESC", REMOVE = "DEL", - FLAG = ",", + FLAG = "SPACE", } (require 'mp.options').read_options(opts)