Skip to content

HackerOS-Linux-System/Blue-Environment

Repository files navigation

Blue Enviroment - Graphical environment for HackerOS.

Blue Environment v0.4.0

Production-grade Wayland desktop environment for HackerOS Linux. Using in HackerOS Blue Edition

Build Instructions

Prerequisites

# System packages (Debian/Ubuntu/HackerOS)
sudo apt install \
    build-essential curl git \
    libssl-dev libgbm-dev libseat-dev \
    libinput-dev libxkbcommon-dev \
    libudev-dev libdrm-dev \
    libgtk-3-dev libwebkit2gtk-4.0-dev \
    libayatana-appindicator3-dev \
    librsvg2-dev pkg-config \
    seatd wmctrl xdotool

# Node.js 18+
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install nodejs

# Rust stable
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env

# Tauri CLI v1
cargo install tauri-cli --version "^1"

# Enable seatd (needed for DRM/bare-metal mode)
sudo systemctl enable --now seatd
sudo usermod -aG seat $USER
# (re-login after this)

Build the frontend + Tauri shell (the main app)

npm install
npm run build:tauri
# This runs: npm run build  β†’  vite build  β†’  tauri build

Build the Wayland compositor (for bare-metal/TTY use)

npm run build:compositor
# Output: ~/.hackeros/Blue-Environment/libs/blue-compositor

Build everything

npm run build:all

Development (hot-reload)

npm run dev          # Start Vite dev server on :1420
cargo tauri dev      # Or: npm run tauri -- dev

How the build works

npm run build:tauri
  └─ tauri build
       β”œβ”€ beforeBuildCommand: "npm run build"
       β”‚     β”œβ”€ tsc --noEmit   (type-check)
       β”‚     └─ vite build     β†’ dist/
       └─ cargo build (src-tauri/)  β†’ blue-environment binary

The key insight: tauri build calls npm run build automatically via beforeBuildCommand in tauri.conf.json. You should NOT call npm run build manually before npm run build:tauri.

Project layout

blue-environment/
β”œβ”€β”€ index.html                     ← entry HTML (project root)
β”œβ”€β”€ src/                           ← TypeScript/React frontend
β”‚   β”œβ”€β”€ App.tsx                    ← Desktop shell
β”‚   β”œβ”€β”€ constants.tsx              ← App registry
β”‚   β”œβ”€β”€ types.ts                   ← All TypeScript types
β”‚   β”œβ”€β”€ vite.config.ts             ← Vite config (root = ..)
β”‚   β”œβ”€β”€ tsconfig.json
β”‚   β”œβ”€β”€ index.tsx                  ← React entry point
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ Window.tsx
β”‚   β”‚   β”œβ”€β”€ TopBar.tsx
β”‚   β”‚   β”œβ”€β”€ StartMenu.tsx
β”‚   β”‚   β”œβ”€β”€ ControlCenter.tsx
β”‚   β”‚   β”œβ”€β”€ NotificationCenter.tsx
β”‚   β”‚   β”œβ”€β”€ WindowSwitcher.tsx
β”‚   β”‚   β”œβ”€β”€ WorkspaceSwitcher.tsx
β”‚   β”‚   β”œβ”€β”€ ClipboardPanel.tsx
β”‚   β”‚   β”œβ”€β”€ ToastContainer.tsx
β”‚   β”‚   └── apps/
β”‚   β”‚       β”œβ”€β”€ BlueAI.tsx
β”‚   β”‚       β”œβ”€β”€ BlueCodeApp.tsx    ← Monaco + xterm
β”‚   β”‚       β”œβ”€β”€ BlueSoftwareApp.tsx
β”‚   β”‚       β”œβ”€β”€ BlueWebApp.tsx
β”‚   β”‚       β”œβ”€β”€ ExplorerApp.tsx
β”‚   β”‚       β”œβ”€β”€ MailApp.tsx        ← Full mail client
β”‚   β”‚       β”œβ”€β”€ SettingsApp.tsx    ← Full settings
β”‚   β”‚       β”œβ”€β”€ TerminalApp.tsx
β”‚   β”‚       β”œβ”€β”€ SystemMonitorApp.tsx
β”‚   β”‚       β”œβ”€β”€ NotepadApp.tsx
β”‚   β”‚       β”œβ”€β”€ CalculatorApp.tsx
β”‚   β”‚       β”œβ”€β”€ AboutApp.tsx
β”‚   β”‚       └── MailApp.tsx
β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”œβ”€β”€ useWindowManager.ts
β”‚   β”‚   └── useKeyboardShortcuts.ts
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ systemBridge.ts        ← Tauri IPC bridge
β”‚   β”‚   β”œβ”€β”€ configStore.ts         ← Reactive config (wallpaper etc.)
β”‚   β”‚   └── notificationManager.ts
β”‚   └── contexts/
β”‚       └── LanguageContext.tsx
β”œβ”€β”€ src-tauri/                     ← Rust/Tauri backend
β”‚   β”œβ”€β”€ Cargo.toml
β”‚   β”œβ”€β”€ tauri.conf.json
β”‚   β”œβ”€β”€ build.rs
β”‚   β”œβ”€β”€ icons/icon.png
β”‚   └── src/
β”‚       β”œβ”€β”€ main.rs                ← Tauri commands
β”‚       β”œβ”€β”€ ai.rs                  ← AI API proxy
β”‚       β”œβ”€β”€ apps.rs                ← .desktop scanner
β”‚       β”œβ”€β”€ cache.rs               ← Config/cache
β”‚       β”œβ”€β”€ session.rs             ← Session detection
β”‚       └── window_tracker.rs     ← External windows
└── src-tauri/lib/blue-compositor/ ← Smithay compositor
    β”œβ”€β”€ Cargo.toml
    └── src/
        β”œβ”€β”€ main.rs
        β”œβ”€β”€ state.rs
        β”œβ”€β”€ input.rs
        β”œβ”€β”€ render.rs
        β”œβ”€β”€ xwayland.rs
        └── ipc.rs

Keyboard Shortcuts

Shortcut Action
Super Toggle Start Menu
Super+Tab Full-screen App Picker
Super+1–4 Switch Workspace
Super+←/β†’ Switch Workspace
Super+↑ Maximize Window
Super+↓ Minimize Window
Super+D Show Desktop
Super+L Lock Screen
Alt+Tab Window Switcher
Alt+Shift+Tab Window Switcher (backwards)
Alt+F4 Close Window
Ctrl+Alt+T Open Terminal
Ctrl+Alt+C Control Center
Ctrl+Shift+V Clipboard History
PrintScreen Screenshot
Escape Close Panels / Cancel

VM / VirtualBox Support

When running inside VirtualBox or any VM:

  • Compositor auto-detects WAYLAND_DISPLAY/DISPLAY β†’ uses winit (nested) backend
  • Full 3D rendering via host GPU
  • XWayland started automatically for X11 app support

On bare metal (TTY, no display server):

  • Uses DRM/KMS backend via libseat
  • Requires seatd running and user in seat group

Common Issues

"Unable to find your web assets"

This means npm run build was not run before tauri build. Solution: Always use npm run build:tauri (not npm run tauri). The beforeBuildCommand in tauri.conf.json handles this automatically.

chrono feature error

Ensure Cargo.toml has chrono = "0.4" (no features). The local-offset feature does not exist in chrono 0.4.x.

seatd / seat permission error

sudo systemctl enable --now seatd
sudo usermod -aG seat $USER
# Then re-login

Β© 2026 HackerOS Team