l 2 mpv: make scripts compatible with 0.24
This commit is contained in:
parent
d33d1f5198
commit
6e10766e9c
@ -2,15 +2,17 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
mpv-config = pkgs.writeText "mpv-config" ''
|
scripts = lib.concatStringsSep "," [
|
||||||
script=${lib.concatStringsSep "," [
|
good
|
||||||
good
|
delete
|
||||||
delete
|
];
|
||||||
]}
|
|
||||||
'';
|
mpv = pkgs.concat "mpv" [
|
||||||
mpv = pkgs.writeDashBin "mpv" ''
|
pkgs.mpv
|
||||||
exec ${pkgs.mpv}/bin/mpv --no-config --include=${mpv-config} "$@"
|
(pkgs.writeDashBin "mpv" ''
|
||||||
'';
|
exec ${pkgs.mpv}/bin/mpv --no-config --script=${scripts} "$@"
|
||||||
|
'')
|
||||||
|
];
|
||||||
|
|
||||||
moveToDir = key: dir: pkgs.writeText "move-with-${key}.lua" ''
|
moveToDir = key: dir: pkgs.writeText "move-with-${key}.lua" ''
|
||||||
tmp_dir = "${dir}"
|
tmp_dir = "${dir}"
|
||||||
@ -31,20 +33,6 @@ let
|
|||||||
up = moveToDir "U" "./up";
|
up = moveToDir "U" "./up";
|
||||||
down = moveToDir "Y" "./down";
|
down = moveToDir "Y" "./down";
|
||||||
|
|
||||||
deleteCurrentTrack = pkgs.writeText "delete.lua" ''
|
|
||||||
deleted_tmp = "./.graveyard"
|
|
||||||
|
|
||||||
-- Delete the current track by moving it to the `deleted_tmp` location.
|
|
||||||
function delete_current_track()
|
|
||||||
track = mp.get_property("path")
|
|
||||||
os.execute("mkdir -p '" .. deleted_tmp .. "'")
|
|
||||||
os.execute("mv '" .. track .. "' '" .. deleted_tmp .. "'")
|
|
||||||
print("'" .. track .. "' deleted.")
|
|
||||||
end
|
|
||||||
|
|
||||||
mp.add_key_binding("D", "delete_current_track", delete_current_track)
|
|
||||||
'';
|
|
||||||
|
|
||||||
in {
|
in {
|
||||||
krebs.per-user.lass.packages = [
|
krebs.per-user.lass.packages = [
|
||||||
mpv
|
mpv
|
||||||
|
Loading…
Reference in New Issue
Block a user