Lokale KI-Station fuer Zorin OS: Bash-Installer + Docker Compose (Ollama 0.30.7, Open WebUI 0.9.6, n8n 2.25.7), drei roemische Berater als Ollama-Modelfiles, Theme via gsettings, Desktop-Shortcuts. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
64 lines
2 KiB
Bash
Executable file
64 lines
2 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# Legt Startmenü- und Desktop-Verknüpfungen für Forum (Chat) und Werkstatt (n8n) an.
|
|
set -euo pipefail
|
|
|
|
log() { printf '\033[1;33m[ROMAN]\033[0m %s\n' "$*"; }
|
|
|
|
# shellcheck disable=SC1091
|
|
. ./.env
|
|
webui_port="${WEBUI_PORT:-3000}"
|
|
n8n_port="${N8N_PORT:-5678}"
|
|
|
|
apps_dir="$HOME/.local/share/applications"
|
|
icon_dir="$HOME/.local/share/icons/hicolor/scalable/apps"
|
|
mkdir -p "$apps_dir" "$icon_dir"
|
|
|
|
if [ -f theme/icon.svg ]; then
|
|
cp -f theme/icon.svg "$icon_dir/roman-station.svg"
|
|
fi
|
|
|
|
# Chromium-Familie kann ein sauberes App-Fenster öffnen, sonst Standardbrowser
|
|
launcher_for() {
|
|
url="$1"
|
|
for b in brave-browser google-chrome chromium chromium-browser; do
|
|
if command -v "$b" >/dev/null 2>&1; then
|
|
printf '%s --app=%s' "$b" "$url"
|
|
return
|
|
fi
|
|
done
|
|
printf 'xdg-open %s' "$url"
|
|
}
|
|
|
|
make_entry() {
|
|
file="$1"; name="$2"; comment="$3"; url="$4"
|
|
cat > "$file" <<EOF
|
|
[Desktop Entry]
|
|
Type=Application
|
|
Name=$name
|
|
Comment=$comment
|
|
Exec=$(launcher_for "$url")
|
|
Icon=roman-station
|
|
Terminal=false
|
|
Categories=Network;Utility;
|
|
EOF
|
|
chmod +x "$file"
|
|
}
|
|
|
|
make_entry "$apps_dir/roman-forum.desktop" "Roman Station — Forum" "Sprich mit deinen römischen Beratern" "http://localhost:$webui_port"
|
|
make_entry "$apps_dir/roman-werkstatt.desktop" "Roman Station — Werkstatt" "KI-Workflows bauen (n8n)" "http://localhost:$n8n_port"
|
|
|
|
if command -v xdg-user-dir >/dev/null 2>&1; then
|
|
desktop_dir="$(xdg-user-dir DESKTOP)"
|
|
else
|
|
desktop_dir="$HOME/Desktop"
|
|
fi
|
|
|
|
if [ -d "$desktop_dir" ]; then
|
|
cp -f "$apps_dir/roman-forum.desktop" "$apps_dir/roman-werkstatt.desktop" "$desktop_dir/"
|
|
chmod +x "$desktop_dir/roman-forum.desktop" "$desktop_dir/roman-werkstatt.desktop"
|
|
# GNOME verlangt sonst einen Rechtsklick → "Starten erlauben"
|
|
gio set "$desktop_dir/roman-forum.desktop" metadata::trusted true 2>/dev/null || true
|
|
gio set "$desktop_dir/roman-werkstatt.desktop" metadata::trusted true 2>/dev/null || true
|
|
fi
|
|
|
|
log "Verknüpfungen angelegt (Startmenü + Schreibtisch)."
|