mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
954b10b388
commit
66a3e7efaa
29 changed files with 119 additions and 36 deletions
31
Cargo.lock
generated
31
Cargo.lock
generated
|
|
@ -2576,6 +2576,7 @@ dependencies = [
|
||||||
"yazi-adaptor",
|
"yazi-adaptor",
|
||||||
"yazi-config",
|
"yazi-config",
|
||||||
"yazi-prebuild",
|
"yazi-prebuild",
|
||||||
|
"yazi-scheduler",
|
||||||
"yazi-shared",
|
"yazi-shared",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -2625,6 +2626,36 @@ version = "0.1.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "394457709d77af570fcb3c0ef878336213b4e9c8f298eccde728aecd602aa7e0"
|
checksum = "394457709d77af570fcb3c0ef878336213b4e9c8f298eccde728aecd602aa7e0"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "yazi-scheduler"
|
||||||
|
version = "0.1.5"
|
||||||
|
dependencies = [
|
||||||
|
"anyhow",
|
||||||
|
"async-channel",
|
||||||
|
"bitflags 2.4.1",
|
||||||
|
"clipboard-win",
|
||||||
|
"crossterm",
|
||||||
|
"futures",
|
||||||
|
"indexmap",
|
||||||
|
"libc",
|
||||||
|
"notify",
|
||||||
|
"parking_lot",
|
||||||
|
"ratatui",
|
||||||
|
"regex",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"syntect",
|
||||||
|
"tokio",
|
||||||
|
"tokio-stream",
|
||||||
|
"tracing",
|
||||||
|
"trash",
|
||||||
|
"unicode-width",
|
||||||
|
"yazi-adaptor",
|
||||||
|
"yazi-config",
|
||||||
|
"yazi-prebuild",
|
||||||
|
"yazi-shared",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "yazi-shared"
|
name = "yazi-shared"
|
||||||
version = "0.1.5"
|
version = "0.1.5"
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ repository = "https://github.com/sxyazi/yazi"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
yazi-adaptor = { path = "../yazi-adaptor", version = "0.1.5" }
|
yazi-adaptor = { path = "../yazi-adaptor", version = "0.1.5" }
|
||||||
yazi-config = { path = "../yazi-config", version = "0.1.5" }
|
yazi-config = { path = "../yazi-config", version = "0.1.5" }
|
||||||
|
yazi-scheduler = { path = "../yazi-scheduler", version = "0.1.5" }
|
||||||
yazi-shared = { path = "../yazi-shared", version = "0.1.5" }
|
yazi-shared = { path = "../yazi-shared", version = "0.1.5" }
|
||||||
|
|
||||||
# External dependencies
|
# External dependencies
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
|
use yazi_scheduler::external;
|
||||||
use yazi_shared::event::Exec;
|
use yazi_shared::event::Exec;
|
||||||
|
|
||||||
use crate::{external, input::{op::InputOp, Input}};
|
use crate::input::{op::InputOp, Input};
|
||||||
|
|
||||||
pub struct Opt {
|
pub struct Opt {
|
||||||
before: bool,
|
before: bool,
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,10 @@ use std::ops::Range;
|
||||||
use tokio::sync::mpsc::UnboundedSender;
|
use tokio::sync::mpsc::UnboundedSender;
|
||||||
use unicode_width::UnicodeWidthStr;
|
use unicode_width::UnicodeWidthStr;
|
||||||
use yazi_config::{popup::Position, INPUT};
|
use yazi_config::{popup::Position, INPUT};
|
||||||
|
use yazi_scheduler::external;
|
||||||
use yazi_shared::InputError;
|
use yazi_shared::InputError;
|
||||||
|
|
||||||
use super::{mode::InputMode, op::InputOp, InputSnap, InputSnaps};
|
use super::{mode::InputMode, op::InputOp, InputSnap, InputSnaps};
|
||||||
use crate::external;
|
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct Input {
|
pub struct Input {
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@
|
||||||
mod blocker;
|
mod blocker;
|
||||||
pub mod completion;
|
pub mod completion;
|
||||||
mod context;
|
mod context;
|
||||||
pub mod external;
|
|
||||||
pub mod files;
|
pub mod files;
|
||||||
pub mod help;
|
pub mod help;
|
||||||
mod highlighter;
|
mod highlighter;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
use std::ffi::OsString;
|
use std::ffi::OsString;
|
||||||
|
|
||||||
use yazi_config::{popup::SelectCfg, OPEN};
|
use yazi_config::{popup::SelectCfg, OPEN};
|
||||||
|
use yazi_scheduler::external;
|
||||||
use yazi_shared::{event::Exec, MIME_DIR};
|
use yazi_shared::{event::Exec, MIME_DIR};
|
||||||
|
|
||||||
use crate::{external, manager::Manager, select::Select, tasks::Tasks};
|
use crate::{manager::Manager, select::Select, tasks::Tasks};
|
||||||
|
|
||||||
pub struct Opt {
|
pub struct Opt {
|
||||||
interactive: bool,
|
interactive: bool,
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,10 @@ use std::{collections::BTreeMap, ffi::OsStr, io::{stdout, BufWriter, Write}, pat
|
||||||
use anyhow::{anyhow, bail, Result};
|
use anyhow::{anyhow, bail, Result};
|
||||||
use tokio::{fs::{self, OpenOptions}, io::{stdin, AsyncReadExt, AsyncWriteExt}};
|
use tokio::{fs::{self, OpenOptions}, io::{stdin, AsyncReadExt, AsyncWriteExt}};
|
||||||
use yazi_config::{popup::InputCfg, OPEN, PREVIEW};
|
use yazi_config::{popup::InputCfg, OPEN, PREVIEW};
|
||||||
use yazi_shared::{emit, event::Exec, fs::{File, FilesOp}, fs::{max_common_root, Url}, term::Term, Defer};
|
use yazi_scheduler::external::{self, ShellOpt};
|
||||||
|
use yazi_shared::{emit, event::Exec, fs::{max_common_root, File, FilesOp, Url}, term::Term, Defer};
|
||||||
|
|
||||||
use crate::{external::{self, ShellOpt}, input::Input, manager::Manager, Ctx, BLOCKER};
|
use crate::{input::Input, manager::Manager, Ctx, BLOCKER};
|
||||||
|
|
||||||
pub struct Opt {
|
pub struct Opt {
|
||||||
force: bool,
|
force: bool,
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,10 @@ use notify::{event::{MetadataKind, ModifyKind}, EventKind, RecommendedWatcher, R
|
||||||
use parking_lot::RwLock;
|
use parking_lot::RwLock;
|
||||||
use tokio::{fs, pin, sync::mpsc::{self, UnboundedReceiver}};
|
use tokio::{fs, pin, sync::mpsc::{self, UnboundedReceiver}};
|
||||||
use tokio_stream::{wrappers::UnboundedReceiverStream, StreamExt};
|
use tokio_stream::{wrappers::UnboundedReceiverStream, StreamExt};
|
||||||
use yazi_shared::{emit, fs::{File, FilesOp}, fs::Url};
|
use yazi_scheduler::external;
|
||||||
|
use yazi_shared::{emit, fs::{File, FilesOp, Url}};
|
||||||
|
|
||||||
use crate::{external, files::Files};
|
use crate::files::Files;
|
||||||
|
|
||||||
pub struct Watcher {
|
pub struct Watcher {
|
||||||
watcher: RecommendedWatcher,
|
watcher: RecommendedWatcher,
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,10 @@ use std::path::Path;
|
||||||
use tokio::fs;
|
use tokio::fs;
|
||||||
use yazi_adaptor::ADAPTOR;
|
use yazi_adaptor::ADAPTOR;
|
||||||
use yazi_config::{MANAGER, PREVIEW};
|
use yazi_config::{MANAGER, PREVIEW};
|
||||||
|
use yazi_scheduler::external;
|
||||||
use yazi_shared::{event::PreviewData, MimeKind, PeekError};
|
use yazi_shared::{event::PreviewData, MimeKind, PeekError};
|
||||||
|
|
||||||
use crate::{external, Highlighter};
|
use crate::Highlighter;
|
||||||
|
|
||||||
pub(super) struct Provider;
|
pub(super) struct Provider;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
use std::ffi::{OsStr, OsString};
|
use std::ffi::{OsStr, OsString};
|
||||||
|
|
||||||
|
use yazi_scheduler::external;
|
||||||
use yazi_shared::event::Exec;
|
use yazi_shared::event::Exec;
|
||||||
|
|
||||||
use crate::{external, tab::Tab};
|
use crate::tab::Tab;
|
||||||
|
|
||||||
pub struct Opt<'a> {
|
pub struct Opt<'a> {
|
||||||
type_: &'a str,
|
type_: &'a str,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
|
use yazi_scheduler::external::{self, FzfOpt, ZoxideOpt};
|
||||||
use yazi_shared::{event::Exec, fs::ends_with_slash, Defer};
|
use yazi_shared::{event::Exec, fs::ends_with_slash, Defer};
|
||||||
|
|
||||||
use crate::{external::{self, FzfOpt, ZoxideOpt}, tab::Tab, Ctx, BLOCKER};
|
use crate::{tab::Tab, Ctx, BLOCKER};
|
||||||
|
|
||||||
pub struct Opt {
|
pub struct Opt {
|
||||||
type_: OptType,
|
type_: OptType,
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,10 @@ use anyhow::bail;
|
||||||
use tokio::pin;
|
use tokio::pin;
|
||||||
use tokio_stream::{wrappers::UnboundedReceiverStream, StreamExt};
|
use tokio_stream::{wrappers::UnboundedReceiverStream, StreamExt};
|
||||||
use yazi_config::popup::InputCfg;
|
use yazi_config::popup::InputCfg;
|
||||||
|
use yazi_scheduler::external;
|
||||||
use yazi_shared::{emit, event::Exec, fs::FilesOp};
|
use yazi_shared::{emit, event::Exec, fs::FilesOp};
|
||||||
|
|
||||||
use crate::{external, input::Input, manager::Manager, tab::Tab};
|
use crate::{input::Input, manager::Manager, tab::Tab};
|
||||||
|
|
||||||
pub struct Opt {
|
pub struct Opt {
|
||||||
pub type_: OptType,
|
pub type_: OptType,
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,10 @@ use parking_lot::Mutex;
|
||||||
use tokio::{fs, sync::mpsc};
|
use tokio::{fs, sync::mpsc};
|
||||||
use yazi_adaptor::Image;
|
use yazi_adaptor::Image;
|
||||||
use yazi_config::PREVIEW;
|
use yazi_config::PREVIEW;
|
||||||
|
use yazi_scheduler::external;
|
||||||
use yazi_shared::{emit, fs::{calculate_size, FilesOp, Url}, Throttle};
|
use yazi_shared::{emit, fs::{calculate_size, FilesOp, Url}, Throttle};
|
||||||
|
|
||||||
use crate::{external, tasks::TaskOp};
|
use crate::tasks::TaskOp;
|
||||||
|
|
||||||
pub(crate) struct Precache {
|
pub(crate) struct Precache {
|
||||||
tx: async_channel::Sender<PrecacheOp>,
|
tx: async_channel::Sender<PrecacheOp>,
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,9 @@ use std::{ffi::OsString, mem};
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use tokio::{io::{AsyncBufReadExt, BufReader}, select, sync::{mpsc, oneshot}};
|
use tokio::{io::{AsyncBufReadExt, BufReader}, select, sync::{mpsc, oneshot}};
|
||||||
|
use yazi_scheduler::external::{self, ShellOpt};
|
||||||
|
|
||||||
use crate::{external::{self, ShellOpt}, tasks::TaskOp, Ctx, BLOCKER};
|
use crate::{tasks::TaskOp, Ctx, BLOCKER};
|
||||||
|
|
||||||
pub(crate) struct Process {
|
pub(crate) struct Process {
|
||||||
sch: mpsc::UnboundedSender<TaskOp>,
|
sch: mpsc::UnboundedSender<TaskOp>,
|
||||||
|
|
|
||||||
41
yazi-scheduler/Cargo.toml
Normal file
41
yazi-scheduler/Cargo.toml
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
[package]
|
||||||
|
name = "yazi-scheduler"
|
||||||
|
version = "0.1.5"
|
||||||
|
edition = "2021"
|
||||||
|
license = "MIT"
|
||||||
|
authors = [ "sxyazi <sxyazi@gmail.com>" ]
|
||||||
|
description = "Yazi task scheduler"
|
||||||
|
homepage = "https://yazi-rs.github.io"
|
||||||
|
repository = "https://github.com/sxyazi/yazi"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
yazi-adaptor = { path = "../yazi-adaptor", version = "0.1.5" }
|
||||||
|
yazi-config = { path = "../yazi-config", version = "0.1.5" }
|
||||||
|
yazi-shared = { path = "../yazi-shared", version = "0.1.5" }
|
||||||
|
|
||||||
|
# External dependencies
|
||||||
|
anyhow = "^1"
|
||||||
|
async-channel = "^1"
|
||||||
|
bitflags = "^2"
|
||||||
|
crossterm = "^0"
|
||||||
|
futures = "^0"
|
||||||
|
indexmap = "^2"
|
||||||
|
libc = "^0"
|
||||||
|
notify = { version = "^6", default-features = false, features = [ "macos_fsevent" ] }
|
||||||
|
parking_lot = "^0"
|
||||||
|
ratatui = "^0"
|
||||||
|
regex = "^1"
|
||||||
|
serde = "^1"
|
||||||
|
serde_json = "^1"
|
||||||
|
syntect = { version = "^5", default-features = false, features = [ "parsing", "default-themes", "plist-load", "regex-onig" ] }
|
||||||
|
tokio = { version = "^1", features = [ "parking_lot", "macros", "rt-multi-thread", "sync", "time", "fs", "process", "io-std", "io-util" ] }
|
||||||
|
tokio-stream = "^0"
|
||||||
|
trash = "^3"
|
||||||
|
unicode-width = "^0"
|
||||||
|
yazi-prebuild = "^0"
|
||||||
|
|
||||||
|
# Logging
|
||||||
|
tracing = { version = "^0", features = [ "max_level_debug", "release_max_level_warn" ] }
|
||||||
|
|
||||||
|
[target."cfg(windows)".dependencies]
|
||||||
|
clipboard-win = "^4"
|
||||||
1
yazi-scheduler/src/lib.rs
Normal file
1
yazi-scheduler/src/lib.rs
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
pub mod external;
|
||||||
Loading…
Add table
Reference in a new issue