feat(mpv): add misc scripts

This commit is contained in:
matt1432 2023-12-16 21:51:43 -05:00
parent 12cec706fa
commit 4f349dae0f
5 changed files with 63 additions and 0 deletions

View file

@ -1,15 +1,29 @@
{pkgs, ...}: { {pkgs, ...}: {
# For kdialog-open-files
home.packages = with pkgs; [
kdialog
];
programs.mpv = { programs.mpv = {
enable = true; enable = true;
# https://github.com/mpv-player/mpv/wiki/User-Scripts
scripts = with (import ./scripts pkgs); [ scripts = with (import ./scripts pkgs); [
modernx modernx
# Dep of touch-gestures # Dep of touch-gestures
pointer-event pointer-event
touch-gestures touch-gestures
# Ctrl + o
kdialog-open-files
persist-properties
undo-redo
]; ];
scriptOpts = { scriptOpts = {
persist_properties = {
properties = "volume,sub-scale";
};
# Touch gestures default # Touch gestures default
pointer-event = { pointer-event = {
margin_left = 0; margin_left = 0;

View file

@ -10,4 +10,7 @@ in
modernx = buildLuaScript ./modernx.nix; modernx = buildLuaScript ./modernx.nix;
pointer-event = buildLuaScript ./pointer-event.nix; pointer-event = buildLuaScript ./pointer-event.nix;
touch-gestures = buildLuaScript ./touch-gestures.nix; touch-gestures = buildLuaScript ./touch-gestures.nix;
kdialog-open-files = buildLuaScript ./kdialog-open-files.nix;
persist-properties = buildLuaScript ./persist-properties.nix;
undo-redo = buildLuaScript ./undo-redo.nix;
} }

View file

@ -0,0 +1,15 @@
{
fetchurl,
buildLua,
}:
buildLua rec {
pname = "zenity-open-files";
version = "unstable";
unpackPhase = ":";
src = fetchurl {
url = "https://gist.githubusercontent.com/ntasos/d1d846abd7d25e4e83a78d22ee067a22/raw/b23b20e830bba024836f8b09412000658edee95c/kdialog-open-files.lua";
hash = "sha256-qJ/Myx0mdaRsWWd+4Mk1/SUSSI/uqQdg/vLZo2pkEwA=";
};
scriptPath = "${src}";
}

View file

@ -0,0 +1,15 @@
{
fetchFromGitHub,
buildLua,
}:
buildLua {
pname = "persist-properties";
version = "unstable";
src = fetchFromGitHub {
owner = "d87";
repo = "mpv-persist-properties";
rev = "ddb1e6bd7a7d57da9b567ea8dc5227906f416ec6";
hash = "sha256-C2nejhkxAZgfKRl9FrZZqODq2xW6zCbv/sBiqXSAd2k=";
};
}

View file

@ -0,0 +1,16 @@
{
fetchFromGitHub,
buildLua,
}:
buildLua rec {
pname = "undo-redo";
version = "unstable";
src = fetchFromGitHub {
owner = "Eisa01";
repo = "mpv-scripts";
rev = "48d68283cea47ff8e904decc9003b3abc3e2123e";
hash = "sha256-95CAKjBRELX2f7oWSHFWJnI0mikAoxhfUphe9k51Qf4=";
};
scriptPath = "${src}/scripts/UndoRedo.lua";
}