refactor: rename Chrome references to Chromium

- Rename hook file: 0060-install-chrome -> 0060-install-chromium
- Update all logs and comments to say "Chromium" instead of "Chrome"
- Rename chromeStatus -> chromiumStatus in daemon
- Update UI to show "Chromium Browser" instead of "Chrome Browser"
- Update documentation (readme.plan.md, readme.hints.md)

Note: Binary paths (/opt/chromium/chrome) remain as the actual
Chromium executable is named "chrome"
This commit is contained in:
2026-01-08 16:17:48 +00:00
parent 6a5cb3b70c
commit 1435496a1c
9 changed files with 56 additions and 56 deletions

View File

@@ -29,7 +29,7 @@ export class EcoDaemon {
private uiServer: UIServer;
private logs: string[] = [];
private swayStatus: ServiceStatus = { state: 'stopped' };
private chromeStatus: ServiceStatus = { state: 'stopped' };
private chromiumStatus: ServiceStatus = { state: 'stopped' };
constructor(config?: Partial<DaemonConfig>) {
this.config = {
@@ -64,8 +64,8 @@ export class EcoDaemon {
return {
sway: this.swayStatus.state === 'running',
swayStatus: this.swayStatus,
chrome: this.chromeStatus.state === 'running',
chromeStatus: this.chromeStatus,
chromium: this.chromiumStatus.state === 'running',
chromiumStatus: this.chromiumStatus,
systemInfo: this.systemInfo.getInfo(),
logs: this.logs.slice(-50),
};
@@ -79,7 +79,7 @@ export class EcoDaemon {
await this.uiServer.start();
this.log('Management UI started successfully');
// Start the Sway/Chrome initialization in the background
// Start the Sway/Chromium initialization in the background
// This allows the UI server to remain responsive even if Sway fails
this.startServicesInBackground();
@@ -95,15 +95,15 @@ export class EcoDaemon {
this.log('Checking seatd service...');
await this.ensureSeatd();
// Try to start Sway and Chrome
await this.tryStartSwayAndChrome();
// Try to start Sway and Chromium
await this.tryStartSwayAndChromium();
} catch (error) {
this.log(`Service initialization error: ${error}`);
}
})();
}
private async tryStartSwayAndChrome(): Promise<void> {
private async tryStartSwayAndChromium(): Promise<void> {
// Try DRM mode first, fall back to headless if it fails
const modes = ['drm', 'headless'] as const;
@@ -129,8 +129,8 @@ export class EcoDaemon {
this.swayStatus = { state: 'running' };
this.log(`Sway compositor running with ${mode} backend`);
// Start Chrome in kiosk mode
await this.startChromeAfterSway();
// Start Chromium in kiosk mode
await this.startChromiumAfterSway();
return;
} else {
this.log(`Sway ${mode} backend failed - Wayland socket did not appear`);
@@ -147,21 +147,21 @@ export class EcoDaemon {
this.log('All Sway backend modes failed');
}
private async startChromeAfterSway(): Promise<void> {
this.chromeStatus = { state: 'starting', lastAttempt: new Date().toISOString() };
this.log('Starting Chrome browser...');
private async startChromiumAfterSway(): Promise<void> {
this.chromiumStatus = { state: 'starting', lastAttempt: new Date().toISOString() };
this.log('Starting Chromium browser...');
try {
await this.startChrome();
this.chromeStatus = { state: 'running' };
this.log('Chrome browser started');
await this.startChromium();
this.chromiumStatus = { state: 'running' };
this.log('Chromium browser started');
} catch (error) {
this.chromeStatus = {
this.chromiumStatus = {
state: 'failed',
error: String(error),
lastAttempt: new Date().toISOString()
};
this.log(`Failed to start Chrome: ${error}`);
this.log(`Failed to start Chromium: ${error}`);
}
}
@@ -230,11 +230,11 @@ export class EcoDaemon {
return false;
}
private async startChrome(): Promise<void> {
private async startChromium(): Promise<void> {
const uid = await this.getUserUid();
const runtimeDir = `/run/user/${uid}`;
await this.processManager.startChrome({
await this.processManager.startBrowser({
runtimeDir,
waylandDisplay: this.config.waylandDisplay,
url: 'http://localhost:' + this.config.uiPort,
@@ -278,26 +278,26 @@ export class EcoDaemon {
if (this.swayStatus.state === 'running' && !this.processManager.isSwayRunning()) {
this.log('Sway process died, attempting restart...');
this.swayStatus = { state: 'stopped' };
this.chromeStatus = { state: 'stopped' };
await this.tryStartSwayAndChrome();
this.chromiumStatus = { state: 'stopped' };
await this.tryStartSwayAndChromium();
}
// If Sway is running but Chrome died, restart Chrome
if (this.swayStatus.state === 'running' && this.chromeStatus.state === 'running'
&& !this.processManager.isChromeRunning()) {
this.log('Chrome process died, attempting restart...');
this.chromeStatus = { state: 'starting', lastAttempt: new Date().toISOString() };
// If Sway is running but Chromium died, restart Chromium
if (this.swayStatus.state === 'running' && this.chromiumStatus.state === 'running'
&& !this.processManager.isBrowserRunning()) {
this.log('Chromium process died, attempting restart...');
this.chromiumStatus = { state: 'starting', lastAttempt: new Date().toISOString() };
try {
await this.startChrome();
this.chromeStatus = { state: 'running' };
this.log('Chrome browser restarted');
await this.startChromium();
this.chromiumStatus = { state: 'running' };
this.log('Chromium browser restarted');
} catch (error) {
this.chromeStatus = {
this.chromiumStatus = {
state: 'failed',
error: String(error),
lastAttempt: new Date().toISOString()
};
this.log(`Failed to restart Chrome: ${error}`);
this.log(`Failed to restart Chromium: ${error}`);
}
}
@@ -309,7 +309,7 @@ export class EcoDaemon {
const now = Date.now();
if (now - lastAttempt > 30000) {
this.log('Retrying Sway startup...');
await this.tryStartSwayAndChrome();
await this.tryStartSwayAndChromium();
}
}
} catch (error) {

View File

@@ -1,7 +1,7 @@
/**
* Process Manager
*
* Manages spawning and monitoring of Sway and Chrome processes
* Manages spawning and monitoring of Sway and Chromium processes
*/
export interface SwayConfig {
@@ -202,7 +202,7 @@ for_window [class="chromium-browser"] fullscreen enable
}
/**
* Start Chrome browser in kiosk mode
* Start Chromium browser in kiosk mode
*/
async startBrowser(config: BrowserConfig): Promise<void> {
const env: Record<string, string> = {
@@ -213,7 +213,7 @@ for_window [class="chromium-browser"] fullscreen enable
XDG_DATA_HOME: `/home/${this.user}/.local/share`,
};
// Chrome arguments for kiosk mode on Wayland
// Chromium arguments for kiosk mode on Wayland
const browserArgs = [
'--ozone-platform=wayland',
'--enable-features=UseOzonePlatform',
@@ -269,17 +269,17 @@ for_window [class="chromium-browser"] fullscreen enable
this.browserProcess = command.spawn();
// Log output in background
this.pipeOutput(this.browserProcess, 'chrome');
this.pipeOutput(this.browserProcess, 'chromium');
// Force fullscreen via swaymsg after Chrome window appears (backup)
// Force fullscreen via swaymsg after Chromium window appears (backup)
this.forceFullscreenAfterDelay(config);
}
/**
* Force fullscreen for Chrome window after a delay (backup for kiosk mode)
* Force fullscreen for Chromium window after a delay (backup for kiosk mode)
*/
private async forceFullscreenAfterDelay(config: { runtimeDir: string; waylandDisplay: string }): Promise<void> {
// Wait for Chrome window to appear
// Wait for Chromium window to appear
await new Promise((resolve) => setTimeout(resolve, 3000));
console.log('[chromium] Forcing fullscreen via swaymsg');
@@ -379,7 +379,7 @@ for_window [class="chromium-browser"] fullscreen enable
console.log(`[${name}] Process exited with code ${status.code}`);
if (name === 'sway') {
this.swayProcess = null;
} else if (name === 'chrome') {
} else if (name === 'chromium') {
this.browserProcess = null;
}
});

View File

@@ -201,8 +201,8 @@ export class UIServer {
Sway Compositor
</div>
<div class="stat">
<span class="status-dot" id="chrome-status"></span>
Chrome Browser
<span class="status-dot" id="chromium-status"></span>
Chromium Browser
</div>
</div>
<div class="card">
@@ -252,8 +252,8 @@ export class UIServer {
// Services
document.getElementById('sway-status').className =
'status-dot ' + (data.sway ? 'running' : 'stopped');
document.getElementById('chrome-status').className =
'status-dot ' + (data.chrome ? 'running' : 'stopped');
document.getElementById('chromium-status').className =
'status-dot ' + (data.chromium ? 'running' : 'stopped');
// System info
if (data.systemInfo) {