The lack of a global shortcut to hide/show the window was a huge productivity hit, so I made this autohotkey script that hacks it in.
I expect it to have edge cases, maybe glitchiness sometimes as has to be expected every time you try to hack features like this into an app (this should really just be built it). For example, it doesn’t account for multiple windows.
ScrollLock::
global hidden_obsidian_window_id
window_id := WinExist("ahk_exe Obsidian.exe")
; If app window exists (hidden windows are ignored by WinExist)
if (window_id) {
; Check if it's focused
if (WinActive("ahk_id " . window_id)) {
; Activate previous window
Send !{Esc}
; Save window id and hide
hidden_obsidian_window_id := window_id
WinHide, % "ahk_id " . window_id
} else {
; Focus
WinActivate, % "ahk_id " . window_id
}
} else {
if (hidden_obsidian_window_id) {
; Unhide
WinShow, % "ahk_id " . hidden_obsidian_window_id
WinActivate, % "ahk_id " . hidden_obsidian_window_id
hidden_obsidian_window_id := false
} else {
; Launch the app
EnvGet, A_LocalAppData, LocalAppData
Run, % A_LocalAppData . "\Obsidian\Obsidian.exe"
}
}
return