Page 1 of 1

Shell script support

Posted: Sun Mar 05, 2017 11:02 pm
by JayB
I've just had a look at fman – https://fman.io … it's a very rudimentary file manager, extremely fast – just check /usr/share/man/man1 –, but it has no connections to basic macOS functionality. (You can't even seem to launch app bundles. [???]) Among the things I like (and prefer) with Nimble Commander is that the contextual menu still works, and that I can run scripts via workflows. But fman has at least a python plugin API to enhance functionality, or even do some more complicated stuff. My question is if there's space for Nimble Commander to offer something similar, i.e. a way to run scripts on selected files or directories. Shell scripts (bash) would be sufficient, I guess, and to keep with the background functionality: quiet scripts, i.e. without a visible shell/terminal. I know it's not really necessary, because Services still work, but I just wanted to throw this out there. :) The downside with the Services thing is that it's slow: there's often the macOS spinning beachball, before the contextual menu even loads, and a directly integrated shell script functionality could be quite nice, e.g. there's a script directory associated with Nimble Commander – e.g. $HOME/Library/Application\ Support/Nimble\ Commander/bin – and the scripts added by the user into that bin folder are loaded at launch, and they'll be available in a menu, e.g. when hitting CMD-0.

EDIT: this could in fact add a lot of value to NC, if user scripts are shared with the public, e.g. in a GitHub repo. (git clone, create new, add, pull request if approved etc.)

Re: Shell script support

Posted: Tue Mar 07, 2017 6:52 am
by mike
Aren't External Tools sufficient for such tasks?

Re: Shell script support

Posted: Tue Mar 07, 2017 8:34 am
by JayB
Imho the only advantage is that an integration into NC would be faster than external solutions like macOS Services. But it wouldn't add functionality on its own, only through user content.

Re: Shell script support

Posted: Tue Mar 07, 2017 9:55 am
by mike
Got it, but again - what's the difference with mechanism that's already here and already working - called [External] Tools, last tab in Preferences.
You can use it to run any arbitrary shell script with plenty of various parameters as input.

Re: Shell script support

Posted: Tue Mar 07, 2017 10:13 am
by JayB
Oh damn, I totally forgot about that! :shock: :?

Re: Shell script support

Posted: Tue Mar 07, 2017 10:15 am
by mike
:D

Re: Shell script support

Posted: Tue Mar 07, 2017 5:54 pm
by sasha
JayB wrote:
Sun Mar 05, 2017 11:02 pm
I've just had a look at fman – https://fman.io … it's a very rudimentary file manager, extremely fast – just check /usr/share/man/man1 –...
As you brought fman up, I really like how they "borrowed" Sublime Text's Goto-Anything (Cmd+P) function (and even kept the keyboard shortcut). IMHO, a more user-friendly way than NC's Goto-Folder (Cmd+Shift+G). Especially since the latter lacks a history and keyboard navigation is a bit cumbersome - just try navigating to /usr/share/man/man1 and count the keystrokes.

They also copied ST's command palette (Cmd+Shift+P). Also something I wouldn't mind see in a future NC implementation ;)

Re: Shell script support

Posted: Tue Mar 07, 2017 8:19 pm
by JayB
Well, I think that wouldn't be too hard, would it? CMD-SHIFT-P, and then you have a list of the external tools in a pop-up window or drop-down menu. For "Go To" I actually prefer CMD-SHIFT-G, because it's in line with the Finder command, even though CMD-P is (slightly) better ergonomically. A history for your visited paths, available when hitting CMD-SHIFT-G, would be great, though, I agree. I'm always hanging around in some /usr space. It's much better already in NC than in Finder, but I do see room for speed improvement.