From a04d614cce6dd6f97918752c1a37f10746a460b0 Mon Sep 17 00:00:00 2001 From: kat witch Date: Fri, 7 May 2021 01:18:52 +0100 Subject: [PATCH] users/kat/media/mpv.nix: Rebound scroll wheel to volume instead of seek --- users/kat/media/mpv.nix | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/users/kat/media/mpv.nix b/users/kat/media/mpv.nix index 19c183e1..5210bb60 100644 --- a/users/kat/media/mpv.nix +++ b/users/kat/media/mpv.nix @@ -4,21 +4,26 @@ programs.mpv = { enable = true; scripts = [ pkgs.mpvScripts.sponsorblock ]; - config = { - profile = "gpu-hq"; - gpu-context = "wayland"; - vo = "gpu"; - volume-max = 200; - keep-open = true; - opengl-waitvsync = true; - hwdec = "auto"; - demuxer-max-bytes = "2000MiB"; - demuxer-max-back-bytes = "250MiB"; - osd-scale-by-window = false; - osd-bar-h = 2.5; # 3.125 default - osd-border-size = 2; # font border pixels, default 3 - term-osd-bar = true; - script-opts = lib.concatStringsSep "," + bindings = let + unbind = "keyup"; in { + "WHEEL_UP" = "add volume 2"; + "WHEEL_DOWN" = "add volume -2"; + }; + config = { + profile = "gpu-hq"; + gpu-context = "wayland"; + vo = "gpu"; + volume-max = 200; + keep-open = true; + opengl-waitvsync = true; + hwdec = "auto"; + demuxer-max-bytes = "2000MiB"; + demuxer-max-back-bytes = "250MiB"; + osd-scale-by-window = false; + osd-bar-h = 2.5; # 3.125 default + osd-border-size = 2; # font border pixels, default 3 + term-osd-bar = true; + script-opts = lib.concatStringsSep "," (lib.mapAttrsToList (k: v: "${k}=${toString v}") { osc-layout = "slimbox"; osc-vidscale = "no"; @@ -31,6 +36,6 @@ osc-seekbarkeyframes = "no"; osc-seekrangestyle = "slider"; }); + }; }; - }; -} + }