From bd4a1763b48644001b679886f5b624620fbed440 Mon Sep 17 00:00:00 2001 From: Kristian Krsnik Date: Thu, 21 Sep 2023 16:21:24 +0200 Subject: [PATCH] added mpv keybinds --- home.nix | 2 +- modules/mpv.nix | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 modules/mpv.nix diff --git a/home.nix b/home.nix index 96f70dd..6055681 100644 --- a/home.nix +++ b/home.nix @@ -29,12 +29,12 @@ ./modules/packages.nix ./modules/thunderbird.nix ./modules/vscode.nix + ./modules/mpv.nix ]; # Programs programs = { home-manager.enable = true; # Allow home-manager to manage itself - mpv.enable = true; obs-studio.enable = true; yt-dlp.enable = true; }; diff --git a/modules/mpv.nix b/modules/mpv.nix new file mode 100644 index 0000000..451e82a --- /dev/null +++ b/modules/mpv.nix @@ -0,0 +1,23 @@ +{...}: { + config.programs.mpv = { + enable = true; + bindings = let + volume-step = "5"; + speed-step = "0.125"; + seek-step = "5"; + in { + # supported commands https://raw.githubusercontent.com/mpv-player/mpv/master/etc/input.conf + WHEEL_UP = "add volume +${volume-step}"; + WHEEL_DOWN = "add volume -${volume-step}"; + RIGHT = "seek +${seek-step}"; + LEFT = "seek -${seek-step}"; + UP = "add volume +${volume-step}"; + DOWN = "add volume -${volume-step}"; + "Alt+h" = "vf toggle hflip"; + "Alt+v" = "vf toggle vflip"; + ">" = "add speed +${speed-step}"; + "<" = "add speed -${speed-step}"; + BS = "set speed 1.0"; + }; + }; +}