diff --git a/migrations/1779219192.sh b/migrations/1779219192.sh index 9affc389..17aaada8 100644 --- a/migrations/1779219192.sh +++ b/migrations/1779219192.sh @@ -2,7 +2,7 @@ echo "Move default editor selection to ~/.local/state/omarchy/defaults/editor" editor=$(sed -n 's/^export EDITOR=//p' ~/.config/uwsm/default 2>/dev/null | head -n 1) -if [[ -z $editor || $editor == "omarchy-launch-editor" ]]; then +if [[ -z $editor || $editor == "omarchy-launch-editor" || $editor == "omarchy-launch-editor --inline" || $editor == '"omarchy-launch-editor --inline"' ]]; then editor="nvim" fi @@ -14,9 +14,9 @@ fi if [[ -f ~/.config/uwsm/default ]]; then if grep -q '^export EDITOR=' ~/.config/uwsm/default; then - sed -i 's|^export EDITOR=.*|export EDITOR=omarchy-launch-editor|' ~/.config/uwsm/default + sed -i 's|^export EDITOR=.*|export EDITOR="omarchy-launch-editor --inline"|' ~/.config/uwsm/default else - printf '\n# Used by terminal programs to open files with the selected Omarchy default editor\nexport EDITOR=omarchy-launch-editor\n' >>~/.config/uwsm/default + printf '\n# Used by terminal programs to open files with the selected Omarchy default editor\nexport EDITOR="omarchy-launch-editor --inline"\n' >>~/.config/uwsm/default fi else omarchy-refresh-config uwsm/default diff --git a/migrations/1779449206.sh b/migrations/1779449206.sh new file mode 100644 index 00000000..21ec629b --- /dev/null +++ b/migrations/1779449206.sh @@ -0,0 +1,11 @@ +echo "Use inline Omarchy editor launcher for terminal EDITOR" + +if [[ -f ~/.config/uwsm/default ]]; then + if grep -q '^export EDITOR=omarchy-launch-editor$' ~/.config/uwsm/default; then + sed -i 's|^export EDITOR=omarchy-launch-editor$|export EDITOR="omarchy-launch-editor --inline"|' ~/.config/uwsm/default + elif ! grep -q '^export EDITOR=' ~/.config/uwsm/default; then + printf '\n# Used by terminal programs to open files with the selected Omarchy default editor\nexport EDITOR="omarchy-launch-editor --inline"\n' >>~/.config/uwsm/default + fi +else + omarchy-refresh-config uwsm/default +fi