refactor(management): replace curses TUIs with API-backed ncp subcommands; panel/autostart/install integration
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Executable
+85
@@ -0,0 +1,85 @@
|
||||
#!/usr/bin/env bash
|
||||
# Installs Promethean Terminal: downloads kitty, wires up the config and icon,
|
||||
# and registers the desktop entry in the app menu and on the Desktop.
|
||||
set -euo pipefail
|
||||
|
||||
# This script lives at <repo>/bin/promethean/install.sh; its own dir holds the
|
||||
# kitty conf + desktop entry it installs.
|
||||
SELF_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
KITTY_BIN="$HOME/.local/kitty.app/bin/kitty"
|
||||
DESKTOP_FILE="$SELF_DIR/promethean-terminal.desktop"
|
||||
CONF="$SELF_DIR/kitty.conf"
|
||||
NEXUS_ROOT="$(cd "$SELF_DIR/../.." && pwd)"
|
||||
RCFILE="$NEXUS_ROOT/.promethean_bashrc"
|
||||
ICON="$NEXUS_ROOT/assets/promethean-terminal.png"
|
||||
|
||||
# ── 1. Download kitty ────────────────────────────────────────────────────────
|
||||
if [[ -x "$KITTY_BIN" ]]; then
|
||||
echo "kitty already at $KITTY_BIN — skipping download (run with --update to force)"
|
||||
if [[ "${1:-}" == "--update" ]]; then
|
||||
echo "→ Updating kitty..."
|
||||
curl -fsSL https://sw.kovidgoyal.net/kitty/installer.sh | sh /dev/stdin launch=n
|
||||
fi
|
||||
else
|
||||
echo "→ Downloading kitty to ~/.local/kitty.app/ ..."
|
||||
curl -fsSL https://sw.kovidgoyal.net/kitty/installer.sh | sh /dev/stdin launch=n
|
||||
fi
|
||||
|
||||
echo " kitty $("$KITTY_BIN" --version)"
|
||||
|
||||
# ── 2. Ensure .promethean_bashrc exists ──────────────────────────────────────
|
||||
if [[ ! -f "$RCFILE" ]]; then
|
||||
echo "→ Creating $RCFILE (sourcing ~/.bashrc) ..."
|
||||
mkdir -p "$(dirname "$RCFILE")"
|
||||
cat > "$RCFILE" <<'EOF'
|
||||
# Promethean Terminal shell init
|
||||
[[ -f ~/.bashrc ]] && source ~/.bashrc
|
||||
export VIRTUAL_ENV_DISABLE_PROMPT=1
|
||||
if [[ -f "$HOME/nexus-core/Promethean/bin/activate" ]]; then
|
||||
source "$HOME/nexus-core/Promethean/bin/activate"
|
||||
fi
|
||||
export PS1='\[\e[0;35m\](Promethean)\[\e[0m\] ${debian_chroot:+($debian_chroot)}\[\e[0;37m\]\u@\h\[\e[0m\]:\[\e[1;32m\]\w\[\e[0m\]\$ '
|
||||
printf '\e]0;Promethean Terminal\a'
|
||||
EOF
|
||||
fi
|
||||
|
||||
# ── 3. Write the .desktop file (repo copy + installed copies) ────────────────
|
||||
write_desktop() {
|
||||
local dest="$1"
|
||||
cat > "$dest" <<EOF
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Promethean Terminal
|
||||
Comment=Launch a terminal with the Promethean environment
|
||||
Exec=$KITTY_BIN --config $CONF --class promethean-terminal -e bash --rcfile $RCFILE -i
|
||||
Icon=$ICON
|
||||
Terminal=false
|
||||
Categories=Utility;TerminalEmulator;
|
||||
StartupNotify=false
|
||||
StartupWMClass=promethean-terminal
|
||||
EOF
|
||||
}
|
||||
|
||||
echo "→ Writing desktop entry..."
|
||||
write_desktop "$DESKTOP_FILE"
|
||||
write_desktop "$HOME/.local/share/applications/promethean-terminal.desktop"
|
||||
|
||||
# ── 4. Desktop icon ──────────────────────────────────────────────────────────
|
||||
DESKTOP_DIR="$HOME/Desktop"
|
||||
mkdir -p "$DESKTOP_DIR"
|
||||
cp "$DESKTOP_FILE" "$DESKTOP_DIR/promethean-terminal.desktop"
|
||||
chmod +x "$DESKTOP_DIR/promethean-terminal.desktop"
|
||||
|
||||
# Mark trusted so XFCE/Nemo doesn't show the "untrusted" banner
|
||||
gio set "$DESKTOP_DIR/promethean-terminal.desktop" metadata::trusted true 2>/dev/null \
|
||||
|| xfce4-file-manager --quit 2>/dev/null || true
|
||||
|
||||
# ── 5. Refresh app menu ──────────────────────────────────────────────────────
|
||||
update-desktop-database "$HOME/.local/share/applications" 2>/dev/null || true
|
||||
|
||||
echo ""
|
||||
echo "Done. Promethean Terminal is installed."
|
||||
echo " Binary : $KITTY_BIN"
|
||||
echo " Config : $CONF"
|
||||
echo " Icon : $ICON"
|
||||
echo " Desktop: $DESKTOP_DIR/promethean-terminal.desktop"
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
# Promethean Terminal — Project Nexus
|
||||
# Loaded via: kitty --config /home/jon/nexus-core/bin/promethean/kitty.conf
|
||||
|
||||
# Window title — disable kitty's shell integration title override
|
||||
# so the PS1 escape (\e]0;Promethean Terminal\a) controls the title
|
||||
shell_integration enabled no-title
|
||||
|
||||
# Single-instance mode: subsequent launches reuse the running process (instant open)
|
||||
allow_remote_control yes
|
||||
single_instance yes
|
||||
|
||||
# Colors
|
||||
background #1a0030
|
||||
foreground #cccccc
|
||||
cursor #b040c0
|
||||
cursor_text_color #0d0010
|
||||
|
||||
# Selection
|
||||
selection_background #3d0060
|
||||
selection_foreground #ffffff
|
||||
|
||||
# Tab bar (hidden — single window use)
|
||||
tab_bar_style hidden
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Promethean Terminal
|
||||
Comment=Launch a terminal with the Promethean environment
|
||||
Exec=/home/jon/.local/kitty.app/bin/kitty --config /home/jon/nexus-core/bin/promethean/kitty.conf --class promethean-terminal -e bash --rcfile /home/jon/nexus-core/.promethean_bashrc -i
|
||||
Icon=/home/jon/nexus-core/assets/promethean-terminal.png
|
||||
Terminal=false
|
||||
Categories=Utility;TerminalEmulator;
|
||||
StartupNotify=false
|
||||
StartupWMClass=promethean-terminal
|
||||
Reference in New Issue
Block a user