system-wide hotkey
system-wide hotkey
Is it possible to make a system-wide hotkey to show/hide Nimble Commander like the one iTerm has? I find it very useful to be able to hide the iTerm window or make it the active window no matter what application is currently active with a single shortcut and I think Nimble Commander would be even more useful with such a hotkey than it already is.
New user of Nimble Commander and so far I love it.
New user of Nimble Commander and so far I love it.
Re: system-wide hotkey
Hi buzy,
I haven't don't it myself, but I'm pretty sure it's possible to achieve by using Automator and Apple Script.
There's no need to add anything to NC for this functionality.
I haven't don't it myself, but I'm pretty sure it's possible to achieve by using Automator and Apple Script.
There's no need to add anything to NC for this functionality.
Re: system-wide hotkey
Thanks for the fast response. I haven't used Automator and Apple Script so far but I'll try it out once I don't have as many projects from school and have more free time.
Re: system-wide hotkey
The AppleScript is super simple:
If NC is running, it will come into foreground, and if it's not running, it will be launched instead. The same can be done with a shell script:
Put either of those in an Automator workflow, either as "Run AppleScript" or as "Run Shell Script", and set a keyboard shortcut in System Preferences.
However, Automator is super slow, and it also adds that hideous icon in your menu bar, so a global hotkey to toggle NC would be a nice feature, and it doesn't seem very complicated to do: https://dev.to/mitchartemis/creating-a- ... swift-25e9
However, you also have a quick way to switch with CMD-TAB, then hold the CMD key and use the arrow keys to navigate. Or alternatively with ALT-TAB, if you're using AltTab: https://github.com/lwouis/alt-tab-macos/
If you have a TouchBar, you can use TouchSwitcher: https://hazeover.com/touchswitcher.html… or use BetterTouchTool and program your own global touchbar button to toggle NC from anywhere in any app with one of the above one-liners: https://folivora.ai/
Code: Select all
tell application "Nimble Commander" to activate
Code: Select all
open -a "Nimble Commander"
However, Automator is super slow, and it also adds that hideous icon in your menu bar, so a global hotkey to toggle NC would be a nice feature, and it doesn't seem very complicated to do: https://dev.to/mitchartemis/creating-a- ... swift-25e9
However, you also have a quick way to switch with CMD-TAB, then hold the CMD key and use the arrow keys to navigate. Or alternatively with ALT-TAB, if you're using AltTab: https://github.com/lwouis/alt-tab-macos/
If you have a TouchBar, you can use TouchSwitcher: https://hazeover.com/touchswitcher.html… or use BetterTouchTool and program your own global touchbar button to toggle NC from anywhere in any app with one of the above one-liners: https://folivora.ai/
Re: system-wide hotkey
Thanks for all the options JayB. I've been using CMD+TAB so far. Closing and opening NC with spotlight every time you need it isn't that bad either considering how snappy NC is
Re: system-wide hotkey
A good framework to include for a global shortcut would be MASShortcut: https://github.com/shpakovski/MASShortcut
Since NC is also available on the MAS, that could maybe be an option. I have a couple of apps installed that use it (MAS like Twitterrifc and non-MAS like Command-Q).
Since NC is also available on the MAS, that could maybe be an option. I have a couple of apps installed that use it (MAS like Twitterrifc and non-MAS like Command-Q).
Re: system-wide hotkey
@JayB Do you know if iTerm also uses it?
Re: system-wide hotkey
Doesn't look that way. Does iTerm even register system-wide keyboard shortcuts?
Re: system-wide hotkey
Yes it does:
- Attachments
-
- Screenshot 2021-01-30 at 19.38.55.jpg (78.24 KiB) Viewed 10268 times
Re: system-wide hotkey
Oh, yeah: it seems iTerm is using CGSInternal (third-party): https://gitlab.com/gnachman/iterm2/-/tr ... GSInternal
…the file CGSHotKeys.h is surely relevant.
…the file CGSHotKeys.h is surely relevant.