Match Obsidian's dotted window class in the focus binding - #9119
Open
ya-luotao wants to merge 1 commit into
Open
Match Obsidian's dotted window class in the focus binding#9119ya-luotao wants to merge 1 commit into
ya-luotao wants to merge 1 commit into
Conversation
Obsidian reports the class md.obsidian.Obsidian on current installs, which the anchored ^obsidian$ pattern cannot match, so SUPER+SHIFT+O always relaunched instead of focusing and the single-instance lock made the key look dead. Keep the anchors so a browser tab titled "Obsidian" still cannot steal the binding, and accept the md.obsidian. prefix. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RrGftF1S6Xymu7Z58TRd3M
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
SUPER + SHIFT + Olooks dead once Obsidian is running (#8902). The binding is{ launch = "obsidian", focus = "^obsidian$" }, whichomarchy-launch-or-focuswraps as\b^obsidian$\bagainst each window's class and title. That matches a window whose class is exactlyobsidian, but current Obsidian builds report the classmd.obsidian.Obsidian, so the focus branch never matches, the script relaunches Obsidian every time, and Obsidian's single-instance lock swallows the new process without raising the existing window.Fix
Change the pattern to
^(md\.obsidian\.)?obsidian$(Lua literal"^(md\\.obsidian\\.)?obsidian$"). It matches both the bareobsidianclass andmd.obsidian.Obsidian, case-insensitively, while keeping the anchors.The anchors are deliberate: #1838 anchored this binding because a window titled "Obsidian is great!" stole the key, and ec59388 re-anchored it after the script went back to
\bmatching. Dropping them to a bareobsidianwould fix #8902 but reintroduce that false match.Fed through the exact jq expression from
bin/omarchy-launch-or-focus:^obsidian$(old)^(md\.obsidian\.)?obsidian$(new)obsidianmd.obsidian.Obsidianobsidianiteorg.obsidian.fooVerification
bin/omarchy-launch-or-focus:13.applications.luais required from$OMARCHY_PATH/default/hypr/bindings/viadefault.hypr.omarchy, not copied into~/.config, so the change reaches existing installs on update; no migration needed.test/shell.d/launch-1password-test.shandtest/shell.d/hyprland-default-config-test.shpass.hyprctl clients -j | jq -r '.[].class' | grep -i obsidianon an Omarchy box before/after would confirm the class value.Fixes #8902
🤖 Generated with Claude Code
https://claude.ai/code/session_01RrGftF1S6Xymu7Z58TRd3M