Yazi: Add torrent download.

This commit is contained in:
Dmitry Voronin 2025-01-22 12:09:23 +03:00
parent 0edd6e301c
commit 3c2da7ca34
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
2 changed files with 28 additions and 8 deletions

View file

@ -63,6 +63,12 @@
run = "mpv --no-video --shuffle \"$@\"/**";
}
];
bottle_run = [
{
desc = "Run bottle";
run = openWith "btp";
}
];
browser = [
{
desc = "Browser";
@ -142,12 +148,6 @@
run = openWith "steam-run";
}
];
bottle_run = [
{
desc = "Run bottle";
run = openWith "btp";
}
];
unlock = [
{
desc = "Unlock";
@ -162,6 +162,13 @@
run = openWith "nvim";
}
];
torrent = [
{
desc = "Download";
orphan = true;
run = openWith "tdla";
}
];
video = [
{
desc = "Video";
@ -223,6 +230,7 @@
(mkMime "application/vnd.openxmlformats-officedocument.*" [ "document" ])
(mkMime "application/x-executable" [ "steam_run" ])
(mkMime "application/x-pie-executable" [ "steam_run" ])
(mkMime "application/x-bittorrent" [ "torrent" ])
{
mime = "inode/directory";

View file

@ -6,10 +6,22 @@ function tdl() {
# Download torrent files to home.
# Usage: tdla <FILES>
function tdla() {
tdl -a "${@}"
tdl --add "${@}"
}
# List download torrents.
function tdll() {
transmission-remote home.local -l
transmission-remote home.local --list
}
# Remove torrent by id.
# Usage: tdlr <ID>
function tdlr() {
tdl -t"${@}" --remove
}
# Remove and delete files torrent by id.
# Usage: tdlrd <ID>
function tdlrd() {
tdl -t"${@}" --remove-and-delete
}