Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions standards/launcher-standard.a2ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,33 @@
# - standards/docs/UX-standards/LM-LA-LIFECYCLE-STANDARD.adoc (install/uninstall)

[spec]
version = "0.1.0"
date = "2026-04-10"
version = "0.2.0"
date = "2026-04-17"
compliance = [
"launcher-standard.adoc",
"LM-LA-LIFECYCLE-STANDARD.adoc",
"cross-platform-system-integration-modes",
"fallback-ladder-keepopen",
]

[fallback-ladder]
# keepopen.sh wraps every primary desktop-file Exec line. It turns launcher
# failures from invisible flashes into loud, labelled banners, and lands the
# user in an interactive shell at the repo root if everything fails.
#
# See launcher-standard.adoc §Fallback Ladder for the prose version.
wrapper = "keepopen.sh"
canonical-path = "developer-ecosystem/standards/launcher/keepopen.sh"
deployed-symlink = "/var/mnt/eclipse/repos/.desktop-tools/keepopen.sh"
calling-convention = "keepopen.sh APP_NAME REPO_DIR \"GUI_CMD\" \"TUI_CMD\" [LOG_FILE]"
stages = [
{ name = "gui", colour = "yellow", on-failure = "show-banner-then-try-tui" },
{ name = "tui", colour = "red", on-failure = "show-banner-then-drop-to-shell" },
{ name = "shell", colour = "green", behaviour = "exec-bash-login-at-repo-dir" },
]
banner-visibility = "loud" # Intentionally ugly — visibility beats aesthetics.
final-shell = "bash -l at REPO_DIR (never 'press enter to close')"

[required-modes]
# These are the modes every compliant launcher MUST implement.
runtime = ["--start", "--stop", "--status", "--auto", "--browser"]
Expand Down
25 changes: 23 additions & 2 deletions templates/launcher.sh.tera
Original file line number Diff line number Diff line change
Expand Up @@ -325,16 +325,37 @@ write_linux_desktop_file() {
else
icon_name="package-x-generic"
fi

# keepopen.sh implements the standard fallback ladder: GUI → TUI →
# bash-at-repo-root. See launcher-standard.adoc §Fallback Ladder.
local keepopen="/var/mnt/eclipse/repos/.desktop-tools/keepopen.sh"
local gui_cmd tui_cmd
{% if runtime_kind == "server-url" -%}
# server-url: GUI = start server + open browser + tail log (so terminal
# stays open); TUI = start-only + follow log; Shell = repo root.
gui_cmd="$LAUNCHER_TARGET --auto && tail -f $LOG_FILE"
tui_cmd="$LAUNCHER_TARGET --start && tail -f $LOG_FILE"
{%- elif runtime_kind == "remote" -%}
# remote: GUI = open remote URL; TUI = print status; Shell = repo root.
gui_cmd="$LAUNCHER_TARGET --browser"
tui_cmd="$LAUNCHER_TARGET --status"
{%- else -%}
# process: GUI = start then tail log so terminal stays open;
# TUI = just tail the existing log; Shell = repo root.
gui_cmd="$LAUNCHER_TARGET --start && tail -f $LOG_FILE"
tui_cmd="tail -n 200 -f $LOG_FILE"
{%- endif %}

cat > "$target" <<EOF
[Desktop Entry]
Type=Application
Version=1.0
Name=$APP_DISPLAY
GenericName=$APP_GENERIC_NAME
Comment=$APP_DESC
Exec=$LAUNCHER_TARGET {% if runtime_kind == "process" %}--start{% else %}--auto{% endif %}
Exec=$keepopen "$APP_DISPLAY" "$REPO_DIR" "$gui_cmd" "$tui_cmd" "$LOG_FILE"
Icon=$icon_name
Terminal=false
Terminal=true
Categories=$APP_CATEGORIES
StartupNotify=true
StartupWMClass=$APP_NAME
Expand Down