Home / GitHub Page

Global hotkey/shortcut for activating a running Joplin instance?

Is it possible to configure a global hotkey in Joplin (Joplin would register that hotkey system wide in Microsoft Windows) that will activate/bring to front an already running Joplin instance?
That would make it easier/faster to access Joplin.

@Axe

Welcome to the forum.

You can do this yourself using Windows built in functions.

Right-click the Joplin icon and select “Properties”. Then add a shortcut key to start Joplin. If Joplin is already running or running and minimised it will open it and bring it to the front.

Note: At first it may seem impossible to set the shortcut as the field appears to do nothing when you put the cursor in it. The trick is to put the cursor in the field and then press “Ctrl”. This wil auto-populate the field with CTRL + ALT + and you then add the final value (J in this case)

Just for completeness, you can also use CTRL + SHIFT + or SHIFT + ALT +. Just press them both when the cursor is in the “Shortcut key:” field.

Thanks both of you, but that solution unfortunately has a drawback:
I’m using the portable version, which takes about 5 seconds to start.
And this delay also always occurs when I use the suggested approach via the link, even if it is already running…
Having Joplin registering a hotkey itself wouldn’t cause that ‘annoying’ delay.

Have you tried to use Autohotkey with a Powershell script that cd’s into the portable directory before launch?

I didn’t realise that the portable version was slow to start.

I can’t see why Joplin creating the shortcut key would be any different from you creating the shortcut key?

Also I doubt that it would be wise to have a “portable” version automatically create such a link. The whole portable app concept is that the app is not in any way linked to the underlying OS. Otherwise if you had Joplin on a USB drive every machine you plugged it into and ran Joplin would be modified with a shortcut key that would relate to a program that was not always present.

@bedwardly-down:
No, I didn’t. What would be the benefit in your opinion?

@dpoulton:
We have a misunderstanding here. I don’t want Joplin creating or patching any link-file.
I would like it registering a system wide hotkey in Windows at runtime. That’s a difference.
Take a look here: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-registerhotkey

Big difference is autohotkey is fast and the gui tool allows building scripts without touching any code. It was made to fix a lot of Windows shortcut shortcomings. And you don’t absolutely need to use a Powershell script for it to work; what you’re wanting to do should be doable in Autohotkey, but using it would allow you to have a shortcut type approach as long as the Joplin portable directory is always named the same and you just upgrade by replacing files.

@bedwardly-down: I still don’t get the benefit by your suggestion. In my opinion executing the portable version of Joplin always takes these seconds, regardless if it’s already running or not.
So why should there be a difference in how I start Joplin?

I misread this as the current hotkey approach adding delay, so i suggested AHK since it’s usually faster than the shortcut approach that Windows uses.

Yes I do!

I did not think that there would be a noticable difference to the end result by using a link-file shortcut key OR registering a key with the OS. I did not mean that Joplin patched a link-file. It also appears that I wrongly thought you were wanting Joplin to make permanent changes to the underlying OS rather than Joplin “listening out” for a key-combo only whilst running. Apologies. Some terms were poorly used by me with “link” meaning either a link-file or a link into the OS.

I just tried the portable version and I see what you mean. Using a shortcut key-combo in a link-file is sluggish. However clicking the notification tray icon when Joplin is running but minimised is almost instantaneous, so it seems that quickly re-opening Joplin portable can be done. I guess that you don’t want to have to click the tray icon to re-open Joplin which is fair enough if you are a keyboard focussed user.

I’ll back out of this thread now before I cause more confusion and hopefully one of the devs will be able to give a definitive as to whether this is possible.

Unfortunately this doesn’t work on macOS.

We would need a global shortcut for the tray menu item Open Joplin.

@dpoulton: Thanks for clearing the misunderstanding. As a developer, I’m really keyboard focussed. :wink:

@tessus: Yes, that’s correct. For sure, technically, there will be differences in implementation for Windows and macOS, but in an abstract way of view, this is what we need. Many applications allow the user to configure the definition of a proper hotkey combination in the config.

So as I now know, that it is not yet possible/implemented in Joplin:
Is there a way to make an official feature request of it?

No idea, if it will be accepted though:

@tessus: Many thanks for your effort! I really appreciate it!

Just a remark from my side: Surely this hotkey should finally be configurable, if other applications might have registered this hotkey already. :wink:

In that case the other apps should also have the possibility to change the hotkey, which means that Joplin does not have to. :wink:

But yes, it’s the plan during the revamp of the shortcuts system…

@tessus: Thanks for your implementation. But the implemented logic is too much I would say. It toggles the visibility instead of just bringing it to front. That matters if I didn’t hide it with the hotkey, but any other app is in front of it. When I then want to activate Joplin, I would have to press the hotkey twice! The first then ‘hides’ it, the second will finally display it.

That was the intention. It hides and shows Joplin. It’s not a bring-it-to-front global shortcut.

Ok, your intention, not mine (see topic). :wink:
In my opinion it makes no sense to hide it via hotkey.