Yazi : Add Mount & Unlock openers.

This commit is contained in:
Dmitry Voronin 2024-10-11 22:34:30 +03:00
parent 12a1815e28
commit 280275f99f
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
2 changed files with 35 additions and 22 deletions

View file

@ -27,35 +27,29 @@
orphan = true; orphan = true;
run = openWith "xdg-open"; run = openWith "xdg-open";
}]; }];
browser = [{ archive = [{
desc = "Browser"; desc = "Archive";
orphan = true; run = openWith "unpack";
run = openWith "firefox-esr";
}];
text = [{
desc = "Text";
block = true;
run = openWith "nvim";
}]; }];
audio = [{ audio = [{
desc = "Audio"; desc = "Audio";
orphan = true; orphan = true;
run = openWith "mpv --no-video"; run = openWith "mpv --no-video";
}]; }];
video = [{ browser = [{
desc = "Video"; desc = "Browser";
orphan = true; orphan = true;
run = openWith "mpv"; run = openWith "firefox-esr";
}]; }];
document = [{ document = [{
desc = "Document"; desc = "Document";
orphan = true; orphan = true;
run = openWith "onlyoffice-desktopeditors"; run = openWith "onlyoffice-desktopeditors";
}]; }];
pdf = [{ hex = [{
desc = "Pdf"; desc = "Hex";
orphan = true; block = true;
run = openWith "evince"; run = openWith "radare2 -c V -w";
}]; }];
image = [{ image = [{
desc = "Image"; desc = "Image";
@ -67,14 +61,29 @@
orphan = true; orphan = true;
run = openWith "gimp"; run = openWith "gimp";
}]; }];
archive = [{ mount = [{
desc = "Archive"; desc = "Mount";
run = openWith "unpack"; run = openWith "fmount";
}]; }];
hex = [{ pdf = [{
desc = "Hex"; desc = "Pdf";
orphan = true;
run = openWith "evince";
}];
text = [{
desc = "Text";
block = true; block = true;
run = openWith "radare2 -c V -w"; run = openWith "nvim";
}];
video = [{
desc = "Video";
orphan = true;
run = openWith "mpv";
}];
unlock = [{
desc = "Unlock";
block = true;
run = openWith "funlock";
}]; }];
}; };
@ -91,6 +100,8 @@
(mkMime "application/x-xz" [ "archive" ]) (mkMime "application/x-xz" [ "archive" ])
(mkMime "application/zip" [ "archive" ]) (mkMime "application/zip" [ "archive" ])
(mkMime "application/x-7z-compressed" [ "archive" ]) (mkMime "application/x-7z-compressed" [ "archive" ])
(mkMime "application/x-iso9660-image" [ "mount" ])
(mkMime "application/x-raw-disk-image" [ "unlock" ])
(mkMime "application/pdf" [ "pdf" ]) (mkMime "application/pdf" [ "pdf" ])
(mkMime "audio/*" [ "audio" ]) (mkMime "audio/*" [ "audio" ])
(mkName "*.mka" [ "audio" ]) (mkName "*.mka" [ "audio" ])

View file

@ -33,6 +33,7 @@
local mount=$(udisksctl mount --no-user-interaction --block-device "''${decrypted}") local mount=$(udisksctl mount --no-user-interaction --block-device "''${decrypted}")
mount="''${mount#* at }" mount="''${mount#* at }"
ya pub dds-cd --str "''${mount}" 2> /dev/null
cd "''${mount}" cd "''${mount}"
} }
@ -51,6 +52,7 @@
local mount=$(udisksctl mount --no-user-interaction --block-device "''${loop}") local mount=$(udisksctl mount --no-user-interaction --block-device "''${loop}")
mount="''${mount#* at }" mount="''${mount#* at }"
ya pub dds-cd --str "''${mount}" 2> /dev/null
cd "''${mount}" cd "''${mount}"
} }