From d93782c907f7dd491425782a9e334a0c5bf8c7b1 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Fri, 3 Nov 2023 14:53:41 +0100 Subject: [PATCH] open dir of video file on alt+enter --- .config/mpv/input.conf | 3 ++- .local/bin/tools/open_at_video | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100755 .local/bin/tools/open_at_video diff --git a/.config/mpv/input.conf b/.config/mpv/input.conf index 2ef914e..1a492d8 100644 --- a/.config/mpv/input.conf +++ b/.config/mpv/input.conf @@ -6,7 +6,7 @@ # Copy this file and uncomment and edit the bindings you want to change. # # List of commands and further details: DOCS/man/input.rst -# List of special keys: --input-keylist +# Liut of special keys: --input-keylist # Keybindings testing mode: mpv --input-test --force-window --idle # # Use 'ignore' to unbind a key fully (e.g. 'ctrl+a ignore'). @@ -63,6 +63,7 @@ j no-osd seek -5 exact # seek exactly 5 seconds backward #Alt+down add video-pan-y -0.1 # move the video up Alt++ add video-zoom 0.1 # zoom in Alt+- add video-zoom -0.1 # zoom out +Alt+ENTER run "open_at_video" "${=path}" #Alt+BS set video-zoom 0 ; set video-pan-x 0 ; set video-pan-y 0 # reset zoom and pan settings #PGUP add chapter 1 # seek to the next chapter #PGDWN add chapter -1 # seek to the previous chapter diff --git a/.local/bin/tools/open_at_video b/.local/bin/tools/open_at_video new file mode 100755 index 0000000..d48fc3a --- /dev/null +++ b/.local/bin/tools/open_at_video @@ -0,0 +1,7 @@ +#!/bin/sh +if echo $1 | grep -qv '^/'; then + absolute_path_file="$(pwd)/$1" +else + absolute_path_file="$1" +fi +$TERMINAL $FILE "${absolute_path_file%/*}"