From 1fb84eef43a936e122402e19832b7ac639ab8c81 Mon Sep 17 00:00:00 2001 From: Momoi Date: Sat, 30 May 2026 21:03:21 +0700 Subject: [PATCH] Revert "Kde plasma codespaces" --- .devcontainer/Dockerfile | 95 ------ .devcontainer/README.md | 397 ----------------------- .devcontainer/devcontainer.json | 32 -- .devcontainer/scripts/install-desktop.sh | 126 ------- .devcontainer/scripts/start-desktop.sh | 229 ------------- 5 files changed, 879 deletions(-) delete mode 100644 .devcontainer/Dockerfile delete mode 100644 .devcontainer/README.md delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .devcontainer/scripts/install-desktop.sh delete mode 100644 .devcontainer/scripts/start-desktop.sh diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index 58ac957..0000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,95 +0,0 @@ -FROM mcr.microsoft.com/devcontainers/base:noble - -# Set non-interactive mode for apt -ENV DEBIAN_FRONTEND=noninteractive \ - DISPLAY=:1 \ - LANG=en_US.UTF-8 \ - LC_ALL=en_US.UTF-8 - -# Update package lists and install essential dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - # Locales and language support - locales \ - language-pack-en \ - # X11 and display server - xserver-xvfb \ - x11-utils \ - x11-xserver-utils \ - dbus \ - dbus-x11 \ - # KDE Plasma and core components - plasma-desktop \ - plasma-workspace \ - plasma-framework \ - kwin-x11 \ - kwin-common \ - sddm \ - # KDE Applications - dolphin \ - konsole \ - kate \ - ark \ - gwenview \ - okular \ - kcalc \ - spectacle \ - ksystemmonitor \ - khelpcenter \ - # Firefox - firefox \ - # VNC server and noVNC - tigervnc-standalone-server \ - tigervnc-common \ - websockify \ - python3-numpy \ - # Audio support - pulseaudio \ - alsa-utils \ - pavucontrol \ - # Additional utilities - curl \ - wget \ - git \ - sudo \ - ca-certificates \ - mesa-utils \ - libgl1-mesa-glx \ - libxrender1 \ - libxrandr2 \ - fontconfig \ - fonts-dejavu \ - fonts-liberation \ - # Cleanup - && rm -rf /var/lib/apt/lists/* \ - && apt-get clean - -# Generate locale -RUN locale-gen en_US.UTF-8 && update-locale LANG=en_US.UTF-8 - -# Create codespace user if not exists (fallback) -RUN useradd -m -s /bin/bash -G sudo codespace 2>/dev/null || true - -# Create necessary directories -RUN mkdir -p /root/.vnc \ - && mkdir -p /root/.config/pulse \ - && mkdir -p /root/.local/share/applications \ - && mkdir -p /tmp/.X11-unix \ - && chmod 1777 /tmp/.X11-unix - -# Configure PulseAudio for container -RUN echo "autospawn = no" >> /etc/pulse/client.conf - -# Create VNC password file (default: password) -RUN echo "password" | vncpasswd -f > /root/.vnc/passwd && chmod 600 /root/.vnc/passwd - -# Copy startup scripts -COPY .devcontainer/scripts/start-desktop.sh /start-desktop.sh -COPY .devcontainer/scripts/install-desktop.sh /install-desktop.sh - -RUN chmod +x /start-desktop.sh /install-desktop.sh - -# Set working directory -WORKDIR /workspace - -# Default command -CMD ["/start-desktop.sh"] diff --git a/.devcontainer/README.md b/.devcontainer/README.md deleted file mode 100644 index b58db75..0000000 --- a/.devcontainer/README.md +++ /dev/null @@ -1,397 +0,0 @@ -# KDE Plasma Desktop Environment for GitHub Codespaces - -A complete, production-ready GitHub Codespaces development environment featuring a full KDE Plasma desktop experience accessible directly from your web browser via noVNC. - -## Features - -✅ **Full Desktop Environment** -- KDE Plasma 5 desktop with X11 display server -- Native Linux desktop experience in the browser -- 1920x1080 resolution at 24-bit color depth - -✅ **Remote Access** -- noVNC web-based VNC viewer (no client installation needed) -- WebSocket-based connection via websockify -- Automatic port forwarding in Codespaces -- Secure HTTPS support - -✅ **Pre-installed Applications** -- **Firefox** - Full web browser -- **Dolphin** - File manager with advanced features -- **Konsole** - Powerful terminal emulator -- **Kate** - Advanced text editor with syntax highlighting -- **Spectacle** - Screenshot and screen recording tool -- **Ark** - Archive manager (zip, tar, 7z, etc.) -- **Gwenview** - Image viewer with editing capabilities -- **Okular** - PDF reader and document viewer -- **KCalc** - Scientific calculator -- **KSystemMonitor** - System resource monitoring - -✅ **Optimizations** -- Minimal resource footprint optimized for container environments -- Automatic startup and recovery of critical services -- Audio support via PulseAudio (where container allows) -- Pre-configured for low-memory environments -- Non-interactive installation (no user input required) - -## Quick Start - -### 1. Create Codespace from this Branch - -```bash -# The devcontainer configuration will be automatically detected -# GitHub will build the environment using the Dockerfile and configuration -``` - -### 2. Wait for Setup to Complete - -The setup process takes 3-5 minutes on first launch: -- Docker image build -- Package installation -- Desktop environment configuration -- VNC and noVNC setup - -Monitor progress in the Codespaces creation logs. - -### 3. Access the Desktop - -Once setup is complete, you'll see in the terminal: - -``` -========================================= -KDE Plasma Desktop is Ready! -========================================= - -Access the desktop at: - http://localhost:6080/vnc.html - -Or via Codespaces forwarded port: - https:///ports/6080 -``` - -### 4. Open in Browser - -- **Local Development**: Navigate to `http://localhost:6080/vnc.html` -- **Codespaces**: Click the forwarded port link for port 6080, or append `/ports/6080` to your Codespace URL - -### 5. Use the Desktop - -The desktop is immediately ready to use with a full taskbar, applications menu, and all utilities. - -## Accessing Applications - -### From the Taskbar -- Click the application icons at the bottom of the screen -- Right-click for context menus - -### From the Application Menu -- Click the application menu icon (bottom-left) -- Search or browse categories - -### From Terminal (Konsole) -Launch any application from the terminal: -```bash -firefox & -kate /path/to/file & -dolphin /path/to/folder & -``` - -## File Management - -### Access Files -- Use **Dolphin** file manager for graphical access -- Files are located in `/workspace` by default -- Your repository is available at the project root - -### Edit Files -- **Kate** provides full IDE-like editing with syntax highlighting -- **VS Code** remains available via command line: `code .` - -### Upload/Download -- Use Dolphin's web integration -- Copy files via terminal: `cp /local/path /workspace/` - -## Development Workflow - -### Example: Web Development - -```bash -# Open terminal in Konsole -# Install Node.js packages -npm install - -# Start development server -npm run dev - -# Open Firefox -# Navigate to http://localhost:3000 -``` - -### Example: Python Development - -```bash -# Open Konsole -python3 -m venv venv -source venv/bin/activate -pip install -r requirements.txt - -# Edit with Kate -kate script.py - -# Run with Konsole -python script.py -``` - -## Port Forwarding - -Codespaces automatically forwards these ports: - -| Port | Service | Use | -|------|---------|-----| -| 6080 | noVNC Web | Browser desktop access | -| 5900 | VNC Server | Direct VNC client access (if needed) | - -### Forward Additional Ports - -In Codespaces terminal: -```bash -# Codespaces automatically detects listening ports -# Or manually configure in .devcontainer/devcontainer.json -``` - -## Troubleshooting - -### Desktop Not Loading - -**Symptoms**: Blank screen or connection refused - -**Solution**: -```bash -# Check if services are running -ps aux | grep -E "Xvfb|vncserver|websockify|startkde" - -# Check logs -tail -f /tmp/kde.log -tail -f /tmp/websockify.log - -# Restart desktop (if available in your setup) -# Kill and restart: supervisor or manual restart -``` - -### Slow Performance - -**Symptoms**: Laggy mouse/keyboard response - -**Solutions**: -- Reduce browser window size -- Close unnecessary applications -- Check system resources: KSystemMonitor -- Use direct VNC if WebSocket has latency: - ```bash - vncviewer localhost:5900 - ``` - -### Applications Not Launching - -**Symptoms**: App icons don't respond - -**Solution**: -```bash -# Launch from terminal to see error messages -konsole & -kate & -dolphin & - -# Check if D-Bus is running -ps aux | grep dbus -``` - -### Audio Not Working - -**Symptoms**: No sound from applications - -**Current Status**: Audio support depends on container permissions. If not working: -- Some container environments restrict audio device access -- This is a known limitation in certain cloud environments -- Consider this environment read-only for audio - -## Advanced Configuration - -### Change Resolution - -Edit `.devcontainer/scripts/start-desktop.sh`: - -```bash -# Find this line: -Xvfb :1 -screen 0 1920x1080x24 -ac -extension GLX - -# Change to your desired resolution (e.g., 1280x720): -Xvfb :1 -screen 0 1280x720x24 -ac -extension GLX -``` - -### Customize VNC Password - -Edit `.devcontainer/Dockerfile`: - -```bash -# Find this line: -RUN echo "password" | vncpasswd -f > /root/.vnc/passwd - -# Change "password" to your desired password -``` - -### Install Additional Applications - -Add packages to `.devcontainer/Dockerfile` in the `apt-get install` section: - -```dockerfile -RUN apt-get update && apt-get install -y --no-install-recommends \ - # ... existing packages ... - gimp \ - vlc \ - blender \ - && rm -rf /var/lib/apt/lists/* -``` - -## System Information - -### Specifications - -- **Base OS**: Ubuntu 24.04 LTS (Noble) -- **Desktop Environment**: KDE Plasma 5 -- **Display Server**: X11 (Xvfb) -- **VNC Server**: TigerVNC -- **Web Interface**: noVNC with WebSocket (websockify) -- **Default User**: root -- **Display Resolution**: 1920x1080x24 -- **DPI**: 96 (standard) - -### Resource Usage - -- **Disk**: ~3-4GB (depends on installed applications) -- **Memory**: ~800MB-1.2GB at idle (KDE Plasma + services) -- **CPU**: Minimal at idle, scales with application usage - -## Files and Directories - -``` -.devcontainer/ -├── devcontainer.json # Codespaces configuration -├── Dockerfile # Container image definition -└── scripts/ - ├── install-desktop.sh # One-time setup script - └── start-desktop.sh # Runtime startup script -``` - -## Environment Variables - -These are automatically set: - -- `DISPLAY=:1` - X display number -- `LANG=en_US.UTF-8` - Language locale -- `LC_ALL=en_US.UTF-8` - All locales - -## Logs and Debugging - -View runtime logs to debug issues: - -```bash -# KDE Plasma logs -tail -f /tmp/kde.log - -# Websockify (noVNC) logs -tail -f /tmp/websockify.log - -# Xvfb (X server) logs (if enabled) -tail -f /tmp/xvfb.log - -# Check running processes -ps aux | grep -E "X|vnc|websockify|kde" - -# Monitor system resources -# Open KSystemMonitor from desktop menu -``` - -## Performance Tips - -1. **Use Firefox's hardware acceleration** (if available) - - Settings → Performance → Enable hardware acceleration - -2. **Disable unnecessary desktop effects** - - System Settings → Workspace Behavior → Desktop Effects - -3. **Close unused applications** to free memory - -4. **Use Konsole instead of Dolphin for heavy file operations** - - Terminal operations are generally faster - -5. **Monitor resources with KSystemMonitor** - - Available in application menu - -## Security Notes - -⚠️ **For Development Use Only** - -- Default VNC password is "password" - change in production -- No authentication on websockify connection by default -- Codespaces provides authentication at the platform level -- Do not expose ports publicly without additional security - -## Keyboard and Mouse - -### Shortcuts - -| Shortcut | Action | -|----------|--------| -| `Super` (Win key) | Open application menu | -| `Alt+Tab` | Switch applications | -| `Super+D` | Show desktop | -| `Super+E` | Open file manager | -| `Ctrl+Alt+T` | Open terminal | -| `F11` (in browser) | Full screen desktop | - -### Mouse - -- Standard mouse, trackpad, or touch input -- Right-click for context menus -- Scroll wheel supported -- Drag-and-drop works normally - -## Support and Contributions - -For issues or improvements: - -1. **Check logs** first (see Troubleshooting section) -2. **Verify Codespace health** - rebuild if needed -3. **Report issues** on GitHub with logs attached - -## What's Next? - -Once your desktop is running: - -- **Web Development**: Open Firefox and start coding -- **File Management**: Use Dolphin to organize your project -- **Editing**: Use Kate or your favorite terminal editor -- **Version Control**: Use Konsole for git commands -- **Development**: Install your language runtimes and tools - -## License - -This configuration is provided as-is for GitHub Codespaces development environments. - -## Changelog - -### Version 1.0 (2026-05-30) - -- ✅ Initial release -- ✅ Full KDE Plasma 5 integration -- ✅ noVNC web interface -- ✅ TigerVNC server -- ✅ All core KDE applications pre-installed -- ✅ Automatic startup and recovery -- ✅ Complete documentation -- ✅ Production-ready configuration - ---- - -**Happy coding in your KDE Plasma desktop!** 🚀 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index 64d0f9e..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "KDE Plasma Desktop Environment", - "image": "mcr.microsoft.com/devcontainers/base:noble", - "features": {}, - "forwardPorts": [6080, 5900], - "portsAttributes": { - "6080": { - "label": "noVNC Desktop", - "onAutoForward": "notify" - }, - "5900": { - "label": "VNC Server", - "onAutoForward": "ignore" - } - }, - "remoteEnv": { - "DISPLAY": ":1", - "LANG": "en_US.UTF-8" - }, - "postCreateCommand": "bash .devcontainer/scripts/install-desktop.sh", - "postStartCommand": "bash .devcontainer/scripts/start-desktop.sh", - "customizations": { - "vscode": { - "extensions": [] - } - }, - "mounts": [ - "source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,target=/home/codespace/.ssh,readonly" - ], - "overrideCommand": false, - "containerUser": "root" -} diff --git a/.devcontainer/scripts/install-desktop.sh b/.devcontainer/scripts/install-desktop.sh deleted file mode 100644 index 3d3d1dd..0000000 --- a/.devcontainer/scripts/install-desktop.sh +++ /dev/null @@ -1,126 +0,0 @@ -#!/bin/bash - -# KDE Plasma Desktop Environment - Installation Script -# This script runs during devcontainer creation to finalize setup - -set -e - -echo "=== KDE Plasma Desktop Installation ===" - -# Configure locales -echo "Configuring locales..." -locale-gen en_US.UTF-8 -update-locale LANG=en_US.UTF-8 - -# Create necessary directories -echo "Creating necessary directories..." -mkdir -p /root/.vnc -mkdir -p /root/.config/pulse -mkdir -p /root/.local/share/applications -mkdir -p /tmp/.X11-unix -chmod 1777 /tmp/.X11-unix - -# Configure PulseAudio for container environment -echo "Configuring PulseAudio..." -mkdir -p /root/.config/pulse -cat > /root/.config/pulse/client.conf << 'EOF' -autospawn = no -daemon-binary = /bin/true -EOF - -# Create VNC configuration -echo "Setting up VNC server configuration..." -mkdir -p /root/.vnc - -# Create xvfb-run wrapper for VNC server -cat > /root/.vnc/xvfb_startup << 'EOF' -#!/bin/bash -/usr/bin/Xvfb :1 -screen 0 1920x1080x24 -ac & -XVFB_PID=$! -sleep 2 -export DISPLAY=:1 - -# Start D-Bus session bus -eval "$(dbus-launch --sh-syntax)" - -# Start PulseAudio -pulseaudio --start --exit-idle-time=-1 2>/dev/null || true - -# Start KDE Plasma -/usr/bin/startkde > /tmp/kde.log 2>&1 & -KDE_PID=$! - -# Wait for both processes -wait $KDE_PID $XVFB_PID -EOF - -chmod +x /root/.vnc/xvfb_startup - -# Create systemd service files (for manual startup if needed) -mkdir -p /etc/systemd/system - -cat > /etc/systemd/system/vncserver.service << 'EOF' -[Unit] -Description=VNC Server -After=network.target - -[Service] -Type=simple -User=root -ExecStart=/start-vncserver.sh -Restart=always -RestartSec=10 - -[Install] -WantedBy=multi-user.target -EOF - -# Configure KDE Plasma minimal settings -echo "Configuring KDE Plasma..." -mkdir -p /root/.config/plasmarc -cat > /root/.config/plasmarc << 'EOF' -[General] -theme=org.kde.desktop - -[PlasmaPlugins] -enable-unredirected-fullscreen=false - -[Containments] -version=2 -EOF - -mkdir -p /root/.config/kwinrc -cat > /root/.config/kwinrc << 'EOF' -[General] -BorderlessMaximizedWindows=true -SideSwitchScreen=false -SideSwitchTestOnEdge=false - -[Compositing] -Enabled=false -CompositeMode=1 - -[ScreenEdges] -ElectricBorders=0 -EOF - -# Create Konsole configuration -mkdir -p /root/.config/konsolerc -cat > /root/.config/konsolerc << 'EOF' -[General] -StartInCurrentSessionDir=true -EOF - -# Create Kate configuration -mkdir -p /root/.config/katerc -cat > /root/.config/katerc << 'EOF' -[General] -Start Session=manual -EOF - -# Ensure permissions -chown -R root:root /root/.config -chmod -R 700 /root/.config - -echo "=== Installation Complete ===" -echo "Desktop environment is ready for startup." diff --git a/.devcontainer/scripts/start-desktop.sh b/.devcontainer/scripts/start-desktop.sh deleted file mode 100644 index e7c6cf7..0000000 --- a/.devcontainer/scripts/start-desktop.sh +++ /dev/null @@ -1,229 +0,0 @@ -#!/bin/bash - -# KDE Plasma Desktop Environment - Startup Script -# This script starts the X11 server, VNC server, and noVNC when the Codespace starts - -set -e - -echo "=== Starting KDE Plasma Desktop Environment ===" - -# Export display variable -export DISPLAY=:1 -export LANG=en_US.UTF-8 -export LC_ALL=en_US.UTF-8 - -# Create necessary runtime directories -mkdir -p /tmp/.X11-unix -chmod 1777 /tmp/.X11-unix -mkdir -p /var/run/dbus - -# Start D-Bus daemon -echo "Starting D-Bus daemon..." -if ! pgrep -x dbus-daemon > /dev/null; then - dbus-daemon --system 2>/dev/null || true - sleep 1 -fi - -# Start PulseAudio daemon -echo "Starting PulseAudio..." -pulseaudio --start --exit-idle-time=-1 2>/dev/null || true -sleep 1 - -# Start Xvfb (X Virtual Frame Buffer) -echo "Starting X11 server (Xvfb)..." -Xvfb :1 -screen 0 1920x1080x24 -ac -extension GLX >/dev/null 2>&1 & -XVFB_PID=$! -echo "Xvfb PID: $XVFB_PID" -sleep 2 - -# Verify X server is running -if ! ps -p $XVFB_PID > /dev/null; then - echo "ERROR: Failed to start Xvfb" - exit 1 -fi - -# Initialize X11 session directory -eval "$(dbus-launch --sh-syntax)" - -# Start VNC server (TigerVNC) -echo "Starting TigerVNC server..." - -# Create VNC startup script -cat > /tmp/vncserver_start.sh << 'VNCSCRIPT' -#!/bin/bash -export DISPLAY=:1 -export LANG=en_US.UTF-8 - -# Start KDE Plasma -echo "Starting KDE Plasma..." -startkde > /tmp/kde.log 2>&1 & -KDE_PID=$! - -# Wait for KDE to start -sleep 3 - -# Keep process running -wait $KDE_PID -VNCSCRIPT - -chmod +x /tmp/vncserver_start.sh - -# Start VNC server with proper resolution and settings -vncserver :5900 -geometry 1920x1080 -depth 24 -dpi 96 -rfbport 5900 >/dev/null 2>&1 & -VNC_PID=$! -echo "VNC Server started at :5900 (PID: $VNC_PID)" -sleep 2 - -# Verify VNC server is running -if ! ps -p $VNC_PID > /dev/null 2>&1; then - echo "WARNING: VNC server may not have started correctly" -fi - -# Start KDE Plasma session -echo "Starting KDE Plasma session..." -export DISPLAY=:1 -startkde > /tmp/kde.log 2>&1 & -KDE_PID=$! -echo "KDE Plasma PID: $KDE_PID" -sleep 3 - -# Start websockify (converts WebSocket to VNC socket) -echo "Starting noVNC/websockify..." - -# Create noVNC HTML file if it doesn't exist -mkdir -p /usr/share/novnc -if [ ! -f /usr/share/novnc/vnc.html ]; then - cat > /usr/share/novnc/vnc.html << 'NOVNCHTML' - - - - KDE Plasma Desktop - - - - - -
- - - -NOVNCHTML -fi - -# Start websockify on port 6080 -websockify --web=/usr/share/novnc 6080 localhost:5900 > /tmp/websockify.log 2>&1 & -WEBSOCKIFY_PID=$! -echo "noVNC/websockify started on port 6080 (PID: $WEBSOCKIFY_PID)" - -echo "" -echo "=========================================" -echo "KDE Plasma Desktop is Ready!" -echo "=========================================" -echo "" -echo "Access the desktop at:" -echo " http://localhost:6080/vnc.html" -echo "" -echo "Or via Codespaces forwarded port:" -echo " https:///ports/6080" -echo "" -echo "Desktop Details:" -echo " Display: $DISPLAY" -echo " Resolution: 1920x1080" -echo " VNC Port: 5900" -echo " WebSocket Port: 6080" -echo "" -echo "Available Applications:" -echo " - Firefox (browser)" -echo " - Dolphin (file manager)" -echo " - Konsole (terminal)" -echo " - Kate (text editor)" -echo " - Spectacle (screenshot tool)" -echo " - Ark (archive manager)" -echo " - Gwenview (image viewer)" -echo " - Okular (PDF reader)" -echo " - KCalc (calculator)" -echo " - KSystemMonitor (system monitor)" -echo "" -echo "Logs:" -echo " KDE: /tmp/kde.log" -echo " Websockify: /tmp/websockify.log" -echo "" - -# Keep the script running -echo "Keeping desktop environment alive..." -while true; do - sleep 10 - # Check if critical processes are still running - if ! ps -p $XVFB_PID > /dev/null 2>&1; then - echo "ERROR: X server has stopped" - break - fi - if ! ps -p $WEBSOCKIFY_PID > /dev/null 2>&1; then - echo "WARNING: Websockify has stopped, restarting..." - websockify --web=/usr/share/novnc 6080 localhost:5900 > /tmp/websockify.log 2>&1 & - WEBSOCKIFY_PID=$! - fi -done