Applications quick peek and hide if active
I'm fan of Apptivate keyboard shortcuts manager, it abandoned since 2021 but still works.
Two nice features from Apptivate is missing at KeyboardCowboy:
- quick peek: show window when shortcut hold down (or last in sequence) and hide app window if shortcut is released after some delay of holding
- hide if applications windows already active
Oh, those are both interesting ideas. Thanks for sharing @ww7, I'll see if these a doable without too much of a rewrite ❤️
Just thought of something that I've used in the past. So if you have two groups:
- Global
- Specific App (for this example, Let's use Terminal)
The global would for example hold a shortcut to show an application:
fn-t -> Terminal.
And when ~~Xcode~~ Terminal is open, you remap fn-t to Hide.
You won't get the quick peek, you you'll be able to toggle ("peek") by pushing it once to show and twice to hide.
Hope that helps.
Could you share some more insight to hide if applications windows already active?
I mean frontmost application, like Bundle Identifier: org.mozilla.firefoxdeveloperedition File Path: /Applications/Firefox Developer Edition.app/Contents/MacOS/firefox
So you want to be able to hide the current application?
Could you achieve this with a Group that is scoped to that application?
Similar to what I described here? - https://github.com/zenangst/KeyboardCowboy/issues/547#issuecomment-2320159843
Or am I missing something?
Yes, thanks! Hiding is not an issue at all, I simply meaning it will be easy to use the same shortcut for hide specific app.
Also peek functionality as it implemented it Apptivate app.
It smart!
And when Xcode is open, you remap
fn-ttoHide.
@zenangst Did you mean Terminal (instead of Xcode) here, since the example is around Terminal?
If so, I can’t make your suggestion work.
- I’ve created a shortcut to open Obsidian with F1
- I’ve created an Obsidian-specific group and added a new shortcut: hide Obsidian with F1
The first shortcut works, the second one doesn’t. What am I missing?
@theprivacydesigner
Oh right, yeah Xcode was a typo, meant Terminal.
I think you setup looks correct. I've installed Obsidian and will try and recreate the your desired workflow to check if there is a bug in the mix or if something "non obvious" is missing, because this should work.
What if you try to use the Hide command using a keyboard shortcut instead of the application command.
That did the trick! Thank you.
For reference:
@theprivacydesigner Fantastic! I'm still gonna check if there is a bug in the hide application command, so thanks for bringing it to my attention.
@zenangst just a guess but... in the first setup I tried (the one that didn’t work) I turned on notifications for each command... it looked like both show and hide were triggered when the application was in focus. Which probably is why the app wasn’t hiding.
Hide can be implemented regardless to which windows in focus, but via "Active" status.
Hey @ww7,
Here is some good news for you... I went ahead and implemented application peeking functionality that will be available in the upcoming version.
Great, thanks! Peek will switch to app if hold less than 100-400ms?
@ww7 Not currently, the implementation that I made is based on keyDown show and then keyUp to hide it again when the user releases the key. But I do like the suggestion.
I'm gonna take a stab at it because I can see the potential in it not disappearing if I hold the key down for a longer period of time.
I think I managed to figure it out now.
Initial suggestion is wrongly described by me.
Peek implementation can be in same time as application activation, hiding and peek.
- Activate after keyDown and keyUp with delay between less than 400ms (or 100-400)
- Hide if app is frontmost (active) with same behavior as Activate
- Peek after keyDown and keyUp holded, and hide if keyUp released (but hold longer 400ms)
Current default app activation may have "hide if active" flag, this allows to have less shortcuts.
@ww7 3.25.0 now support peeking (sounded way better in my head 🤣).
https://github.com/zenangst/KeyboardCowboy/releases/tag/3.25.0
@zenangst peeking works nice! one request, to add "Hide if active" ("Hide if frontmost") as flag/checkbox or as default behavior for Peek (when not held)
@ww7 I managed to achieve that behavior by just having a keyboard shortcut scoped to that app.
I guess that option would save you creating a group and having multiple shortcuts.
I have all my apps with shortcuts (~30), it hard to manage Hide for all of them, my previous workflow was:
- hold keys - peek
- press once - show
- press second time - hide So with press it works also as Peek but without need to hold the last key
As I have two languages (non-latin), all shortcuts doubled... Manage Hide to all of them blowing mind
(offtopic about interface: "Check for updates" window have funny ).), "About" new line before last ) and "Whats new" truncate some peoples)
Initially I thought peek and hide if active/frontmost can be as flags for Opening
Hey @ww7, I had a thought. Instead of making 'Peek' a modifier, let's make it an action. That way, users won't accidentally mix it with 'hide' or 'unhide,' which wouldn't make much sense.
Oh, and 'Peek' also has some special behavior when it comes to 'keyUp' based on a time interval. I didn't want that to be part of the regular path if the user just wants to open an application.
I know this got a bit technical, but I hope you get the idea.
By the way, I think we could still add 'Hide when active/frontmost' as a modifier. I'll check if we can't get that into the next version.
Hoping to have Peek with the ability to hide someday :)