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.

Menu bar: show a Linux app's short name instead of its window title

Federico Pereira6f4b9e7f0a30
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d8e61c8..a71c98f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -20,6 +20,14 @@ of the matching [GitHub release](https://github.com/lordbasex/LordOS/releases),
drop-in shipped by the `lordos` package). The Raspberry Pi image's `ssh` switch file keeps
working and shows up as on ([docs/REMOTE.md](docs/REMOTE.md#remote-login-ssh)).
+### Fixed
+
+- **The menu bar names a Linux app, not its window.** Next to the crown it showed the window title
+ (for a browser, the whole page title); it now shows the app's short
+ name, "Chromium", in every language. The Dock tooltip and Linux app notifications use the same
+ short name; a real translation of the name (e.g. "Archivos") still shows, and a window without a
+ `.desktop` file is named after its app id. The window's own title bar keeps the title.
+
## [0.8.0-beta] - 2026-10-18
LordOS is a free GNU/Linux distribution based on Debian 13 ("trixie") with its own desktop
diff --git a/sdk/apps.js b/sdk/apps.js
index ce73749..ad4f9b8 100644
--- a/sdk/apps.js
+++ b/sdk/apps.js
@@ -107,6 +107,44 @@ export function linuxAppFor(appId) {
a.desktopId.toLowerCase().endsWith(`.${want}`)) || null;
}
+// Short label of a Linux app, for the shell (menu bar, Dock, notifications). If the (translated)
+// Name contains, as whole words, the untranslated Name or the app's id, only those words:
+// "Navegador web Chromium" and "Chromium Web Browser" (chromium.desktop) → "Chromium". Otherwise
+// the translated Name as is, so a real translation ("Archivos") still shows.
+export function shortAppName(app) {
+ if (!app) return '';
+ const name = String(app.name || app.nameC || '');
+ const id = String(app.desktopId || '');
+ // a reverse-DNS id ("org.gnome.TextEditor") is named by its last part; "python3.13" is not one
+ const idName = /^[a-z]{2,}\.[^.]+\./i.test(id) ? id.slice(id.lastIndexOf('.') + 1) : id;
+ for (const c of [app.nameC, idName, app.wmClass]) {
+ const want = String(c || '').trim();
+ if (want.length < 3 || !/\p{L}/u.test(want) || want.toLowerCase() === name.toLowerCase()) continue;
+ const pat = want.replace(/[.*+?^${}()|[\]\\]/g, '\\$&').replace(/[-_\s]+/g, '[-_\\s]+');
+ const m = new RegExp(`(?:^|[^\\p{L}\\p{N}])(${pat})(?=$|[^\\p{L}\\p{N}])`, 'iu').exec(name);
+ if (m) return m[1];
+ }
+ return name;
+}
+
+// A Wayland app_id as a label when no .desktop matches: "org.example.Foo" → "Foo", "foot" → "Foot".
+function prettyAppId(appId) {
+ const last = String(appId || '').split('.').filter(Boolean).pop() || '';
+ const s = last.replace(/[-_]+/g, ' ').trim();
+ return s ? s[0].toUpperCase() + s.slice(1) : '';
+}
+
+// The app name of a window, never its title: a LordOS app's name; for a Linux window, the isolated
+// app's package name, its .desktop's short name or its app_id.
+export function windowAppName(w) {
+ if (!w) return '';
+ if (!String(w.id).startsWith('linux#')) return appName(registryApp(w.id));
+ const appId = w.args?.appId || '';
+ const pkg = appId ? registryApp(appId) : null;
+ if (pkg && (pkg.package || pkg.isolated)) return pkg.isolated ? appName(pkg) : pkg.name;
+ return shortAppName(linuxAppFor(appId)) || prettyAppId(appId) || appName(registryApp('linux'));
+}
+
// Icon of a window: its app's; for a Linux window, its .desktop's if one is found.
export function windowIcon(w, getApp) {
const appId = w?.args?.appId;
diff --git a/sdk/dock.js b/sdk/dock.js
index 8cfba90..bf1a309 100644
--- a/sdk/dock.js
+++ b/sdk/dock.js
@@ -23,7 +23,7 @@ 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 { useLauncherApps, launchApp, linuxAppFor, LetterIcon, windowIcon } from './apps.js';
+import { useLauncherApps, launchApp, linuxAppFor, shortAppName, windowAppName, LetterIcon, windowIcon } from './apps.js';
import { t, locale } from './i18n.js';
import * as fs from './fs.js';
import {
@@ -183,7 +183,7 @@ export function useDockEntries(defaults = [], opts = {}) {
}
const entry = (id, a, ws) => ({
id, kind: parseDockId(id)?.kind || 'linux', launcherId: launcherKey(id),
- name: a?.name || windowTitle(ws[0]) || id, Icon: a?.Icon || (ws[0] ? windowIcon(ws[0], getApp) : ({ size }) => h(LetterIcon, { size, name: id })),
+ name: (a?.kind === 'linux' ? shortAppName(a) : a?.name) || (ws[0] ? windowAppName(ws[0]) : '') || id, Icon: a?.Icon || (ws[0] ? windowIcon(ws[0], getApp) : ({ size }) => h(LetterIcon, { size, name: id })),
windows: ws, pinned: pinned.includes(id), running: ws.length > 0, focused: ws.some((w) => w.id === focused), app: a,
locked: isLocked(id), movable: isMovable(id),
});
diff --git a/sdk/hardware.jsx b/sdk/hardware.jsx
index c2082c4..63be037 100644
--- a/sdk/hardware.jsx
+++ b/sdk/hardware.jsx
@@ -19,7 +19,7 @@ import { settings } from './settings.js';
import { useTheme } from './theme.js';
import { t, formatDate, formatTime, weekdayName } from './i18n.js';
import { notify, dismissNotification } from './notify.js';
-import { linuxAppFor } from './apps.js';
+import { linuxAppFor, shortAppName } from './apps.js';
import { admin } from './admin.js';
import { registerStatusItem } from './statusitems.js';
import { TextInput } from './components.jsx';
@@ -339,7 +339,7 @@ function linuxNotify(n) {
if (prev) dismissNotification(prev, 'replaced');
const reason = { closed: 2, expired: 1, action: 2, replaced: 0, remote: 0 };
const id = notify({
- app: key, label: app?.name || n.app, icon: app?.Icon || null, title: n.title, body: n.body, sticky: n.urgency === 2,
+ app: key, label: shortAppName(app) || n.app, icon: app?.Icon || null, title: n.title, body: n.body, sticky: n.urgency === 2,
timeout: n.timeout > 0 ? n.timeout : 6000,
actions: (n.actions || []).filter(([k]) => k !== 'default').map(([k, label]) => ({ id: k, label, run: () => lord.notifyd.action(n.id, k) })),
onClose: (why) => { if (fromLinux.get(n.id) === id) fromLinux.delete(n.id); if (reason[why]) lord.notifyd.closed(n.id, reason[why]); },
diff --git a/sdk/index.js b/sdk/index.js
index da97d93..ebb398d 100644
--- a/sdk/index.js
+++ b/sdk/index.js
@@ -14,7 +14,7 @@ export { keyboard } from './keyboard.js';
export { trackpad, useTrackpads, hasTouchpad, registerGestureActions, lastSwipe, TRACKPAD_DEFAULTS, trackpadConfig, setTrackpad } from './trackpad.js';
export { ime, useIme } from './ime.js';
export { wayland } from './wayland.js';
-export { useLauncherApps, launchApp, refreshApps, isLinuxApp, linuxAppFor, LetterIcon, iconFromFile, APP_CATEGORIES, appCategory } from './apps.js';
+export { useLauncherApps, launchApp, refreshApps, isLinuxApp, linuxAppFor, shortAppName, windowAppName, LetterIcon, iconFromFile, APP_CATEGORIES, appCategory } from './apps.js';
import { windowIcon as windowIconOf } from './apps.js';
import { ImeOverlay } from './ime.js';
import { ClipboardPanel, ClipboardToast, clipboard as clipboardApi } from './clipboard.js';
diff --git a/themes/default/components/MenuBar.jsx b/themes/default/components/MenuBar.jsx
index b225391..91f91c0 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, windowTitle, LordOSGlyph, spotlight, PrivacyIndicators, StatusItems, help, menuClock } 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 } from '@lordos/sdk';
import { useRef, useState } from 'react';
import { Menu } from './Menu.jsx';
@@ -88,7 +88,7 @@ export function MenuBar({ t, height, focused, onLaunchpad, onControlCenter, cont
<BarItem t={t} active={open?.name === 'logo'} anchorRef={refs.logo} onClick={() => toggle('logo', refs.logo)}>
<LordOSGlyph size={16} color={t.menuText} />
</BarItem>
- <BarItem t={t}><Label t={t} bold>{app ? (app.builtin ? windowTitle(wm.get(focused)) : appName(app)) : 'LordOS'}</Label></BarItem>
+ <BarItem t={t}><Label t={t} bold>{app ? (app.builtin ? windowAppName(wm.get(focused)) : appName(app)) : 'LordOS'}</Label></BarItem>
{extra.map((m, i) => {
const key = `app${i}`;
const ref = { get current() { return appRefs.current[key]; } };