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

Feature Request: Configuration of commands to run on selection #16

Open
koopa1338 opened this issue Nov 11, 2024 · 4 comments
Open

Feature Request: Configuration of commands to run on selection #16

koopa1338 opened this issue Nov 11, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@koopa1338
Copy link

Problem
Currently you have to pipe the output to the command you want to handle (cd, xdg-open, etc.)

Feature
To prevent adding aliases for everything, it would be nice if it where possible to configure commands that handle the selection and to group them by channel. For example the cd command doesn't make sense in the files channel. A popup that lists all configured options with a fuzzy search would be amazing.

The configuration I had in mind would look something like this:

[channels.file]
run_options = [ "xdg-open", "file", "rm" ]

[channels.git_repos]
run_options = [ "cd", "rm -r", "./local/bin/copy_commit_hash.sh" ]
@koopa1338 koopa1338 added the enhancement New feature or request label Nov 11, 2024
@alexpasmantier
Copy link
Owner

That is indeed an interesting idea I plan to come back to ASAP.
Thanks for sharing 🙏🏻

@blank-manash
Copy link

blank-manash commented Dec 4, 2024

@alexpasmantier, I'm interested in contributing to this. Let me know if we can have a discussion.

P.S Awesome Project. I have to say I ran across this project and this is now a software I don't know how I used my terminal without.

@alexpasmantier
Copy link
Owner

alexpasmantier commented Dec 5, 2024

Hi, thanks for showing interest 🙏

I'm still thinking about the way to go implementing this and how to make it integrate nicely with cable channels so that people might create their own custom actions when creating their channel prototypes which I believe would be a really nice feature.

Have you had a chance to take a look at the codebase and have any insights regarding that?

No rush, just curious :-)

Cheers

@zachvalenta
Copy link

Problem Currently you have to pipe the output to the command you want to handle (cd, xdg-open, etc.)

Just in case anyone was curious how to do this [I was; "how to get stdout from program that only writes to stdout after it closes?" was not a question I'd asked before], here's how I did it with an alias and VS Code:

alias ds='bash -c "tv | while read -r line; do code -g \"\$line\"; done"'

ds short for 电视.

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

No branches or pull requests

4 participants