From 6e10766e9cf1eb070cee139e2cdec61bed186058 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 25 Mar 2017 22:49:26 +0100 Subject: l 2 mpv: make scripts compatible with 0.24 --- lass/2configs/mpv.nix | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) (limited to 'lass') diff --git a/lass/2configs/mpv.nix b/lass/2configs/mpv.nix index 9988e788f..d9c6274db 100644 --- a/lass/2configs/mpv.nix +++ b/lass/2configs/mpv.nix @@ -2,15 +2,17 @@ let - mpv-config = pkgs.writeText "mpv-config" '' - script=${lib.concatStringsSep "," [ - good - delete - ]} - ''; - mpv = pkgs.writeDashBin "mpv" '' - exec ${pkgs.mpv}/bin/mpv --no-config --include=${mpv-config} "$@" - ''; + scripts = lib.concatStringsSep "," [ + good + delete + ]; + + mpv = pkgs.concat "mpv" [ + pkgs.mpv + (pkgs.writeDashBin "mpv" '' + exec ${pkgs.mpv}/bin/mpv --no-config --script=${scripts} "$@" + '') + ]; moveToDir = key: dir: pkgs.writeText "move-with-${key}.lua" '' tmp_dir = "${dir}" @@ -31,20 +33,6 @@ let up = moveToDir "U" "./up"; 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 { krebs.per-user.lass.packages = [ mpv -- cgit v1.2.3