Jump to content
BoD

Collection of shell scripts, completion

Recommended Posts

Hi!

 

I have a collection of shell scripts that I put in a specific folders.

 

I'd like to do something like this:

- press the Alfred hotkey

- in the search bar, type a few characters (the start of my script name)

- have auto-completion/suggestion and use it to choose the script I want to execute

- press enter to run it.

 

If one day I add a new script in this folder, I want the autocompletion to "just work" (without having to go to Alfred's settings)

 

Is there any way I could do this?

 

Thanks a lot!

Share this post


Link to post

You could use a File Filter pointed at your scripts directory. Connect it to a Run Script action with Language = /bin/bash and a Script of ./"$1" (or something like that). You might prefer a Run Terminal Command action if your scripts are interactive.

Share this post


Link to post

Wow thanks a lot!  It worked like a charm.

 

Just one question: I used a keyword, and when using it, I see my scripts in the suggested list, but I also see other things. Is there a way to filter and only show my scripts in there?   

 

In the screenshot, you can see my keyword is `q`, my scripts all start with `q_`, but in the list, items 2 and 3 are actually bookmarks, so not from my script folder.  Ideas?

 

Thanks a lot!

 

Screenshot 2019-07-29 14.04.00.png

Share this post


Link to post

@BoD Change the bookmarks feature (under Features > Web Bookmarks) to show bookmarks "via keyword" instead of "in default results". That way, you'll use "bm" (or a keyword of your choice) followed by a bookmark's name to search for bookmarks, and they won't show up in default results.

 

Cheers,
Vero

Share this post


Link to post

But I like to have my bookmarks there by default :D  No way to filter out content only for my specific keyword?

Share this post


Link to post

The simplest way is to use a keyword that doesn’t match a bunch of other stuff. “.q” instead of just “q”, for example, if you want something short.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...