]> Git — Sourcephile - julm/julm-nix.git/blob - home-manager/profiles/mpv.nix
git: ignore formatting with nixfmt-rfc-style
[julm/julm-nix.git] / home-manager / profiles / mpv.nix
1 { pkgs, lib, ... }:
2 {
3 programs.mpv = {
4 enable = true;
5 # TipNote: Use mpv --input-test --force-window --idle to get the key names.
6 bindings = {
7 # Volume normalization
8 # See https://github.com/mpv-player/mpv/issues/3979
9 "Alt+a" =
10 ''cycle-values af "loudnorm=I=-25:TP=-1.5:LRA=1:linear=false" "dynaudnorm=framelen=100:gausssize=10:coupling=1:peak=0.58" "speechnorm" ""'';
11 "Alt+f" = "cycle video-unscaled";
12
13 # Show all chapters (like a right-clic on |<< or >>|)
14 "c" = "show_text \${chapter-list}";
15 "=" = "show-text \${playlist}";
16 "!" = "show-text \${track-list}";
17
18 # q is easier to type than Q
19 "q" = "quit-watch-later";
20 "ESC" = "quit-watch-later";
21 "Q" = "quit";
22 "ENTER" = "playlist-next force";
23 "KP_ENTER" = "playlist-next force";
24
25 "Alt+BS" = "playlist-remove current";
26 };
27 config = {
28 af = "loudnorm=I=-25:TP=-1.5:LRA=1:linear=false";
29
30 hwdec = "auto-safe";
31 profile = "gpu-hq";
32 vo = "gpu";
33
34 ytdl-format = "18/mp4-480p/hls-480p/http-360p/mp4";
35
36 # Don't wait ages for the window to finally show up.
37 force-window = "immediate";
38
39 stop-screensaver = "yes";
40
41 slang = "eng,en,enUS,en-US,fr,fr-FR";
42 alang = "eng,en,enUS,en-US,fr,fr-FR";
43 sub-scale = "0.6";
44
45 # For arbtt
46 #title = "MPV: \${?pause==no:playing}\${?pause==yes:paused}: \${path}";
47 title = lib.mkDefault "MPV: \${?pause==no:playing}\${?pause==yes:paused}: ";
48
49 # Higher quality screenshots. Low compression rate to speed up saving.
50 screenshot-directory = "~/Images/mpv";
51 screenshot-template = "%{filename:unknown}.%wH-%wM-%wS-%wT";
52 screenshot-format = "avif";
53 screenshot-avif-encoder = "libsvtav1";
54 screenshot-avif-pixfmt = "yuv420p";
55 # TODO: change crf wrt. resolution
56 screenshot-avif-opts = "crf=24,aq-mode=complexity";
57 screenshot-high-bit-depth = "yes";
58 screenshot-tag-colorspace = "yes";
59
60 osd-font-size = 24;
61 };
62 profiles = {
63 "extension.gif" = {
64 interpolation = "no";
65 };
66 };
67 };
68 xdg.configFile."mpv/scripts/history.lua".source = mpv/scripts/history.lua;
69 }