/ de-omarchy / bin / omarchy-launch-editor
swadhinbiswas Initial de-omarchy: Omarchy UI layer for Arch-based distros · 8/22/2026
9f393b2
35 lines · 653 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash

# omarchy:summary=Launch the default editor selected via Omarchy defaults.
# omarchy:args=[--inline] <path>

default_editor="$HOME/.local/state/omarchy/defaults/editor"

if [[ ${1:-} == "--inline" ]]; then
  inline=true
  shift
else
  inline=false
fi

if [[ -f $default_editor ]]; then
  read -r editor <"$default_editor"
else
  editor="nvim"
fi

omarchy-cmd-present "$editor" || editor="nvim"

case "${editor##*/}" in
nvim | vim | nano | micro | hx | helix | fresh)
  if [[ $inline == "true" ]]; then
    exec "$editor" "$@"
  else
    exec omarchy-launch-tui "$editor" "$@"
  fi
  ;;
*)
  exec setsid uwsm-app -- "$editor" "$@"
  ;;
esac