setup_wayland.sh aktualisiert
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
script_content = """#!/bin/sh
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Farben für eine schöne Ausgabe
|
||||
C_GREEN='\\033[1;32m'
|
||||
C_CYAN='\\033[1;36m'
|
||||
C_YELLOW='\\033[1;33m'
|
||||
C_RED='\\033[1;31m'
|
||||
C_RESET='\\033[0m'
|
||||
C_GREEN='\033[1;32m'
|
||||
C_CYAN='\033[1;36m'
|
||||
C_YELLOW='\033[1;33m'
|
||||
C_RED='\033[1;31m'
|
||||
C_RESET='\033[0m'
|
||||
|
||||
echo -e "${C_CYAN}===================================================="
|
||||
echo -e " J.A.R.V.I.S. - Alpine Wayland & wdotool Setup"
|
||||
@@ -19,17 +19,17 @@ if [ "$(id -u)" -ne 0 ]; then
|
||||
fi
|
||||
|
||||
# 2. Repositories aktualisieren und Basispakete installieren
|
||||
echo -e "\\n${C_GREEN}[1/6] Installiere Systempakete (Wayland, Labwc, Rust)...${C_RESET}"
|
||||
echo -e "\n${C_GREEN}[1/6] Installiere Systempakete (Wayland, Labwc, Rust)...${C_RESET}"
|
||||
apk update
|
||||
apk add wayland labwc foot dbus seatd cargo wayland-dev libxkbcommon-dev build-base bash nano
|
||||
|
||||
# 3. seatd aktivieren und starten (wichtig für Grafik- und Input-Rechte)
|
||||
echo -e "\\n${C_GREEN}[2/6] Konfiguriere und starte den seatd-Dienst...${C_RESET}"
|
||||
echo -e "\n${C_GREEN}[2/6] Konfiguriere und starte den seatd-Dienst...${C_RESET}"
|
||||
rc-update add seatd default
|
||||
rc-service seatd start || true
|
||||
|
||||
# 4. Benutzer abfragen und Gruppen zuweisen
|
||||
echo -e "\\n${C_GREEN}[3/6] Benutzerkonfiguration...${C_RESET}"
|
||||
echo -e "\n${C_GREEN}[3/6] Benutzerkonfiguration...${C_RESET}"
|
||||
if [ -z "$TARGET_USER" ]; then
|
||||
echo -n "Für welchen Benutzernamen soll Wayland eingerichtet werden? "
|
||||
read TARGET_USER
|
||||
@@ -49,7 +49,7 @@ addgroup "$TARGET_USER" video || true
|
||||
addgroup "$TARGET_USER" input || true
|
||||
|
||||
# 5. wdotool global für das gesamte System installieren
|
||||
echo -e "\\n${C_GREEN}[4/6] Kompiliere und installiere wdotool global...${C_RESET}"
|
||||
echo -e "\n${C_GREEN}[4/6] Kompiliere und installiere wdotool global...${C_RESET}"
|
||||
echo -e "${C_YELLOW}(Das kann beim ersten Mal 1-2 Minuten dauern, da Cargo die Abhängigkeiten baut)${C_RESET}"
|
||||
# Installiert das Binary direkt sauber nach /usr/local/bin/wdotool
|
||||
cargo install --root /usr/local wdotool
|
||||
@@ -58,7 +58,7 @@ cargo install --root /usr/local wdotool
|
||||
USER_HOME=$(eval echo ~$TARGET_USER)
|
||||
LABWC_CONFIG_DIR="$USER_HOME/.config/labwc"
|
||||
|
||||
echo -e "\\n${C_GREEN}[5/6] Erstelle Labwc-Konfigurationsdateien für '$TARGET_USER'...${C_RESET}"
|
||||
echo -e "\n${C_GREEN}[5/6] Erstelle Labwc-Konfigurationsdateien für '$TARGET_USER'...${C_RESET}"
|
||||
mkdir -p "$LABWC_CONFIG_DIR"
|
||||
|
||||
# Minimales Rechtsklick-Menü erstellen
|
||||
@@ -91,7 +91,7 @@ chown -R "$TARGET_USER":"$TARGET_USER" "$USER_HOME/.config"
|
||||
# 7. .profile patchen, damit Labwc direkt beim TTY1-Login startet
|
||||
PROFILE_FILE="$USER_HOME/.profile"
|
||||
if ! grep -q "labwc" "$PROFILE_FILE" 2>/dev/null; then
|
||||
echo -e "\\n${C_GREEN}[6/6] Richte automatischen Desktop-Start in .profile ein...${C_RESET}"
|
||||
echo -e "\n${C_GREEN}[6/6] Richte automatischen Desktop-Start in .profile ein...${C_RESET}"
|
||||
cat << 'EOF' >> "$PROFILE_FILE"
|
||||
|
||||
# Startet Wayland/Labwc automatisch, wenn du dich auf TTY1 einloggst
|
||||
@@ -101,17 +101,10 @@ fi
|
||||
EOF
|
||||
fi
|
||||
|
||||
echo -e "\\n${C_CYAN}===================================================="
|
||||
echo -e "\n${C_CYAN}===================================================="
|
||||
echo -e "${C_GREEN}✅ Setup erfolgreich abgeschlossen!${C_CYAN}"
|
||||
echo -e "====================================================${C_RESET}"
|
||||
echo -e "1. ${C_BOLD}wdotool${C_RESET} wurde erfolgreich unter ${C_YELLOW}/usr/local/bin/wdotool${C_RESET} installiert."
|
||||
echo -e "1. wdotool wurde erfolgreich unter /usr/local/bin/wdotool installiert."
|
||||
echo -e "2. Starte die VM neu oder logge dich aus."
|
||||
echo -e "3. Melde dich als Benutzer ${C_BOLD}'$TARGET_USER'${C_RESET} auf ${C_BOLD}TTY1${C_RESET} an."
|
||||
echo -e "4. Wayland startet vollautomatisch und öffnet das Foot-Terminal."
|
||||
echo -e "5. Teste die Automatisierung dort mit: ${C_CYAN}sleep 2 && wdotool type \"Hallo\"${C_RESET}\\n"
|
||||
"""
|
||||
|
||||
with open("setup_wayland.sh", "w") as f:
|
||||
f.write(script_content)
|
||||
|
||||
print("File generated successfully.")
|
||||
echo -e "3. Melde dich als Benutzer '$TARGET_USER' auf TTY1 an."
|
||||
echo -e "4. Wayland startet vollautomatisch und öffnet das Foot-Terminal."
|
||||
Reference in New Issue
Block a user