Skip to content

LordOS — a free, fast and secure GNU/Linux distribution based on Debian, with its own desktop environment: display server and Wayland compositor in C, a React UI engine on QuickJS, and private native apps.

Window menu for both themes (Zoom, Fill, Center, Move & Resize with halves/quarters/thirds/arrangements, Move to <display>, Bring All to Front, window list; top and bottom snap zones, wm.center/moveToDisplay/arrange); Dock Options: Open at Login and Assign To a display; Settings: the Themes page folded into Appearance → Desktop style, which lists every installed theme

Federico Pereira322ed9208821
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a8c03fc..acbb75d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,17 @@ of the matching [GitHub release](https://github.com/lordbasex/LordOS/releases),
### Added
+- **A fuller Window menu, in both themes.** Minimize, Zoom, Fill, Center; **Move & Resize** with the
+ left, right, top and bottom halves, the quarters and thirds, arrangements of two windows (left and
+ right, right and left, top and bottom, bottom and top) or four (quarters) with the windows behind it,
+ and Return to Previous Size; **Move to <display>** for every other display (a snapped window keeps
+ its zone, the rest keep their place relative to the screen); Bring All to Front; and the open
+ windows, the one in front checked.
+- **Dock: Open at Login and Assign To.** A Dock item's Options menu can open the app when you sign in
+ (started the same way as a Dock click) and, with more than one display, assign it to a display: its
+ new windows open there (kept by the display's name across boots).
+- **One place to choose the desktop style.** Settings → Appearance → Desktop style now lists every
+ installed theme, and the separate Themes page is gone (an old link to it opens Appearance).
- **The app menu and Force Quit (Lord Flow).** Clicking the app's name in the menu bar opens its
menu: About <app> (its icon, name, own version and where it comes from), Settings… (the app's own,
❖,), Hide <app>, Hide Others, Show All and Quit <app> (❖Q). The crown menu adds the Store, with how
diff --git a/apps/settings/index.jsx b/apps/settings/index.jsx
index 24480f4..9ff499a 100644
--- a/apps/settings/index.jsx
+++ b/apps/settings/index.jsx
@@ -123,13 +123,15 @@ function StyleThumb({ id, accent, dark }) {
);
}
-// Desktop style: the two full appearances (Lord Flow and Lord Classic), switched live. The open app
-// windows come back in the new one (sdk/index.js themes.use), Settings on this page.
+// Desktop style: every installed theme (Lord Flow and Lord Classic first; the login screen's is hidden),
+// switched live. The open app windows come back in the new one (sdk/index.js themes.use), Settings on
+// this page. Since 0.8.5 this is the only place to choose a theme (there is no separate Themes page).
function StylePicker() {
const t = useTheme();
const { t: tr } = useLocale();
- const list = themes.list().filter((th) => th.id === 'default' || th.id === 'classic');
- if (list.length < 2) return null;
+ const order = (id) => (id === 'default' ? 0 : id === 'classic' ? 1 : 2);
+ const list = [...themes.list()].sort((a, b) => order(a.id) - order(b.id) || a.name.localeCompare(b.name));
+ if (!list.length) return null;
const pick = (id) => {
wm.open('settings', { args: { section: 'appearance' } });
themes.use(id);
@@ -137,8 +139,8 @@ function StylePicker() {
return (
<Section title={tr('settings.style.title')} footer={tr('settings.style.hint')}>
<View style={{ flexDirection: 'row', gap: spacing.xxl, paddingVertical: spacing.m, justifyContent: 'center' }}>
- {['default', 'classic'].map((id) => {
- const th = list.find((x) => x.id === id);
+ {list.map((th) => {
+ const id = th.id;
return (
<View key={id} onClick={() => { if (!th.current) pick(id); }} style={{ alignItems: 'center', gap: 6 }}>
<View style={{ padding: 2, borderRadius: 10, border: `2px solid ${th.current ? t.accent : 'transparent'}` }}>
@@ -451,25 +453,6 @@ function Keyboard() {
);
}
-function Themes() {
- const t = useTheme();
- const { t: tr } = useLocale();
- const list = themes.list();
- return (
- <Stack>
- <Section footer={tr('settings.themes.hint')}>
- {list.map((th) => (
- <SettingRow key={th.id} icon={<Badge glyph="◧" color={th.current ? t.accent : '#8e8e93'} size={28} />} label={th.name} hint={th.description}>
- {th.current
- ? <Text style={{ fontSize: typeScale.callout, fontWeight: 600, color: t.accent }}>{tr('settings.themes.current')}</Text>
- : <Button small label={tr('settings.themes.use')} onClick={() => themes.use(th.id)} />}
- </SettingRow>
- ))}
- </Section>
- </Stack>
- );
-}
-
function Session() {
const { t: tr } = useLocale();
return (
@@ -540,7 +523,7 @@ const GROUPS = [
[['general', General, '#8e8e93', 'i'], ['appearance', Appearance, '#3a3a3c', '◐'], ['wallpaper', Wallpapers, '#30b0c7', '▣'], ['dock', DockSettings, '#3a3a3c', '▁'], ['displays', DisplaysSettings, '#0a84ff', '▭']],
[['network', NetworkSettings, '#0a84ff', '⇅'], ['bluetooth', BluetoothSettings, '#0a84ff', 'ᛒ'], ['sound', SoundSettings, '#ff375f', '♪'], ['notifications', NotificationsSettings, '#ff3b30', '◉'], ['printers', PrintersSettings, '#636366', '⎙'], ['clipboard', ClipboardSettings, '#5e5ce6', '⎘'], ['sharing', SharingSettings, '#34c759', '⇄']],
[['language', LanguageRegion, '#30b0c7', 'A'], ['datetime', DateTimeSettings, '#0a84ff', '◷'], ['keyboard', Keyboard, '#8e8e93', '⌨'], ['trackpad', TrackpadSettings, '#8e8e93', '▭'], ['defaultapps', DefaultAppsSettings, '#8e8e93', '◫']],
- [['power', PowerSettings, '#30d158', BoltGlyph], ['cooling', CoolingSettings, '#32ade6', FanGlyph], ['firmware', FirmwareSettings, '#5e5ce6', ChipGlyph], ['privacy', PrivacySettings, '#0a84ff', LockGlyph], ['users', UsersSettings, '#0a84ff', '☺'], ['updates', Updates, '#8e8e93', '↻'], ['themes', Themes, '#ff9f0a', '◧'], ['session', Session, '#ff453a', '↪']],
+ [['power', PowerSettings, '#30d158', BoltGlyph], ['cooling', CoolingSettings, '#32ade6', FanGlyph], ['firmware', FirmwareSettings, '#5e5ce6', ChipGlyph], ['privacy', PrivacySettings, '#0a84ff', LockGlyph], ['users', UsersSettings, '#0a84ff', '☺'], ['updates', Updates, '#8e8e93', '↻'], ['session', Session, '#ff453a', '↪']],
];
const SECTIONS = GROUPS.flat();
// Trackpad only if there is a touchpad (lord-sessiond lends them with the monitor); Board firmware
@@ -594,7 +577,8 @@ export default function Settings() {
const [section, setSectionState] = useState(lastSection);
const [query, setQuery] = useState('');
const setSection = (s) => { lastSection = s; setSectionState(s); };
- useEffect(() => { if (args?.section && SECTIONS.some(([id]) => id === args.section)) setSection(args.section); }, [args?.nonce]);
+ // 'themes' (the old Themes page, links from older help) now opens Appearance
+ useEffect(() => { const sec = args?.section === 'themes' ? 'appearance' : args?.section; if (sec && SECTIONS.some(([id]) => id === sec)) setSection(sec); }, [args?.nonce]);
const [, Body] = SECTIONS.find(([id]) => id === section) || SECTIONS[0];
const q = query.trim().toLowerCase();
// Trackpad only if there is a touchpad (lord-sessiond lends them with the monitor)
diff --git a/assets/help/en/appearance.md b/assets/help/en/appearance.md
index 3810d0e..6369322 100644
--- a/assets/help/en/appearance.md
+++ b/assets/help/en/appearance.md
@@ -13,6 +13,6 @@ keywords: appearance, dark mode, light, color, accent, theme, wallpaper, transpa
- **Desktop style:** [Settings → Appearance](settings:appearance) changes the whole desktop live,
without closing apps: **Lord Flow** (menu bar on top and Dock) or **Lord Classic** (a centered
taskbar with a start menu, quick settings and notifications). The open windows come back in the
- new style. [Settings → Themes](settings:themes) lists every installed theme.
+ new style. Any other theme installed appears here too.
Every app takes the theme's colors, including those installed from the Store.
diff --git a/assets/help/en/settings.md b/assets/help/en/settings.md
index 7511154..9d2ae8c 100644
--- a/assets/help/en/settings.md
+++ b/assets/help/en/settings.md
@@ -12,7 +12,7 @@ Everything you can configure in LordOS is in Settings. The field at the top sear
| Section | What it has |
|---|---|
| [General](settings:general) | This computer: name, software and storage |
-| [Appearance](settings:appearance) | Dark or light mode, accent color, transparency |
+| [Appearance](settings:appearance) | Desktop style (Lord Flow or Lord Classic), dark or light mode, accent color, transparency |
| [Wallpaper](settings:wallpaper) | The desktop background |
| [Network](settings:network) | Wired, Wi-Fi and VPN (see [Network](help:network)) |
| [Sound](settings:sound) | Outputs, inputs, per-app volume (see [Sound](help:sound)) |
@@ -25,7 +25,6 @@ Everything you can configure in LordOS is in Settings. The field at the top sear
| [Privacy](settings:privacy) | App permissions (see [Privacy](help:privacy)) |
| [Users](settings:users) | Accounts and automatic login (see [Users and sessions](help:users)) |
| [Updates](settings:updates) | Debian packages (see [Updates](help:updates)) |
-| [Themes](settings:themes) | Lord Flow or Lord Classic |
| [Session](settings:session) | Log out |
Changes save by themselves. What affects the whole computer (network, users, time zone, packages)
diff --git a/assets/help/es/appearance.md b/assets/help/es/appearance.md
index 32e6507..aed7bdb 100644
--- a/assets/help/es/appearance.md
+++ b/assets/help/es/appearance.md
@@ -14,6 +14,6 @@ keywords: apariencia, modo oscuro, claro, color, acento, tema, fondo, transparen
- **Estilo de escritorio:** [Ajustes → Apariencia](settings:appearance) cambia todo el escritorio
en vivo, sin cerrar las apps: **Lord Flow** (barra de menú arriba y Dock) o **Lord Classic** (barra
de tareas centrada con menú de inicio, ajustes rápidos y notificaciones). Las ventanas abiertas
- vuelven en el estilo nuevo. [Ajustes → Temas](settings:themes) muestra todos los temas instalados.
+ vuelven en el estilo nuevo. Cualquier otro tema instalado también aparece acá.
Todas las apps toman los colores del tema, incluidas las que instalás desde la Tienda.
diff --git a/assets/help/es/settings.md b/assets/help/es/settings.md
index bfdc0a2..34722d6 100644
--- a/assets/help/es/settings.md
+++ b/assets/help/es/settings.md
@@ -12,7 +12,7 @@ Todo lo que se configura de LordOS está en Ajustes. El campo de arriba busca en
| Sección | Qué tiene |
|---|---|
| [General](settings:general) | Este equipo: nombre, software y almacenamiento |
-| [Apariencia](settings:appearance) | Modo oscuro o claro, color de acento, transparencias |
+| [Apariencia](settings:appearance) | Estilo de escritorio (Lord Flow o Lord Classic), modo oscuro o claro, color de acento, transparencias |
| [Fondo de pantalla](settings:wallpaper) | El fondo del escritorio |
| [Red](settings:network) | Cable, Wi-Fi y VPN (ver [Red](help:network)) |
| [Sonido](settings:sound) | Salidas, entradas, volumen por app (ver [Sonido](help:sound)) |
@@ -25,7 +25,6 @@ Todo lo que se configura de LordOS está en Ajustes. El campo de arriba busca en
| [Privacidad](settings:privacy) | Permisos de las apps (ver [Privacidad](help:privacy)) |
| [Usuarios](settings:users) | Cuentas e inicio automático (ver [Usuarios y sesiones](help:users)) |
| [Actualizaciones](settings:updates) | Paquetes de Debian (ver [Actualizaciones](help:updates)) |
-| [Temas](settings:themes) | Lord Flow o Lord Classic |
| [Sesión](settings:session) | Cerrar la sesión |
Los cambios se guardan solos. Lo que afecta a todo el equipo (red, usuarios, zona horaria,
diff --git a/assets/help/pt/appearance.md b/assets/help/pt/appearance.md
index 5399948..09c962e 100644
--- a/assets/help/pt/appearance.md
+++ b/assets/help/pt/appearance.md
@@ -14,7 +14,6 @@ keywords: aparência, modo escuro, claro, cor, destaque, tema, fundo, transparê
- **Estilo da área de trabalho:** [Ajustes → Aparência](settings:appearance) muda a área de
trabalho inteira na hora, sem fechar os apps: **Lord Flow** (barra de menus no alto e Dock) ou
**Lord Classic** (barra de tarefas centralizada com menu iniciar, configurações rápidas e
- notificações). As janelas abertas voltam no estilo novo. [Ajustes → Temas](settings:themes) lista
- todos os temas instalados.
+ notificações). As janelas abertas voltam no estilo novo. Qualquer outro tema instalado também aparece aqui.
Todos os apps usam as cores do tema, inclusive os instalados pela Loja.
diff --git a/assets/help/pt/settings.md b/assets/help/pt/settings.md
index f2ff81a..2ada5ea 100644
--- a/assets/help/pt/settings.md
+++ b/assets/help/pt/settings.md
@@ -12,7 +12,7 @@ Tudo o que se configura no LordOS está nos Ajustes. O campo no alto busca entre
| Seção | O que tem |
|---|---|
| [Geral](settings:general) | Este computador: nome, software e armazenamento |
-| [Aparência](settings:appearance) | Modo escuro ou claro, cor de destaque, transparências |
+| [Aparência](settings:appearance) | Estilo da área de trabalho (Lord Flow ou Lord Classic), modo escuro ou claro, cor de destaque, transparências |
| [Fundo de tela](settings:wallpaper) | O fundo da área de trabalho |
| [Rede](settings:network) | Cabo, Wi-Fi e VPN (veja [Rede](help:network)) |
| [Som](settings:sound) | Saídas, entradas, volume por app (veja [Som](help:sound)) |
@@ -25,7 +25,6 @@ Tudo o que se configura no LordOS está nos Ajustes. O campo no alto busca entre
| [Privacidade](settings:privacy) | Permissões dos apps (veja [Privacidade](help:privacy)) |
| [Usuários](settings:users) | Contas e login automático (veja [Usuários e sessões](help:users)) |
| [Atualizações](settings:updates) | Pacotes do Debian (veja [Atualizações](help:updates)) |
-| [Temas](settings:themes) | Lord Flow ou Lord Classic |
| [Sessão](settings:session) | Sair da sessão |
As mudanças se salvam sozinhas. O que afeta o computador inteiro (rede, usuários, fuso horário,
diff --git a/assets/locales/en/shell.json b/assets/locales/en/shell.json
index f7f38c4..b7a4333 100644
--- a/assets/locales/en/shell.json
+++ b/assets/locales/en/shell.json
@@ -110,11 +110,15 @@
"code.recovery.title": "This LordOS component was modified and was not loaded",
"desktop.openLaunchpad": "Open Apps",
"desktop.wallpaper": "Change Wallpaper…",
+ "dock.assignDisplay": "Display {n} ({name})",
+ "dock.assignNone": "None (where the pointer is)",
+ "dock.assignTo": "Assign To",
"dock.closeAll": "Close all windows",
"dock.hide": "Hide",
"dock.keep": "Keep in Dock",
"dock.newWindow": "New Window",
"dock.open": "Open",
+ "dock.openAtLogin": "Open at Login",
"dock.options": "Options",
"dock.pin": "Pin to taskbar",
"dock.quit": "Quit",
@@ -221,7 +225,37 @@
"wallpaper.stellar-voyage": "Stellar Voyage",
"wallpaper.sunset": "Sunset",
"wallpaper.violet-horizon": "Violet Horizon",
+ "window.arrange.bottomTop": "Bottom & Top",
+ "window.arrange.leftRight": "Left & Right",
+ "window.arrange.quarters": "Quarters",
+ "window.arrange.rightLeft": "Right & Left",
+ "window.arrange.topBottom": "Top & Bottom",
+ "window.bringAll": "Bring All to Front",
+ "window.center": "Center",
"window.close": "Close Window",
+ "window.displayN": "{name} ({n})",
+ "window.fill": "Fill",
"window.maximize": "Zoom",
- "window.minimize": "Minimize"
+ "window.minimize": "Minimize",
+ "window.moveResize": "Move & Resize",
+ "window.moveTo": "Move to {display}",
+ "window.previousSize": "Return to Previous Size",
+ "window.section.arrange": "Arrange",
+ "window.section.halves": "Halves",
+ "window.section.quarters": "Quarters",
+ "window.section.thirds": "Thirds",
+ "window.zone.bottom": "Bottom",
+ "window.zone.bottom-left": "Bottom Left",
+ "window.zone.bottom-right": "Bottom Right",
+ "window.zone.center-third": "Center Third",
+ "window.zone.left": "Left",
+ "window.zone.left-third": "Left Third",
+ "window.zone.left-two-thirds": "Left Two Thirds",
+ "window.zone.right": "Right",
+ "window.zone.right-third": "Right Third",
+ "window.zone.right-two-thirds": "Right Two Thirds",
+ "window.zone.top": "Top",
+ "window.zone.top-left": "Top Left",
+ "window.zone.top-right": "Top Right",
+ "window.zoom": "Zoom"
}
diff --git a/assets/locales/es/shell.json b/assets/locales/es/shell.json
index 73ecbf2..1b1dfaa 100644
--- a/assets/locales/es/shell.json
+++ b/assets/locales/es/shell.json
@@ -110,11 +110,15 @@
"code.recovery.title": "Este componente de LordOS fue modificado y no se cargó",
"desktop.openLaunchpad": "Abrir Aplicaciones",
"desktop.wallpaper": "Cambiar fondo de pantalla…",
+ "dock.assignDisplay": "Pantalla {n} ({name})",
+ "dock.assignNone": "Ninguna (donde esté el puntero)",
+ "dock.assignTo": "Asignar a",
"dock.closeAll": "Cerrar todas las ventanas",
"dock.hide": "Ocultar",
"dock.keep": "Mantener en el Dock",
"dock.newWindow": "Nueva ventana",
"dock.open": "Abrir",
+ "dock.openAtLogin": "Abrir al iniciar sesión",
"dock.options": "Opciones",
"dock.pin": "Anclar a la barra de tareas",
"dock.quit": "Salir",
@@ -221,7 +225,37 @@
"wallpaper.stellar-voyage": "Viaje estelar",
"wallpaper.sunset": "Atardecer",
"wallpaper.violet-horizon": "Horizonte violeta",
+ "window.arrange.bottomTop": "Inferior y superior",
+ "window.arrange.leftRight": "Izquierda y derecha",
+ "window.arrange.quarters": "Cuartos",
+ "window.arrange.rightLeft": "Derecha e izquierda",
+ "window.arrange.topBottom": "Superior e inferior",
+ "window.bringAll": "Traer todo al frente",
+ "window.center": "Centrar",
"window.close": "Cerrar ventana",
+ "window.displayN": "{name} ({n})",
+ "window.fill": "Rellenar",
"window.maximize": "Maximizar",
- "window.minimize": "Minimizar"
+ "window.minimize": "Minimizar",
+ "window.moveResize": "Trasladar y redimensionar",
+ "window.moveTo": "Trasladar a {display}",
+ "window.previousSize": "Volver al tamaño anterior",
+ "window.section.arrange": "Disposición",
+ "window.section.halves": "Mitades",
+ "window.section.quarters": "Cuartos",
+ "window.section.thirds": "Tercios",
+ "window.zone.bottom": "Inferior",
+ "window.zone.bottom-left": "Parte inferior izquierda",
+ "window.zone.bottom-right": "Parte inferior derecha",
+ "window.zone.center-third": "Tercio central",
+ "window.zone.left": "Izquierda",
+ "window.zone.left-third": "Tercio izquierdo",
+ "window.zone.left-two-thirds": "Dos tercios a la izquierda",
+ "window.zone.right": "Derecha",
+ "window.zone.right-third": "Tercio derecho",
+ "window.zone.right-two-thirds": "Dos tercios a la derecha",
+ "window.zone.top": "Superior",
+ "window.zone.top-left": "Parte superior izquierda",
+ "window.zone.top-right": "Parte superior derecha",
+ "window.zoom": "Zoom"
}
diff --git a/assets/locales/pt/shell.json b/assets/locales/pt/shell.json
index bce3aa8..2763645 100644
--- a/assets/locales/pt/shell.json
+++ b/assets/locales/pt/shell.json
@@ -110,11 +110,15 @@
"code.recovery.title": "Este componente do LordOS foi modificado e não foi carregado",
"desktop.openLaunchpad": "Abrir Aplicativos",
"desktop.wallpaper": "Alterar papel de parede…",
+ "dock.assignDisplay": "Tela {n} ({name})",
+ "dock.assignNone": "Nenhuma (onde estiver o ponteiro)",
+ "dock.assignTo": "Atribuir a",
"dock.closeAll": "Fechar todas as janelas",
"dock.hide": "Ocultar",
"dock.keep": "Manter no Dock",
"dock.newWindow": "Nova janela",
"dock.open": "Abrir",
+ "dock.openAtLogin": "Abrir ao iniciar sessão",
"dock.options": "Opções",
"dock.pin": "Fixar na barra de tarefas",
"dock.quit": "Sair",
@@ -221,7 +225,37 @@
"wallpaper.stellar-voyage": "Viagem estelar",
"wallpaper.sunset": "Pôr do sol",
"wallpaper.violet-horizon": "Horizonte violeta",
+ "window.arrange.bottomTop": "Inferior e superior",
+ "window.arrange.leftRight": "Esquerda e direita",
+ "window.arrange.quarters": "Quartos",
+ "window.arrange.rightLeft": "Direita e esquerda",
+ "window.arrange.topBottom": "Superior e inferior",
+ "window.bringAll": "Trazer tudo para a frente",
+ "window.center": "Centralizar",
"window.close": "Fechar janela",
+ "window.displayN": "{name} ({n})",
+ "window.fill": "Preencher",
"window.maximize": "Maximizar",
- "window.minimize": "Minimizar"
+ "window.minimize": "Minimizar",
+ "window.moveResize": "Mover e redimensionar",
+ "window.moveTo": "Mover para {display}",
+ "window.previousSize": "Voltar ao tamanho anterior",
+ "window.section.arrange": "Disposição",
+ "window.section.halves": "Metades",
+ "window.section.quarters": "Quartos",
+ "window.section.thirds": "Terços",
+ "window.zone.bottom": "Inferior",
+ "window.zone.bottom-left": "Inferior esquerdo",
+ "window.zone.bottom-right": "Inferior direito",
+ "window.zone.center-third": "Terço central",
+ "window.zone.left": "Esquerda",
+ "window.zone.left-third": "Terço esquerdo",
+ "window.zone.left-two-thirds": "Dois terços à esquerda",
+ "window.zone.right": "Direita",
+ "window.zone.right-third": "Terço direito",
+ "window.zone.right-two-thirds": "Dois terços à direita",
+ "window.zone.top": "Superior",
+ "window.zone.top-left": "Superior esquerdo",
+ "window.zone.top-right": "Superior direito",
+ "window.zoom": "Zoom"
}
diff --git a/sdk/dock.js b/sdk/dock.js
index 4c275df..45a5d32 100644
--- a/sdk/dock.js
+++ b/sdk/dock.js
@@ -22,7 +22,8 @@ import { useEffect } from 'react';
import { addListener } from '@lordos/runtime';
import { settings } from './settings.js';
import { createStore, useStore } from './store.js';
-import { useWindows, wm, windowTitle, appIdOf, getApp, windows } from './windows.js';
+import { useWindows, wm, windowTitle, appIdOf, getApp, windows, setDisplayAssignment, isLiveSystem } from './windows.js';
+import { screen, onScreenChange } from '@lordos/runtime';
import { useLauncherApps, launchApp, linuxAppFor, shortAppName, windowAppName, LetterIcon, windowIcon } from './apps.js';
import { t, locale } from './i18n.js';
import * as fs from './fs.js';
@@ -307,6 +308,19 @@ export function dockMenu(e, opts = {}) {
// where the app lives, when Files can open it (a .lpk's folder; a .desktop of the user's own)
if (p.kind === 'lpk' && getApp(p.key)?.dir) options.push({ label: t('shell.dock.showInFiles'), onClick: () => wm.open('files', { args: { path: getApp(p.key).dir } }) });
if (p.kind === 'desktop' && e.app?.user) options.push({ label: t('shell.dock.showInFiles'), onClick: () => wm.open('files', { args: { path: '~/.local/share/applications' } }) });
+ // Open at Login (0.8.5): started through the same safe path as a Dock click, once per session
+ if (p.kind !== 'shell') {
+ const on = loginApps().includes(e.id);
+ options.push({ label: t('shell.dock.openAtLogin'), checked: on, onClick: () => settings.set({ loginApps: on ? loginApps().filter((x) => x !== e.id) : [...loginApps(), e.id] }) });
+ }
+ // Assign to a display (0.8.5): its new windows open there; by the display's name, kept across boots
+ if (screen.displays.length > 1 && e.launcherId) {
+ const cur = (settings.get().appDisplays || {})[e.launcherId] || '';
+ const set = (name) => { const m = { ...(settings.get().appDisplays || {}) }; if (name) m[e.launcherId] = name; else delete m[e.launcherId]; settings.set({ appDisplays: m }); };
+ options.push('-', { label: t('shell.dock.assignTo'), disabled: true });
+ screen.displays.forEach((d, i) => options.push({ label: t('shell.dock.assignDisplay', { n: i + 1, name: d.name || '' }).trim(), checked: cur === d.name, onClick: () => set(d.name) }));
+ options.push({ label: t('shell.dock.assignNone'), checked: !cur, onClick: () => set('') });
+ }
if (options.length) items.push({ label: t('shell.dock.options'), submenu: options }, '-');
}
if (e.windows.length) {
@@ -422,3 +436,16 @@ addListener('keydown', (e) => {
clearTimeout(holdTimer);
if (dockDrag.get()) { endedAt = Date.now(); dockDrag.set(null); }
});
+
+// ---- Open at Login and display assignments (0.8.5) ----
+const loginApps = () => (Array.isArray(settings.get().loginApps) ? settings.get().loginApps : []);
+setDisplayAssignment((key) => {
+ const name = (settings.get().appDisplays || {})[key];
+ const d = name ? screen.displays.find((x) => x.name === name) : null;
+ return d ? d.id : null;
+});
+// once per session, a few seconds after it starts (never in the live system's first run, never in an
+// isolated app's process), each through launchDockItem: the same safe paths as a Dock click
+if (typeof lord !== 'undefined' && typeof lord.appId !== 'string' && typeof lord.greeter === 'undefined' && !isLiveSystem()) {
+ setTimeout(() => { for (const id of loginApps()) { try { launchDockItem(id); } catch (e) { /* uninstalled */ } } }, 3000);
+}
diff --git a/sdk/index.js b/sdk/index.js
index 87c6ef4..e838a95 100644
--- a/sdk/index.js
+++ b/sdk/index.js
@@ -240,3 +240,4 @@ function LocaleRoot({ children }) {
}
export { lordosWallpapers, wallpaperSrc, wallpaperThumb, findWallpaper, DEFAULT_WALLPAPER, GREETER_WALLPAPER, WALLPAPER_CATEGORIES } from './wallpapers.js';
export { appGroup, appMenuItems, runningApps, forceQuit, recentItems, storeUpdates } from './appcontrol.js';
+export { windowMenuItems, moveResizeItems } from './windowmenu.js';
diff --git a/sdk/snap.js b/sdk/snap.js
index 9d40805..e800c50 100644
--- a/sdk/snap.js
+++ b/sdk/snap.js
@@ -1,7 +1,7 @@
// snap.js — the geometry of window snapping (sdk/windows.js "Snapping", docs/WINDOWS.md), with no
// runtime imports so it can be tested with node (server/tests/snap_test.mjs).
-export const SNAP_ZONES = ['left', 'right', 'top-left', 'top-right', 'bottom-left', 'bottom-right', 'max',
+export const SNAP_ZONES = ['left', 'right', 'top', 'bottom', 'top-left', 'top-right', 'bottom-left', 'bottom-right', 'max',
'left-third', 'center-third', 'right-third', 'left-two-thirds', 'right-two-thirds'];
// The rectangle of a zone inside a work area `a` ({ x, y, w, h }). Halves and quarters round to
@@ -11,6 +11,8 @@ export function snapRect(zone, a) {
switch (zone) {
case 'left': return { x: a.x, y: a.y, w: hw, h: a.h };
case 'right': return { x: a.x + hw, y: a.y, w: a.w - hw, h: a.h };
+ case 'top': return { x: a.x, y: a.y, w: a.w, h: hh };
+ case 'bottom': return { x: a.x, y: a.y + hh, w: a.w, h: a.h - hh };
case 'top-left': return { x: a.x, y: a.y, w: hw, h: hh };
case 'top-right': return { x: a.x + hw, y: a.y, w: a.w - hw, h: hh };
case 'bottom-left': return { x: a.x, y: a.y + hh, w: hw, h: a.h - hh };
diff --git a/sdk/wayland.js b/sdk/wayland.js
index a29c433..e252719 100644
--- a/sdk/wayland.js
+++ b/sdk/wayland.js
@@ -8,11 +8,14 @@
// menu from the app's own bar arrive as requests from the compositor.
import { createElement as h } from 'react';
import { View, Text, Surface, addListener, onShellKeyboard, shellHasKeyboard } from '@lordos/runtime';
-import { windows, wm, registerBuiltinApp, windowChrome, pointerWorkArea, getApp } from './windows.js';
+import { windows, wm, registerBuiltinApp, windowChrome, pointerWorkArea, openingArea, getApp } from './windows.js';
import { useAppWindow } from './components.jsx';
import { locale, appName } from './i18n.js';
import { linuxAppFor } from './apps.js';
+// the launcher entry a new window belongs to (as sdk/dock.js launcherIdOf), for its assigned display
+const launcherKeyFor = (appId) => (!appId ? null : getApp(appId)?.package || getApp(appId)?.isolated ? appId : linuxAppFor(appId)?.id || null);
+
const idOf = (sid) => `linux#${sid}`;
export const surfaceOf = (wid) => (String(wid).startsWith('linux#') ? Number(String(wid).slice(6)) || 0 : 0);
@@ -57,7 +60,7 @@ globalThis.__lordWayland = (sid, type, d = {}) => {
// X11 (Xwayland): the WM_CLASS class, or its instance when only that names a .desktop
if (d.x11 && d.appAlt && !linuxAppFor(d.appId) && linuxAppFor(d.appAlt)) d = { ...d, appId: d.appAlt };
const c = d.csd ? { w: 0, h: 0 } : windowChrome();
- const area = pointerWorkArea(); // on the display under the pointer (docs/DISPLAYS.md)
+ const area = openingArea(launcherKeyFor(d.appId)); // its assigned display, or under the pointer (docs/DISPLAYS.md)
const w = Math.min(area.w, d.width + c.w), hh = Math.min(area.h, d.height + c.h);
const n = windows.get().length;
// cascaded, but always inside the work area (never under the Dock)
diff --git a/sdk/windowmenu.js b/sdk/windowmenu.js
new file mode 100644
index 0000000..0b7b29a
--- /dev/null
+++ b/sdk/windowmenu.js
@@ -0,0 +1,70 @@
+// windowmenu.js — the Window menu for the window in front, the same in every theme (0.8.5):
+//
+// Minimize · Zoom · Fill · Center
+// Move & Resize › halves, quarters, thirds, arrangements of two or four windows, previous size
+// Move to <display> (one item per other display)
+// Bring All to Front
+// the open windows, the one in front checked
+//
+// Lord Flow shows it under Window in its menu bar; Lord Classic in each window's Window menu.
+import { windows, wm, getApp, windowTitle } from './windows.js';
+import { screen, displayFor } from '@lordos/runtime';
+import { t } from './i18n.js';
+
+const own = (w) => !(getApp(w.id)?.builtin && !String(w.id).startsWith('linux#')); // not the theme's panels
+
+// the visible app windows, the front one last (windows.get() is in stacking order)
+const stack = () => windows.get().filter((w) => own(w) && !w.minimized);
+
+function displayName(d, i) {
+ return screen.displays.length > 1 ? t('shell.window.displayN', { n: i + 1, name: d.name || '' }).trim() : d.name;
+}
+
+export function moveResizeItems(id) {
+ const header = (k) => ({ label: t(`shell.window.section.${k}`), disabled: true });
+ const z = (zone, k) => ({ label: t(`shell.window.zone.${k || zone}`), onClick: () => wm.snap(id, zone) });
+ const others = stack().filter((w) => w.id !== id).reverse(); // the most recent first
+ const two = others.length >= 1, four = others.length >= 2;
+ const arrange = (layout) => () => wm.arrange([id, ...others.map((w) => w.id)], layout);
+ const w = wm.get(id);
+ return [
+ header('halves'), z('left'), z('right'), z('top'), z('bottom'),
+ '-', header('quarters'), z('top-left'), z('top-right'), z('bottom-left'), z('bottom-right'),
+ '-', header('thirds'), z('left-third'), z('center-third'), z('right-third'), z('left-two-thirds'), z('right-two-thirds'),
+ '-', header('arrange'),
+ { label: t('shell.window.arrange.leftRight'), disabled: !two, onClick: arrange('left-right') },
+ { label: t('shell.window.arrange.rightLeft'), disabled: !two, onClick: arrange('right-left') },
+ { label: t('shell.window.arrange.topBottom'), disabled: !two, onClick: arrange('top-bottom') },
+ { label: t('shell.window.arrange.bottomTop'), disabled: !two, onClick: arrange('bottom-top') },
+ { label: t('shell.window.arrange.quarters'), disabled: !four, onClick: arrange('quarters') },
+ '-',
+ { label: t('shell.window.previousSize'), disabled: !(w && (w.snapped || w.maximized)), onClick: () => wm.snap(id, 'restore') },
+ ];
+}
+
+export function windowMenuItems(id, { close = true } = {}) {
+ const w = id ? wm.get(id) : null;
+ const items = [
+ { label: t('shell.window.minimize'), hint: '❖M', disabled: !w, onClick: () => wm.minimize(id) },
+ { label: t('shell.window.zoom'), disabled: !w, onClick: () => wm.toggleMaximize(id) },
+ { label: t('shell.window.fill'), disabled: !w, onClick: () => wm.snap(id, 'max') },
+ { label: t('shell.window.center'), disabled: !w, onClick: () => wm.center(id) },
+ '-',
+ { label: t('shell.window.moveResize'), disabled: !w, submenu: w ? moveResizeItems(id) : [] },
+ ];
+ if (w && screen.displays.length > 1) {
+ const here = displayFor(wm.frame(w));
+ items.push('-');
+ screen.displays.forEach((d, i) => {
+ if (d.id !== here?.id) items.push({ label: t('shell.window.moveTo', { display: displayName(d, i) }), onClick: () => wm.moveToDisplay(id, d.id) });
+ });
+ }
+ items.push('-', { label: t('shell.window.bringAll'), onClick: () => { for (const x of windows.get().filter(own)) wm.focus(x.id); if (id) wm.focus(id); } });
+ if (close) items.push('-', { label: t('shell.window.close'), hint: 'Alt+F4', disabled: !w, onClick: () => wm.close(id) });
+ const list = windows.get().filter(own);
+ if (list.length) {
+ items.push('-');
+ for (const x of list) items.push({ label: windowTitle(x) || x.app, checked: x.id === id, onClick: () => wm.focus(x.id) });
+ }
+ return items;
+}
diff --git a/sdk/windows.js b/sdk/windows.js
index 00b5599..4a3be98 100644
--- a/sdk/windows.js
+++ b/sdk/windows.js
@@ -39,6 +39,15 @@ export function workAreaOf(d) {
const pointerDisplay = () => (pointer.x >= 0 ? displayAt(pointer.x, pointer.y) : mainDisplay());
// Work area of the display under the pointer (where a new window opens).
export const pointerWorkArea = () => workAreaOf(pointerDisplay());
+// The display an app's new windows open on: the one the user assigned it to in the Dock (Options ›
+// Assign to, sdk/dock.js sets the hook), else the one under the pointer.
+let assignHook = null;
+export function setDisplayAssignment(fn) { assignHook = fn; }
+export function openingArea(appKey) {
+ const id = appKey && assignHook ? assignHook(appKey) : null;
+ const d = id != null ? screen.displays.find((x) => x.id === id) : null;
+ return workAreaOf(d || pointerDisplay());
+}
const areaOfWindow = (w) => workAreaOf(displayFor(w));
let seq = 2;
const guards = new Map();
@@ -114,7 +123,7 @@ function place(appId, count, frame) {
if (frame) return { ...frame, minimized: false, maximized: false };
const [sw, sh] = registry.get(appId)?.size || [640, 420];
const offset = (count % 6) * 30;
- const area = workAreaOf(pointerDisplay()); // where the pointer is (docs/DISPLAYS.md)
+ const area = openingArea(appId); // its assigned display, or where the pointer is (docs/DISPLAYS.md)
// the whole window stays inside the work area: a cascaded window must not slide under the
// Dock, which would cover (and take the clicks of) its bottom edge
const w = Math.min(sw, area.w), h = Math.min(sh, area.h);
@@ -288,6 +297,38 @@ export const wm = {
// Snapping (see "Snapping" above): zone is one of SNAP_ZONES; 'restore' goes back to the size
// and place from before the first snap (or un-maximizes).
snap: (id, zone) => { if (zone === 'restore') unsnap(id); else if (SNAP_ZONES.includes(zone)) snapTo(id, zone); },
+ // The Window menu (sdk/windowmenu.js, 0.8.5): centered in its display's work area at its own size.
+ center(id) {
+ const w = windows.get().find((x) => x.id === id);
+ if (!w) return;
+ const a = workAreaOf(displayFor(w)), r = w.snapped && w.restore ? w.restore : w;
+ const ww = Math.min(r.w, a.w), hh = Math.min(r.h, a.h);
+ patch(id, { x: Math.round(a.x + (a.w - ww) / 2), y: Math.round(a.y + (a.h - hh) / 2), w: ww, h: hh, maximized: false, snapped: null, restore: null });
+ },
+ // To another display: the same place relative to the work area (a snapped window keeps its zone, a
+ // maximized one stays maximized), its size kept inside the new area.
+ moveToDisplay(id, displayId) {
+ const w = windows.get().find((x) => x.id === id);
+ const d = screen.displays.find((x) => x.id === displayId);
+ if (!w || !d) return;
+ if (w.snapped) { snapTo(id, w.snapped, d); return; }
+ const from = workAreaOf(displayFor(w)), to = workAreaOf(d);
+ const ww = Math.min(w.w, to.w), hh = Math.min(w.h, to.h);
+ const fx = from.w > w.w ? (w.x - from.x) / (from.w - w.w) : 0, fy = from.h > w.h ? (w.y - from.y) / (from.h - w.h) : 0;
+ const clamp = (v) => Math.max(0, Math.min(1, v));
+ patch(id, { x: Math.round(to.x + clamp(fx) * (to.w - ww)), y: Math.round(to.y + clamp(fy) * (to.h - hh)), w: ww, h: hh });
+ },
+ // Several windows at once on the display of the first: 'left-right', 'right-left', 'top-bottom',
+ // 'bottom-top' (two windows) or 'quarters' (up to four).
+ arrange(ids, layout) {
+ const zones = { 'left-right': ['left', 'right'], 'right-left': ['right', 'left'], 'top-bottom': ['top', 'bottom'], 'bottom-top': ['bottom', 'top'],
+ quarters: ['top-left', 'top-right', 'bottom-left', 'bottom-right'] }[layout];
+ const first = windows.get().find((x) => x.id === ids[0]);
+ if (!zones || !first) return;
+ const d = displayFor(first);
+ ids.slice(0, zones.length).forEach((id, i) => { snapTo(id, zones[i], d); });
+ for (const id of [...ids.slice(0, zones.length)].reverse()) wm.focus(id);
+ },
// Super+arrow (dir: 'left' | 'right' | 'up' | 'down'): snap.js snapNext.
snapKey(id, dir) {
const w = windows.get().find((x) => x.id === id);
diff --git a/server/tests/snap_test.mjs b/server/tests/snap_test.mjs
index 862b478..2b3494c 100644
--- a/server/tests/snap_test.mjs
+++ b/server/tests/snap_test.mjs
@@ -48,6 +48,14 @@ eq('middle', zoneAt(640, 400, a), null);
eq('left taskbar: its own strip counts as the left edge', zoneAt(20, 400, areas[3]), 'left');
eq('second display left edge', zoneAt(1281, 500, areas[2]), 'left');
+// the top and bottom halves (the Window menu's Move & Resize, 0.8.5) share the middle line
+{
+ const t = snapRect('top', areas[0]), b = snapRect('bottom', areas[0]);
+ eq('top + bottom fill the area', t.h + b.h, areas[0].h);
+ eq('top and bottom touch', t.y + t.h, b.y);
+ eq('top and bottom never overlap', overlap(t, b), false);
+}
+
// Super+arrows
eq('free → left', snapNext(null, 'left'), 'left');
eq('free → up maximizes', snapNext(null, 'up'), 'max');
diff --git a/themes/classic/components/Window.jsx b/themes/classic/components/Window.jsx
index 0606c99..57d856c 100644
--- a/themes/classic/components/Window.jsx
+++ b/themes/classic/components/Window.jsx
@@ -7,7 +7,7 @@
// Lord Classic has no global menu bar: an app that declares menus (File, Edit, View, Go…; the same
// ones Lord Flow shows on top, useAppMenus) gets them in a strip under its title bar, with Window and
// Help, as desktop apps do on a taskbar layout. Apps without menus of their own get no strip.
-import { View, Text, Layer, addListener, wm, AppHost, windowTitle, WindowShell, windowIcon, snapZoneAt, screen, useAppMenus, getApp, appGroup, t as tr } from '@lordos/sdk';
+import { View, Text, Layer, addListener, wm, AppHost, windowTitle, WindowShell, windowIcon, snapZoneAt, screen, useAppMenus, getApp, appGroup, windowMenuItems, t as tr } from '@lordos/sdk';
import { useEffect, useRef, useState } from 'react';
import { MinimizeGlyph, MaximizeGlyph, RestoreGlyph, CloseGlyph, LayoutGlyph } from '../glyphs.jsx';
import { Menu } from './Menu.jsx';
@@ -23,12 +23,7 @@ function MenuStrip({ t, win, focused, menus }) {
const refs = useRef([]);
const all = [
...menus,
- { label: tr('shell.menu.window'), items: [
- { label: tr('shell.window.minimize'), onClick: () => wm.minimize(win.id) },
- { label: tr('shell.window.maximize'), onClick: () => wm.toggleMaximize(win.id) },
- '-',
- { label: tr('shell.window.close'), hint: 'Alt+F4', onClick: () => wm.close(win.id) },
- ] },
+ { label: tr('shell.menu.window'), items: windowMenuItems(win.id) },
{ label: tr('shell.menu.help'), items: [
...(getApp('help') ? [{ label: tr('shell.help.open'), onClick: () => wm.open('help') }, '-'] : []),
...(getApp('appabout') && appGroup(win.id) ? [{ label: tr('shell.app.about', { app: appGroup(win.id).name }), onClick: () => wm.open('appabout', { new: true, args: { key: appGroup(win.id).key, win: win.id } }) }] : []),
diff --git a/themes/default/components/MenuBar.jsx b/themes/default/components/MenuBar.jsx
index d62a5e0..e6d7b46 100644
--- a/themes/default/components/MenuBar.jsx
+++ b/themes/default/components/MenuBar.jsx
@@ -1,6 +1,6 @@
// Top menu bar: L menu, active app, Window menu, keyboard layout,
// Control Center and clock.
-import { View, Text, useClock, wm, getApp, session, useAppMenus, t as tr, appName, formatDate, formatTime, keyboard, useSettings, direction, screen, windowAppName, LordOSGlyph, spotlight, PrivacyIndicators, StatusItems, help, menuClock, appMenuItems, recentItems, storeUpdates } from '@lordos/sdk';
+import { View, Text, useClock, wm, getApp, session, useAppMenus, t as tr, appName, formatDate, formatTime, keyboard, useSettings, direction, screen, windowAppName, LordOSGlyph, spotlight, PrivacyIndicators, StatusItems, help, menuClock, appMenuItems, recentItems, storeUpdates, windowMenuItems } from '@lordos/sdk';
import { useRef, useState } from 'react';
import { Menu } from './Menu.jsx';
@@ -75,12 +75,8 @@ export function MenuBar({ t, height, focused, onLaunchpad, onControlCenter, cont
] },
// the app menu under the app's name (About, Settings…, Hide, Quit; sdk/appcontrol.js)
app: { items: app ? appMenuItems(focused) : [{ label: tr('shell.menu.about'), onClick: () => wm.open('about') }] },
- window: { items: [
- { label: tr('shell.window.minimize'), disabled: !app, onClick: () => wm.minimize(focused) },
- { label: tr('shell.window.maximize'), disabled: !app, onClick: () => wm.toggleMaximize(focused) },
- '-',
- { label: tr('shell.window.close'), disabled: !app, onClick: () => wm.close(focused) },
- ] },
+ // Minimize, Zoom, Fill, Center, Move & Resize, Move to <display>, the open windows (sdk/windowmenu.js)
+ window: { items: windowMenuItems(app ? focused : null) },
help: { items: [
...(getApp('help') ? [{ label: tr('shell.help.open'), onClick: () => wm.open('help') }, { label: tr('shell.help.tour'), onClick: () => help.startTour() }, '-'] : []),
{ label: tr('shell.menu.about'), onClick: () => wm.open('about') },