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