add boot themes
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type { LineColor } from '../components/BootSequence';
|
||||
import { BOOT_SCREENS } from '../components/MatrixRain';
|
||||
|
||||
export interface OutputLine {
|
||||
text: string;
|
||||
@@ -211,6 +212,30 @@ export const handlers: Record<string, CommandHandler> = {
|
||||
return [red(`rm: cannot remove '${args[args.length - 1]}': Permission denied`)];
|
||||
},
|
||||
|
||||
theme: (args) => {
|
||||
if (args.length === 0) {
|
||||
const current = localStorage.getItem('stift15-bootscreen') || 'logo';
|
||||
return [
|
||||
amber('Boot screen themes:'),
|
||||
...BOOT_SCREENS.map((s) =>
|
||||
green(` ${s === current ? '▸ ' : ' '}${s}`)
|
||||
),
|
||||
dim(''),
|
||||
dim(`Usage: theme <name>`),
|
||||
dim('Run "reboot" to see the new boot screen.'),
|
||||
];
|
||||
}
|
||||
const name = args[0].toLowerCase();
|
||||
if (!BOOT_SCREENS.includes(name)) {
|
||||
return [red(`theme: '${name}' not found. Available: ${BOOT_SCREENS.join(', ')}`)];
|
||||
}
|
||||
localStorage.setItem('stift15-bootscreen', name);
|
||||
return [
|
||||
green(`Boot screen set to '${name}'.`),
|
||||
dim('Run "reboot" to see it.'),
|
||||
];
|
||||
},
|
||||
|
||||
sudo: (args) => {
|
||||
if (args.length === 0) return [red('sudo: missing command')];
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user