Files
mxandClaude Opus 5.5 e4ca1f5d9c Add notch opacity and colour; open plugin panels from the notch strip
- Settings → Notch → Look: opacity (0% glass to 100% solid) and colour
  for the notch, the open notch and the notch-mode launcher.
- Bar popouts and plugin panels add the open notch's screen offset, so
  tooltips and panels from the strip land under their module.
- Opening a plugin panel keeps the notch open; the notch hands keyboard
  focus to the panel and takes it back when it closes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 17:18:58 +01:00

45 lines
1.8 KiB
QML

pragma Singleton
import QtQuick
import Quickshell
import "AppMatching.js" as Matching
Singleton {
id: root
readonly property var entries: DesktopEntries.applications.values
readonly property var launchable: entries.filter(e => !e.noDisplay).slice().sort((a, b) => a.name.localeCompare(b.name))
property string error: ""
function byId(id) {
return entries.find(e => Matching.canonical(e.id) === Matching.canonical(id)) || null;
}
function icon(entry) {
return entry && entry.icon ? Quickshell.iconPath(entry.icon, true) : "";
}
function launch(entry, action) {
if (!entry) {
error = "This desktop entry is no longer installed.";
return false;
}
let command = action ? action.command : entry.command;
if (entry.runInTerminal) {
const terminal = ConfigService.data.dock.terminalCommand;
if (!terminal.length) {
error = "Set dock.terminalCommand to a terminal command argument array before launching terminal applications.";
return false;
}
command = terminal.concat(command);
}
Quickshell.execDetached({
command: scoped(command),
workingDirectory: entry.workingDirectory
});
error = "";
return true;
}
// Run the app in its own transient systemd scope. Launched directly, it would
// join the shell's cgroup and be killed whenever the shell service restarts.
// Falls back to a plain launch where systemd-run is unavailable.
function scoped(command) {
return ["sh", "-c", 'if command -v systemd-run >/dev/null 2>&1; then exec systemd-run --user --scope --collect --quiet -- "$@"; fi; exec "$@"', "sh"].concat(command);
}
}