Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions web/src/desktop/Desktop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ const CELL_H = 112

// `bg` is the icon in the colourful themes; `tone` is the palette colour it takes in the others
// (Midnight, Neon, Ember, Daylight and the Omarchy desktop's own theme), see .sys-ico in styles.css.
export const SYS: Record<SysKind, {title: string; icon?: IconName; bg?: string; tone?: string; w: number; h: number}> = {
// `max`: the window opens maximised; Restore still works.
export const SYS: Record<SysKind, {title: string; icon?: IconName; bg?: string; tone?: string; w: number; h: number; max?: boolean}> = {
home: {title: 'Home', icon: 'home-filled', bg: 'linear-gradient(150deg,#93c5fd,#1d4ed8 70%)', tone: 'var(--blue)', w: 860, h: 720},
files: {title: 'Files', icon: 'folder-filled', bg: 'linear-gradient(150deg,#7cb4ff,#2563eb 70%)', tone: 'var(--blue)', w: 960, h: 660},
apps: {title: 'Apps', icon: 'apps-filled', bg: 'linear-gradient(150deg,#c4b5fd,#7c3aed 70%)', tone: 'var(--mauve)', w: 800, h: 680},
Expand All @@ -113,7 +114,7 @@ export const SYS: Record<SysKind, {title: string; icon?: IconName; bg?: string;
machines: {title: 'Machines', icon: 'machine-filled', bg: 'linear-gradient(150deg,#5eead4,#0f766e 70%)', tone: 'var(--teal)', w: 1180, h: 760},
machine: {title: 'Machine', icon: 'machine-filled', bg: 'linear-gradient(150deg,#5eead4,#0f766e 70%)', tone: 'var(--teal)', w: 1040, h: 760},
terminals: {title: 'Orchestrator', icon: 'terminals', bg: 'linear-gradient(150deg,#86efac,#15803d 70%)', tone: 'var(--green)', w: 980, h: 760},
system: {title: 'System', icon: 'activity-filled', bg: 'linear-gradient(150deg,#fdba74,#c2410c 70%)', tone: 'var(--peach)', w: 820, h: 720},
system: {title: 'System', icon: 'activity-filled', bg: 'linear-gradient(150deg,#fdba74,#c2410c 70%)', tone: 'var(--peach)', w: 820, h: 720, max: true},
settings: {title: 'Settings', icon: 'settings', bg: 'linear-gradient(150deg,#cbd5e1,#475569 70%)', tone: 'var(--fg)', w: 760, h: 720},
personalize: {title: 'Appearance', icon: 'palette', bg: 'linear-gradient(150deg,#f9a8d4,#be185d 70%)', tone: 'var(--pink)', w: 880, h: 720},
assistant: {title: 'Assistant', icon: 'sparkle', bg: 'linear-gradient(150deg,#c4b5fd,#7c3aed 70%)', tone: 'var(--mauve)', w: 720, h: 640},
Expand Down Expand Up @@ -739,7 +740,7 @@ export function Desktop({boot, prefs, setPrefs, onSignedOut, reopenAssistant}: {
zTop.current += 1
const id = Math.random().toString(36).slice(2, 10)
const workspace = hyprWsRef.current
const win: Win = {id, kind, key, payload: storedPayload, x: Math.max(a.x + 8, x), y: Math.max(a.y + 8, y), w, h, z: zTop.current, min: false, snap: null, born: Date.now(), workspace, float: false}
const win: Win = {id, kind, key, payload: storedPayload, x: Math.max(a.x + 8, x), y: Math.max(a.y + 8, y), w, h, z: zTop.current, min: false, snap: cfg.shell !== 'hyprland' && (SYS as Record<string, {max?: boolean}>)[kind]?.max ? 'max' : null, born: Date.now(), workspace, float: false}
if (cfg.shell === 'hyprland') {
const focused = topTileOn(workspace)
setTrees((ts) => ({...ts, [workspace]: insertTile(ts[workspace] ?? null, focused?.id ?? firstLeaf(ts[workspace] ?? null), id, usable(), GAP, hiddenIds(workspace))}))
Expand Down
15 changes: 10 additions & 5 deletions web/src/screens/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function machineIcon(member: FleetMember): IconName {
return 'devices'
}

export function Home({onOpenApp}: {onOpenApp: (app: UserApp) => void; go: (tab: 'apps' | 'more' | 'store') => void; onTerminal?: () => void; onAssistant?: () => void}) {
export function Home({onOpenApp, go}: {onOpenApp: (app: UserApp) => void; go: (tab: 'apps' | 'more' | 'store') => void; onTerminal?: () => void; onAssistant?: () => void}) {
const {tempUnit} = useStatView()
const user = useUser()
const apps = useApps()
Expand Down Expand Up @@ -205,14 +205,19 @@ export function Home({onOpenApp}: {onOpenApp: (app: UserApp) => void; go: (tab:
</span>
)
)}
<span className="fact">
<button type="button" className="fact fact-link" onClick={() => go('more')} aria-label={`Up ${duration(uptime.data)}. Open System`}>
<Icon name="clock" size={15} />
Up {duration(uptime.data)}
</span>
<span className="fact">
</button>
<button type="button" className="fact fact-link" onClick={() => go('apps')} aria-label={`${running} of ${list.length} apps running. Open Apps`}>
<Icon name="apps" size={15} />
{running}/{list.length} apps running
</span>
</button>
<button type="button" className="fact fact-link fact-system" onClick={() => go('more')}>
<Icon name="activity" size={15} />
System
<Icon name="chevron" size={13} />
</button>
{swarmList.length > 0 && (
<span className="fact">
<Icon name="devices" size={15} />
Expand Down
32 changes: 32 additions & 0 deletions web/src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -12868,3 +12868,35 @@ input.temp-unit-box.fallback:checked {
-webkit-touch-callout: default;
overscroll-behavior: contain;
}

/* Home facts: tiles side by side; the ones that open a page look and act like buttons. */
.facts:has(.fact-link) {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
}
.fact-link {
cursor: pointer;
font: inherit;
font-size: 12.5px;
font-weight: 550;
transition:
background 0.15s,
border-color 0.15s;
}
.fact-link:hover {
background: var(--glass-2);
border-color: var(--line-2);
}
.fact-link:focus-visible {
outline: 2px solid var(--accent-text);
outline-offset: 2px;
}
.fact-system {
color: var(--accent-text);
}
/* On a phone the two facts share a row and System takes its own full row, not half of one. */
@media (max-width: 520px) {
.facts:has(.fact-link) .fact-system {
grid-column: 1 / -1;
}
}
Loading