config/users/pbsds/home/profiles/mpv.nix

36 lines
1.2 KiB
Nix
Raw Normal View History

{ pkgs, flakes, ... }:
2023-03-04 00:09:57 +01:00
{
2023-03-09 07:03:15 +01:00
#home.packages = with pkgs; [ mpv ];
2023-03-04 00:09:57 +01:00
programs.mpv.enable = true;
2023-03-11 16:00:42 +01:00
programs.mpv.bindings."n" = "sub-seek 1";
2023-03-04 00:09:57 +01:00
programs.mpv.bindings."SHIFT+n" = "sub-seek -1";
2023-03-08 22:48:40 +01:00
programs.mpv.bindings."b" = ''cycle-values audio-channels 2 "auto"'';
2023-06-13 01:07:47 +02:00
2023-06-20 01:39:19 +02:00
programs.mpv.scripts = with pkgs.mpvScripts; [
#thumbnail # TOO SLOW
2023-07-05 17:30:17 +02:00
thumbfast
mpris
2023-06-20 01:39:19 +02:00
# TODO: thumbfast
2023-07-05 00:40:34 +02:00
flakes.self.pkgs.mpv-webm # activate with SHIFT+W
2023-06-20 21:37:24 +02:00
# from https://github.com/mpv-player/mpv/issues/9767#issuecomment-1024831645
({ scriptName = "dynamic-subs.lua"; } // (pkgs.writeTextDir "share/mpv/scripts/dynamic-subs.lua" ''
mp.add_hook('on_load', 10, function()
sub_paths = {'Subs'}
sub_paths[#sub_paths+1]='Subs/' .. mp.get_property('filename/no-ext')
mp.set_property_native('sub-file-paths', sub_paths)
end)
''))
2023-06-20 01:39:19 +02:00
];
2023-06-13 01:07:47 +02:00
#programs.mpv.config.osc = "no"; # likely a 'thumbnail' requirement
2023-03-11 16:00:42 +01:00
2023-06-20 21:37:24 +02:00
# dynamic-subs.lua
programs.mpv.config.sub-auto = "all";
2023-03-11 16:00:42 +01:00
#https://nixos.wiki/wiki/Accelerated_Video_Playback
programs.mpv.config.hwdec = "auto-safe";
programs.mpv.config.vo = "gpu";
programs.mpv.config.profile = "gpu-hq";
programs.mpv.config.gpu-context = "wayland";
2023-03-04 00:09:57 +01:00
}