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

Could it be possible to add a metadata feature to execute shell commands in the background? #7

Open
Matthew-Tate-Scarbrough opened this issue Jun 5, 2021 · 2 comments

Comments

@Matthew-Tate-Scarbrough
Copy link

Matthew-Tate-Scarbrough commented Jun 5, 2021

In short, a feature that would allow you to enter shell syntax into the card deck. I was thinking something convoluted like this:

\#--columns russian english spanish
\#--!get_sound (sleep [&] ; gst-play-1.0 audio/[&].opus)
\#--showcolumns !get_sound(3,russian),russian

The idea, of course, is that the first argument would pass through the seconds desired to sleep before playing the sound in the background, and then the second would be whatever the text of the first column is, and also display the information of the first column.

So, in other words, what would be passed to the shell would be, in the case that the Russian word is «красный»:

sleep 3 ; gst-play-1.0 audio/красный.opus

Having such a simple solution to pass arguments to the shell would also allow spawning pictures with an external program, such as feh, and using an exclamation point/bang (!) would help further denote them. It goes without saying, but obviously all searching is done relative $PWD. This would still allow easily zipping folders with tar and sharing them.

@proycon
Copy link
Owner

proycon commented Jun 6, 2021

I like this idea (and am open to pull requests). I'm not sure about the syntax yet though. It's a bit too convoluted to integrate it into --showcolumns, we'd better make an --execcolumns or something. Also I think this would need to be an explicit opt-in option (disabled by default) because running shell commands is of course a security risk.

@Matthew-Tate-Scarbrough
Copy link
Author

I agree completely. If I were comfortable with Rust, I would figure it out and make a pull request yesterday.

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

No branches or pull requests

2 participants