diff --git a/config/xface-minimal/desktop-icons.xml b/config/xface-minimal/desktop-icons.xml new file mode 100644 index 0000000..035bdd8 --- /dev/null +++ b/config/xface-minimal/desktop-icons.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/config/xface-minimal/keyboard-shortcuts.xml b/config/xface-minimal/keyboard-shortcuts.xml new file mode 100644 index 0000000..0e97ebb --- /dev/null +++ b/config/xface-minimal/keyboard-shortcuts.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/config/xface-minimal/notifyd.xml b/config/xface-minimal/notifyd.xml new file mode 100644 index 0000000..6acc06d --- /dev/null +++ b/config/xface-minimal/notifyd.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/config/xface-minimal/panel.xml b/config/xface-minimal/panel.xml new file mode 100644 index 0000000..b6a150e --- /dev/null +++ b/config/xface-minimal/panel.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/config/xface-minimal/session.xml b/config/xface-minimal/session.xml new file mode 100644 index 0000000..2849b47 --- /dev/null +++ b/config/xface-minimal/session.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/config/xface-minimal/thunar.xml b/config/xface-minimal/thunar.xml new file mode 100644 index 0000000..20ef180 --- /dev/null +++ b/config/xface-minimal/thunar.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/config/xface-minimal/xfwm4.xml b/config/xface-minimal/xfwm4.xml new file mode 100644 index 0000000..373df8c --- /dev/null +++ b/config/xface-minimal/xfwm4.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/config/xface-minimal/xworkspace-shell.desktop b/config/xface-minimal/xworkspace-shell.desktop new file mode 100644 index 0000000..90c2b8f --- /dev/null +++ b/config/xface-minimal/xworkspace-shell.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Application +Name=XWorkspace Shell +Exec=/bin/bash -lc "${HOME}/xworkspace-console/scripts/start-chromium-minimal.sh http://127.0.0.1:17000" +Terminal=false +X-GNOME-Autostart-enabled=true +X-XFCE-Session-Manager=false \ No newline at end of file diff --git a/config/xface-minimal/xworkspace-shell.service b/config/xface-minimal/xworkspace-shell.service new file mode 100644 index 0000000..9be7ea8 --- /dev/null +++ b/config/xface-minimal/xworkspace-shell.service @@ -0,0 +1,16 @@ +[Unit] +Description=XWorkspace Chrome Shell +After=graphical.target +After=xworkspace-console.service +PartOf=graphical-session.target + +[Service] +Type=simple +Environment=DISPLAY=:0 +Environment=XAUTHORITY=%h/.Xauthority +ExecStart=/bin/bash -lc "${HOME}/xworkspace-console/scripts/start-chromium-minimal.sh http://127.0.0.1:17000" +Restart=on-failure +RestartSec=3 + +[Install] +WantedBy=graphical-session.target \ No newline at end of file diff --git a/config/xworkspace-desktop.yaml b/config/xworkspace-desktop.yaml index 5dad953..fc6e771 100644 --- a/config/xworkspace-desktop.yaml +++ b/config/xworkspace-desktop.yaml @@ -75,3 +75,34 @@ ui: dock_autohide: true theme_family: gtk panel_style: xfce4 + +minimal: + enabled: true + description: "Stage 2: Minimal window manager + Chrome Shell only" + window_manager: xfwm4 + hide_panels: true + hide_desktop_icons: true + disable_file_manager: true + disable_notification_daemon: true + autostart_only_shell: true + config_dir: xface-minimal + services: + - xworkspace-console.service + - xworkspace-shell.service + shell_url: http://127.0.0.1:17000 + +display_stages: + stage1: + name: "XFCE with hidden components" + description: "Use XFCE but hide traditional desktop components, only expose Chrome Shell" + panel_visible: false + desktop_icons_hidden: true + stage2: + name: "Minimal window manager" + description: "Replace XFCE with minimal window manager, only Chrome/Chromium is visible shell" + window_manager: xfwm4 + all_desktop_components_hidden: true + stage3: + name: "Wayland/Weston/Cage" + description: "Move to Wayland/Weston/Cage mode, Chrome/Chromium is the only user-facing shell" + display_server: wayland diff --git a/scripts/start-chromium-minimal.sh b/scripts/start-chromium-minimal.sh new file mode 100755 index 0000000..049458d --- /dev/null +++ b/scripts/start-chromium-minimal.sh @@ -0,0 +1,57 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +CONFIG_FILE="${ROOT_DIR}/config/xworkspace-desktop.yaml" + +read_yaml() { + python3 - "$CONFIG_FILE" "$1" <<'PY' +import sys +from pathlib import Path +import yaml + +config_path = Path(sys.argv[1]) +path = sys.argv[2].split(".") +data = yaml.safe_load(config_path.read_text()) +value = data +for part in path: + value = value[part] +print(value) +PY +} + +DASHBOARD_URL="$(read_yaml desktop.dashboard_url)" +BROWSER_BINARY="$(read_yaml desktop.browser_binary)" +BROWSER_FALLBACK="$(read_yaml desktop.browser_fallback)" +URL="${1:-${DASHBOARD_URL}}" + +echo "Starting XWorkspace Chrome Shell (minimal mode)..." +echo "URL: ${URL}" + +if command -v "${BROWSER_BINARY}" >/dev/null 2>&1; then + exec "${BROWSER_BINARY}" \ + --app="${URL}" \ + --user-data-dir="${HOME}/.config/xworkspace-chrome-minimal" \ + --profile-directory=Default \ + --no-first-run \ + --disable-session-crashed-bubble \ + --disable-sync \ + --disable-infobars \ + --disable-features=TranslateUI \ + --new-window \ + --kiosk \ + --start-maximized \ + --autoplay-policy=no-user-gesture-required +fi + +exec "${BROWSER_FALLBACK}" \ + --app="${URL}" \ + --user-data-dir="${HOME}/.config/xworkspace-chromium-minimal" \ + --no-first-run \ + --disable-session-crashed-bubble \ + --disable-sync \ + --disable-infobars \ + --new-window \ + --kiosk \ + --start-maximized \ + --autoplay-policy=no-user-gesture-required \ No newline at end of file diff --git a/scripts/switch-desktop-mode.sh b/scripts/switch-desktop-mode.sh new file mode 100755 index 0000000..accc890 --- /dev/null +++ b/scripts/switch-desktop-mode.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +CONFIG_FILE="${ROOT_DIR}/config/xworkspace-desktop.yaml" + +MODE="${1:-xfce}" + +case "${MODE}" in + xfce) + XFCE_DIR="${HOME}/.config/xfce4" + DEST_DIR="${XFCE_DIR}" + ;; + minimal|xface-minimal) + XFCE_DIR="${ROOT_DIR}/config/xface-minimal" + DEST_DIR="${HOME}/.config/xfce4" + ;; + *) + echo "Unknown mode: ${MODE}" >&2 + echo "Usage: $0 [xfce|minimal]" >&2 + exit 1 + ;; +esac + +mkdir -p "${DEST_DIR}" +mkdir -p "${HOME}/.config/xfce4/panel" +mkdir -p "${HOME}/.config/xfce4/xfconf/xfce-perchannel-xml" +mkdir -p "${HOME}/.config/autostart" +mkdir -p "${HOME}/.config/systemd/user" + +echo "Setting up XWorkspace Desktop in ${MODE} mode..." + +cp -R "${ROOT_DIR}/config/systemd/." "${HOME}/.config/systemd/user/" + +if [[ -d "${XFCE_DIR}" ]]; then + cp -R "${XFCE_DIR}/." "${DEST_DIR}/" +fi + +cp -R "${ROOT_DIR}/config/autostart/." "${HOME}/.config/autostart/" + +python3 - "${HOME}/.config/autostart/xworkspace-console.desktop" <<'PY' +import sys +from pathlib import Path + +desktop_file = Path(sys.argv[1]) +text = desktop_file.read_text() +desktop_file.write_text(text.replace("http://127.0.0.1:17000", "http://127.0.0.1:17000")) +PY + +if command -v systemctl >/dev/null 2>&1; then + systemctl --user daemon-reload || true +fi + +echo "XWorkspace Desktop ${MODE} mode configured." +echo "To apply: logout and login, or run 'xfce4-session --replace' for immediate effect." \ No newline at end of file