fix anime4k

This commit is contained in:
Peder Bergebakken Sundt 2024-01-31 02:11:55 +01:00
parent 8526353bc8
commit 8bd44fdba6
2 changed files with 14 additions and 9 deletions

View File

@ -252,6 +252,7 @@
nixosReports = mkHosts mkReport;
packages = forAllSystems ({ inputs, pkgs, lib, flakes, ... }: {
# TODO: get faketty to work ${expect}/bin/unbuffer is bad
nixos-rebuild-nom = pkgs.writeScriptBin "nixos-rebuild" ''
exec ${lib.getExe pkgs.nixos-rebuild} "$@" |& ${lib.getExe pkgs.nix-output-monitor}
'';

View File

@ -1,9 +1,10 @@
{ lib, pkgs, flakes, ... }:
{ lib, pkgs, ... }:
let
m = pkgs.mpvScripts;
mu = pkgs.unstable.mpvScripts;
a4k = lib.mkIf (m ? anime4k);
anime4k = pkgs.anime4k or pkgs.unstable.anime4k or null;
a4k = lib.mkIf (anime4k != null);
in
{
@ -14,15 +15,18 @@ in
programs.mpv.bindings."SHIFT+n" = "sub-seek -1";
programs.mpv.bindings."b" = ''cycle-values audio-channels 2 5 7 "auto"'';
# m.anime4k - from https://github.com/NixOS/nixpkgs/pull/273830
# WeChip g20 voice remote
programs.mpv.bindings."homepage" = "cycle fullscreen";
# anime4k - from https://github.com/NixOS/nixpkgs/pull/273830
# TODO: add to home-manager?
programs.mpv.bindings."CTRL+0" = a4k ''no-osd change-list glsl-shaders clr ""; show-text "GLSL shaders cleared"'';
programs.mpv.bindings."CTRL+1" = a4k ''no-osd change-list glsl-shaders set "${m.anime4k}/Anime4K_Clamp_Highlights.glsl:${m.anime4k}/Anime4K_Restore_CNN_VL.glsl:${m.anime4k}/Anime4K_Upscale_CNN_x2_VL.glsl:${m.anime4k}/Anime4K_AutoDownscalePre_x2.glsl:${m.anime4k}/Anime4K_AutoDownscalePre_x4.glsl:${m.anime4k}/Anime4K_Upscale_CNN_x2_M.glsl"; show-text "Anime4K: Mode A (HQ)"'';
programs.mpv.bindings."CTRL+2" = a4k ''no-osd change-list glsl-shaders set "${m.anime4k}/Anime4K_Clamp_Highlights.glsl:${m.anime4k}/Anime4K_Restore_CNN_Soft_VL.glsl:${m.anime4k}/Anime4K_Upscale_CNN_x2_VL.glsl:${m.anime4k}/Anime4K_AutoDownscalePre_x2.glsl:${m.anime4k}/Anime4K_AutoDownscalePre_x4.glsl:${m.anime4k}/Anime4K_Upscale_CNN_x2_M.glsl"; show-text "Anime4K: Mode B (HQ)"'';
programs.mpv.bindings."CTRL+3" = a4k ''no-osd change-list glsl-shaders set "${m.anime4k}/Anime4K_Clamp_Highlights.glsl:${m.anime4k}/Anime4K_Upscale_Denoise_CNN_x2_VL.glsl:${m.anime4k}/Anime4K_AutoDownscalePre_x2.glsl:${m.anime4k}/Anime4K_AutoDownscalePre_x4.glsl:${m.anime4k}/Anime4K_Upscale_CNN_x2_M.glsl"; show-text "Anime4K: Mode C (HQ)"'';
programs.mpv.bindings."CTRL+4" = a4k ''no-osd change-list glsl-shaders set "${m.anime4k}/Anime4K_Clamp_Highlights.glsl:${m.anime4k}/Anime4K_Restore_CNN_VL.glsl:${m.anime4k}/Anime4K_Upscale_CNN_x2_VL.glsl:${m.anime4k}/Anime4K_Restore_CNN_M.glsl:${m.anime4k}/Anime4K_AutoDownscalePre_x2.glsl:${m.anime4k}/Anime4K_AutoDownscalePre_x4.glsl:${m.anime4k}/Anime4K_Upscale_CNN_x2_M.glsl"; show-text "Anime4K: Mode A+A (HQ)"'';
programs.mpv.bindings."CTRL+5" = a4k ''no-osd change-list glsl-shaders set "${m.anime4k}/Anime4K_Clamp_Highlights.glsl:${m.anime4k}/Anime4K_Restore_CNN_Soft_VL.glsl:${m.anime4k}/Anime4K_Upscale_CNN_x2_VL.glsl:${m.anime4k}/Anime4K_AutoDownscalePre_x2.glsl:${m.anime4k}/Anime4K_AutoDownscalePre_x4.glsl:${m.anime4k}/Anime4K_Restore_CNN_Soft_M.glsl:${m.anime4k}/Anime4K_Upscale_CNN_x2_M.glsl"; show-text "Anime4K: Mode B+B (HQ)"'';
programs.mpv.bindings."CTRL+6" = a4k ''no-osd change-list glsl-shaders set "${m.anime4k}/Anime4K_Clamp_Highlights.glsl:${m.anime4k}/Anime4K_Upscale_Denoise_CNN_x2_VL.glsl:${m.anime4k}/Anime4K_AutoDownscalePre_x2.glsl:${m.anime4k}/Anime4K_AutoDownscalePre_x4.glsl:${m.anime4k}/Anime4K_Restore_CNN_M.glsl:${m.anime4k}/Anime4K_Upscale_CNN_x2_M.glsl"; show-text "Anime4K: Mode C+A (HQ)"'';
programs.mpv.bindings."CTRL+1" = a4k ''no-osd change-list glsl-shaders set "${anime4k}/Anime4K_Clamp_Highlights.glsl:${anime4k}/Anime4K_Restore_CNN_VL.glsl:${anime4k}/Anime4K_Upscale_CNN_x2_VL.glsl:${anime4k}/Anime4K_AutoDownscalePre_x2.glsl:${anime4k}/Anime4K_AutoDownscalePre_x4.glsl:${anime4k}/Anime4K_Upscale_CNN_x2_M.glsl"; show-text "Anime4K: Mode A (HQ)"'';
programs.mpv.bindings."CTRL+2" = a4k ''no-osd change-list glsl-shaders set "${anime4k}/Anime4K_Clamp_Highlights.glsl:${anime4k}/Anime4K_Restore_CNN_Soft_VL.glsl:${anime4k}/Anime4K_Upscale_CNN_x2_VL.glsl:${anime4k}/Anime4K_AutoDownscalePre_x2.glsl:${anime4k}/Anime4K_AutoDownscalePre_x4.glsl:${anime4k}/Anime4K_Upscale_CNN_x2_M.glsl"; show-text "Anime4K: Mode B (HQ)"'';
programs.mpv.bindings."CTRL+3" = a4k ''no-osd change-list glsl-shaders set "${anime4k}/Anime4K_Clamp_Highlights.glsl:${anime4k}/Anime4K_Upscale_Denoise_CNN_x2_VL.glsl:${anime4k}/Anime4K_AutoDownscalePre_x2.glsl:${anime4k}/Anime4K_AutoDownscalePre_x4.glsl:${anime4k}/Anime4K_Upscale_CNN_x2_M.glsl"; show-text "Anime4K: Mode C (HQ)"'';
programs.mpv.bindings."CTRL+4" = a4k ''no-osd change-list glsl-shaders set "${anime4k}/Anime4K_Clamp_Highlights.glsl:${anime4k}/Anime4K_Restore_CNN_VL.glsl:${anime4k}/Anime4K_Upscale_CNN_x2_VL.glsl:${anime4k}/Anime4K_Restore_CNN_M.glsl:${anime4k}/Anime4K_AutoDownscalePre_x2.glsl:${anime4k}/Anime4K_AutoDownscalePre_x4.glsl:${anime4k}/Anime4K_Upscale_CNN_x2_M.glsl"; show-text "Anime4K: Mode A+A (HQ)"'';
programs.mpv.bindings."CTRL+5" = a4k ''no-osd change-list glsl-shaders set "${anime4k}/Anime4K_Clamp_Highlights.glsl:${anime4k}/Anime4K_Restore_CNN_Soft_VL.glsl:${anime4k}/Anime4K_Upscale_CNN_x2_VL.glsl:${anime4k}/Anime4K_AutoDownscalePre_x2.glsl:${anime4k}/Anime4K_AutoDownscalePre_x4.glsl:${anime4k}/Anime4K_Restore_CNN_Soft_M.glsl:${anime4k}/Anime4K_Upscale_CNN_x2_M.glsl"; show-text "Anime4K: Mode B+B (HQ)"'';
programs.mpv.bindings."CTRL+6" = a4k ''no-osd change-list glsl-shaders set "${anime4k}/Anime4K_Clamp_Highlights.glsl:${anime4k}/Anime4K_Upscale_Denoise_CNN_x2_VL.glsl:${anime4k}/Anime4K_AutoDownscalePre_x2.glsl:${anime4k}/Anime4K_AutoDownscalePre_x4.glsl:${anime4k}/Anime4K_Restore_CNN_M.glsl:${anime4k}/Anime4K_Upscale_CNN_x2_M.glsl"; show-text "Anime4K: Mode C+A (HQ)"'';
/**/
programs.mpv.scripts = [