From 8c303495acdc7db220219c373b67f0aab20d7f98 Mon Sep 17 00:00:00 2001 From: Taksh Date: Tue, 1 Sep 2026 23:55:53 +0530 Subject: [PATCH 1/2] fix: use subl for the Sublime Text default editor Signed-off-by: Taksh --- bin/omarchy-default-editor | 2 +- bin/omarchy-launch-editor | 3 +++ default/omarchy/omarchy-menu.jsonc | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/omarchy-default-editor b/bin/omarchy-default-editor index 25134081..1e82e172 100755 --- a/bin/omarchy-default-editor +++ b/bin/omarchy-default-editor @@ -25,7 +25,7 @@ case "$1" in code) selection="code"; editor="code"; name="VSCode"; glyph= ;; cursor) selection="cursor"; editor="cursor"; name="Cursor"; glyph= ;; zed | zeditor) selection="zed"; editor="zeditor"; name="Zed"; glyph= ;; -sublime_text) selection="sublime_text"; editor="sublime_text"; name="Sublime Text"; glyph= ;; +sublime_text | subl) selection="sublime_text"; editor="subl"; name="Sublime Text"; glyph= ;; helix) selection="helix"; editor="helix"; name="Helix"; glyph= ;; vim) selection="vim"; editor="vim"; name="Vim"; glyph= ;; emacs) selection="emacs"; editor="emacs"; name="Emacs"; glyph= ;; diff --git a/bin/omarchy-launch-editor b/bin/omarchy-launch-editor index 8a69dabd..52999719 100755 --- a/bin/omarchy-launch-editor +++ b/bin/omarchy-launch-editor @@ -18,6 +18,9 @@ else editor="nvim" fi +# sublime-text-4 ships `subl` on PATH, not `sublime_text`. +[[ $editor == sublime_text ]] && editor=subl + omarchy-cmd-present "$editor" || editor="nvim" case "${editor##*/}" in diff --git a/default/omarchy/omarchy-menu.jsonc b/default/omarchy/omarchy-menu.jsonc index 30ee45fc..ef1a53ce 100644 --- a/default/omarchy/omarchy-menu.jsonc +++ b/default/omarchy/omarchy-menu.jsonc @@ -164,7 +164,7 @@ "setup.default.editor.vscode": {"icon":"","label":"VSCode","checked":"[[ \"$(omarchy-default-editor)\" == \"code\" ]]","action":"omarchy-default-editor code"}, "setup.default.editor.cursor": {"icon":"","label":"Cursor","checked":"[[ \"$(omarchy-default-editor)\" == \"cursor\" ]]","action":"omarchy-default-editor cursor"}, "setup.default.editor.zed": {"icon":"","label":"Zed","checked":"[[ \"$(omarchy-default-editor)\" == \"zeditor\" ]]","action":"omarchy-default-editor zed"}, - "setup.default.editor.sublime": {"icon":"","label":"Sublime Text","checked":"[[ \"$(omarchy-default-editor)\" == \"sublime_text\" ]]","action":"omarchy-default-editor sublime_text"}, + "setup.default.editor.sublime": {"icon":"","label":"Sublime Text","when":"omarchy-cmd-present subl","checked":"[[ \"$(omarchy-default-editor)\" == \"subl\" ]]","action":"omarchy-default-editor sublime_text"}, "setup.default.editor.helix": {"icon":"","label":"Helix","checked":"[[ \"$(omarchy-default-editor)\" == \"helix\" ]]","action":"omarchy-default-editor helix"}, "setup.default.editor.vim": {"icon":"","label":"Vim","checked":"[[ \"$(omarchy-default-editor)\" == \"vim\" ]]","action":"omarchy-default-editor vim"}, "setup.default.editor.emacs": {"icon":"","label":"Emacs","checked":"[[ \"$(omarchy-default-editor)\" == \"emacs\" ]]","action":"omarchy-default-editor emacs"}, From bb13b55698e327f41364fc60d3b1dd0e2f4c7d03 Mon Sep 17 00:00:00 2001 From: Taksh Date: Tue, 8 Sep 2026 14:59:34 +0530 Subject: [PATCH 2/2] fix: keep Sublime on the editor menu and persist subl A when: subl guard hid the row before install, which is how the editor gets packaged. Map stored sublime_text to subl so an existing default stays ticked, and update the default-apps tests for the PATH name. --- bin/omarchy-default-editor | 3 +++ default/omarchy/omarchy-menu.jsonc | 2 +- test/shell.d/default-apps-test.sh | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/omarchy-default-editor b/bin/omarchy-default-editor index 1e82e172..33e39553 100755 --- a/bin/omarchy-default-editor +++ b/bin/omarchy-default-editor @@ -17,6 +17,9 @@ if (($# == 0)); then read -r editor <"$editor_file" fi + # sublime-text-4 ships `subl`; older defaults stored `sublime_text`. + [[ $editor == sublime_text ]] && editor=subl + [[ -n $editor ]] && echo "$editor" || echo "nvim" exit 0 fi diff --git a/default/omarchy/omarchy-menu.jsonc b/default/omarchy/omarchy-menu.jsonc index ef1a53ce..e9826b22 100644 --- a/default/omarchy/omarchy-menu.jsonc +++ b/default/omarchy/omarchy-menu.jsonc @@ -164,7 +164,7 @@ "setup.default.editor.vscode": {"icon":"","label":"VSCode","checked":"[[ \"$(omarchy-default-editor)\" == \"code\" ]]","action":"omarchy-default-editor code"}, "setup.default.editor.cursor": {"icon":"","label":"Cursor","checked":"[[ \"$(omarchy-default-editor)\" == \"cursor\" ]]","action":"omarchy-default-editor cursor"}, "setup.default.editor.zed": {"icon":"","label":"Zed","checked":"[[ \"$(omarchy-default-editor)\" == \"zeditor\" ]]","action":"omarchy-default-editor zed"}, - "setup.default.editor.sublime": {"icon":"","label":"Sublime Text","when":"omarchy-cmd-present subl","checked":"[[ \"$(omarchy-default-editor)\" == \"subl\" ]]","action":"omarchy-default-editor sublime_text"}, + "setup.default.editor.sublime": {"icon":"","label":"Sublime Text","checked":"[[ \"$(omarchy-default-editor)\" == \"subl\" ]]","action":"omarchy-default-editor sublime_text"}, "setup.default.editor.helix": {"icon":"","label":"Helix","checked":"[[ \"$(omarchy-default-editor)\" == \"helix\" ]]","action":"omarchy-default-editor helix"}, "setup.default.editor.vim": {"icon":"","label":"Vim","checked":"[[ \"$(omarchy-default-editor)\" == \"vim\" ]]","action":"omarchy-default-editor vim"}, "setup.default.editor.emacs": {"icon":"","label":"Emacs","checked":"[[ \"$(omarchy-default-editor)\" == \"emacs\" ]]","action":"omarchy-default-editor emacs"}, diff --git a/test/shell.d/default-apps-test.sh b/test/shell.d/default-apps-test.sh index 8151c250..d4aaa26a 100755 --- a/test/shell.d/default-apps-test.sh +++ b/test/shell.d/default-apps-test.sh @@ -69,7 +69,7 @@ omarchy-pkg-add|omarchy-pkg-aur-add) firefox) command=firefox ;; zen-browser-bin) command=zen-browser ;; cursor-bin) command=cursor ;; - sublime-text-4) command=sublime_text ;; + sublime-text-4) command=subl ;; vim) command=vim ;; neovim) command=nvim ;; esac @@ -169,7 +169,7 @@ editor_cases=( 'code code editor:vscode' 'cursor cursor pkg:cursor-bin' 'zed zeditor editor:zed' - 'sublime_text sublime_text pkg:sublime-text-4' + 'sublime_text subl pkg:sublime-text-4' 'helix helix editor:helix' 'vim vim pkg:vim' 'emacs emacs editor:emacs'