cerulean
This commit is contained in:
parent
ac95603fc4
commit
f7de9f7a23
42 changed files with 1061 additions and 445 deletions
87
homes/modules/mpv/default.nix
Normal file
87
homes/modules/mpv/default.nix
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
{ pkgs, ... }:
|
||||
let
|
||||
auto-sub =
|
||||
let
|
||||
file = builtins.toFile "auto-sub.lua" ''
|
||||
mp.add_hook('on_load', 10, function ()
|
||||
mp.set_property('sub-file-paths', 'Subs/' .. mp.get_property('filename/no-ext'))
|
||||
end)
|
||||
'';
|
||||
in
|
||||
pkgs.mpvScripts.buildLua {
|
||||
pname = "auto-sub";
|
||||
version = "1.0.0";
|
||||
src = file;
|
||||
unpackPhase = ":";
|
||||
scriptPath = file;
|
||||
};
|
||||
seek-end =
|
||||
let
|
||||
file = builtins.toFile "seek_end.lua" ''
|
||||
function seek_end()
|
||||
mp.commandv("seek", math.floor(mp.get_property_number("duration") - 4), "absolute")
|
||||
end
|
||||
mp.add_key_binding(nil, "seek_end", seek_end)
|
||||
'';
|
||||
in
|
||||
pkgs.mpvScripts.buildLua {
|
||||
pname = "seek-end";
|
||||
version = "1.0.0";
|
||||
src = file;
|
||||
unpackPhase = ":";
|
||||
scriptPath = file;
|
||||
};
|
||||
in
|
||||
{
|
||||
programs.mpv = {
|
||||
enable = true;
|
||||
config = {
|
||||
input-default-bindings = false;
|
||||
input-builtin-bindings = false;
|
||||
|
||||
sub-outline-color = "0.0/0.3";
|
||||
sub-border-style = "opaque-box";
|
||||
sub-outline-size = -2;
|
||||
sub-filter-regex-append = "opensubtitles\\.org";
|
||||
sub-auto = "all";
|
||||
|
||||
ytdl-format = "bestvideo+bestaudio/best";
|
||||
slang = "en";
|
||||
ytdl-raw-options = "ignore-config=,sub-lang=en,write-sub=,write-auto-sub=";
|
||||
|
||||
hidpi-window-scale = false;
|
||||
hwdec = "auto";
|
||||
profile = "high-quality";
|
||||
vulkan-swap-mode = "auto";
|
||||
gpu-context = "wayland";
|
||||
};
|
||||
bindings = {
|
||||
"]" = "add speed 0.5";
|
||||
"[" = "add speed -0.5";
|
||||
SPACE = "cycle pause";
|
||||
RIGHT = "seek 5 exact";
|
||||
LEFT = "seek -5 exact";
|
||||
v = "cycle sub";
|
||||
V = "cycle sub down";
|
||||
b = "cycle audio";
|
||||
B = "cycle audio down";
|
||||
f = "cycle fullscreen";
|
||||
WHEEL_UP = "add volume 2";
|
||||
WHEEL_DOWN = "add volume -2";
|
||||
j = "add chapter -1";
|
||||
l = "add chapter 1";
|
||||
y = "script-binding seek_end";
|
||||
"`" = "script-binding console/enable";
|
||||
};
|
||||
scripts =
|
||||
with pkgs.mpvScripts;
|
||||
[
|
||||
mpv-osc-tethys
|
||||
thumbfast
|
||||
]
|
||||
++ [
|
||||
seek-end
|
||||
auto-sub
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue