Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New command: compress #626

Open
1 task
rplanchuelo opened this issue Feb 4, 2024 · 6 comments
Open
1 task

New command: compress #626

rplanchuelo opened this issue Feb 4, 2024 · 6 comments
Labels
feature New feature request

Comments

@rplanchuelo
Copy link

Is your feature request related to a problem? Please describe

I would like to compress several selected files into one file, the name of the new compressed file would be a parameter

Will you be willing to contribute this feature?

  • Yes, I'll give it a shot

Describe the solution you'd like

You could use the atool that contains many elements:

  • apack to compress
  • als for listing
  • aunpack to extract
    unarchiver (unar) could be substituted by atool

Describe alternatives you've considered

No response

Additional context

It's in Ranger (python)

@rplanchuelo rplanchuelo added the feature New feature request label Feb 4, 2024
@TornaxO7
Copy link
Contributor

TornaxO7 commented Feb 4, 2024

I'd recommend to use ouch! It's basically an all-in-one (de)compress tool!

@rplanchuelo
Copy link
Author

rplanchuelo commented Feb 4, 2024

Ouch is in Rust, maybe it is easier folk or included it to build this new feature

@sxyazi
Copy link
Owner

sxyazi commented Feb 4, 2024

Hi! Would you like to implement it as a plugin?

Once it's stable enough, it can be seamlessly integrated into Yazi as a built-in plugin (similar to existing plugins like image preview, code highlighting, folder preview, etc. – all of which are built-in plugins).

In Yazi, plugins are treated as first-class citizens, just like commands, but offering greater flexibility.

@sxyazi sxyazi added the waiting on op Waiting for more information from the original poster label Feb 4, 2024
@rplanchuelo
Copy link
Author

I could do with a file with cx.active.current.hovered, but I dont know if it is possible with a range of select files

@github-actions github-actions bot removed the waiting on op Waiting for more information from the original poster label Feb 4, 2024
@rplanchuelo
Copy link
Author

Command function doesn`t work for me. Error:

2024-02-05T17:45:09.863472Z ERROR yazi::app::commands::plugin: runtime error: [string "/home/rober/.cargo/registry/src/index.crates...."]:10: attempt to call a nil value (global 'Command')
stack traceback:
[C]: in global 'Command'
[string "/home/rober/.cargo/registry/src/index.crates...."]:10: in function <[string "/home/rober/.cargo/registry/src/index.crates...."]:4>
at /home/rober/.cargo/registry/src/index.crates.io-6f17d22bba15001f/yazi-fm-0.2.2/src/app/commands/plugin.rs:52

local child = os.execute(cmd) work
local child = Command(cmd) doesn't work (error)

And args in plugin test --sync --args='foo bar' change the string to hexadecimal code

@sxyazi
Copy link
Owner

sxyazi commented Feb 6, 2024

I could do with a file with cx.active.current.hovered, but I dont know if it is possible with a range of select files

I will add this API in the next target. For now you can use manager_emit("shell") to implement it, like this #51 (comment)

See the docs here https://yazi-rs.github.io/docs/plugins/utils/#manager_emitcmd-args-data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request
Projects
None yet
Development

No branches or pull requests

3 participants