Hotkey to focus obsidian window

Hi. Thanks for developing this great app. I just started using obsidian, but I find I am using obsidian more and more. I am on Linux (Ubuntu). So I often use the shortcut ALT + TAB to switch to the obsidian window. This works fine. But I wondered if this can be improved more. Since after pressing ALT + TAB to switch to obsidian I often need to press TAB some more times if I have let’s say 4 applications that I use often. I may need to press ALT + TAB and then the application switcher appears and still while holding down ALT I press tab some more times to select the obsidian app from the list.

What I would like is to assign a shortcut key like F10 that will immediately focus the obsidian app (I am only using one instance of obsidian, so it can’t be confusion about which obsidian instance to focus here)

This will be a great improvement for me to avoid having repeatedly press ALT+TAB+TAB...

I researched this a little bit and found that you can set hot keys associated with running a command in Ubuntu like this:

https://help.ubuntu.com/stable/ubuntu-help/keyboard-shortcuts-set.html.en

For this to work, I think obsidian must implement some features though. What I am thinking is that when running obsidian from terminal can we have a command line option like

$ obsidian --focus

or something. That will instead of running a new obsidian instance activate and focus the window of the last opened instance?

Then this can be used as the “command” to execute when pressing F10 (or another hot key that the user assigns for this purpose). I think VS Code already has this feature. If you just type code (to run VS Code) in the terminal, it will focus the last opened instance (in that directory) instead of opening a new instance of VS Code.

For now, there is a workaround if you are using the X11 display server (not Wayland) on Ubuntu. You can use this command:

wmctrl -a "Obsidian v0"

this will focus the first obsidian window it finds.