added mpv keybinds

This commit is contained in:
Kristian Krsnik 2023-09-21 16:21:24 +02:00
parent d08b631304
commit bd4a1763b4
Signed by: Kristian
GPG Key ID: FD1330AC9F909E85
2 changed files with 24 additions and 1 deletions

View File

@ -29,12 +29,12 @@
./modules/packages.nix ./modules/packages.nix
./modules/thunderbird.nix ./modules/thunderbird.nix
./modules/vscode.nix ./modules/vscode.nix
./modules/mpv.nix
]; ];
# Programs # Programs
programs = { programs = {
home-manager.enable = true; # Allow home-manager to manage itself home-manager.enable = true; # Allow home-manager to manage itself
mpv.enable = true;
obs-studio.enable = true; obs-studio.enable = true;
yt-dlp.enable = true; yt-dlp.enable = true;
}; };

23
modules/mpv.nix Normal file
View File

@ -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";
};
};
}