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;
run = openWith "xdg-open";
}];
browser = [{
desc = "Browser";
orphan = true;
run = openWith "firefox-esr";
}];
text = [{
desc = "Text";
block = true;
run = openWith "nvim";
archive = [{
desc = "Archive";
run = openWith "unpack";
}];
audio = [{
desc = "Audio";
orphan = true;
run = openWith "mpv --no-video";
}];
video = [{
desc = "Video";
browser = [{
desc = "Browser";
orphan = true;
run = openWith "mpv";
run = openWith "firefox-esr";
}];
document = [{
desc = "Document";
orphan = true;
run = openWith "onlyoffice-desktopeditors";
}];
pdf = [{
desc = "Pdf";
orphan = true;
run = openWith "evince";
hex = [{
desc = "Hex";
block = true;
run = openWith "radare2 -c V -w";
}];
image = [{
desc = "Image";
@ -67,14 +61,29 @@
orphan = true;
run = openWith "gimp";
}];
archive = [{
desc = "Archive";
run = openWith "unpack";
mount = [{
desc = "Mount";
run = openWith "fmount";
}];
hex = [{
desc = "Hex";
pdf = [{
desc = "Pdf";
orphan = true;
run = openWith "evince";
}];
text = [{
desc = "Text";
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/zip" [ "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 "audio/*" [ "audio" ])
(mkName "*.mka" [ "audio" ])

View file

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