31 lines
968 B
Go
31 lines
968 B
Go
// Copyright (c) 2026 Storm Dragon
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
package app
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"git.stormux.org/storm/fenrir/internal/control"
|
|
)
|
|
|
|
// Runs after the command authorization and enablement gates.
|
|
func (a *application) remote_application(parameter string, request control.Request) {
|
|
id := strings.ToLower(strings.TrimSpace(parameter))
|
|
switch id {
|
|
case "default", "networkmanager", "ninjam", "rogue", "codex":
|
|
default:
|
|
remote_reply(request.Reply, "APPLICATION requires one ID: default, networkmanager, ninjam, rogue, codex")
|
|
return
|
|
}
|
|
if a.saver.busy || a.speechPending || a.overrideTransition {
|
|
remote_reply(request.Reply, "Settings are busy; try again after the current operation")
|
|
return
|
|
}
|
|
if a.lastTerminal == 0 || !a.lastActive {
|
|
remote_reply(request.Reply, "No active terminal for application selection")
|
|
return
|
|
}
|
|
a.select_override_result(id, func(response string) { remote_reply(request.Reply, response) })
|
|
}
|