1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-06 13:38:28 -04:00

hyprland: fix named workspaces hiding from widget

fixes #2047
This commit is contained in:
bbedward
2026-07-02 22:48:41 -04:00
parent 6cdb891551
commit 31efe9b385
8 changed files with 365 additions and 194 deletions
+2
View File
@@ -177,10 +177,12 @@ Singleton {
property int niriLayoutRadiusOverride: -1 property int niriLayoutRadiusOverride: -1
property int niriLayoutBorderSize: -1 property int niriLayoutBorderSize: -1
property int hyprlandLayoutGapsOverride: -1 property int hyprlandLayoutGapsOverride: -1
property int hyprlandLayoutGapsOutOverride: -1
property int hyprlandLayoutRadiusOverride: -1 property int hyprlandLayoutRadiusOverride: -1
property int hyprlandLayoutBorderSize: -1 property int hyprlandLayoutBorderSize: -1
property bool hyprlandResizeOnBorder: false property bool hyprlandResizeOnBorder: false
property int mangoLayoutGapsOverride: -1 property int mangoLayoutGapsOverride: -1
property int mangoLayoutGapsOutOverride: -1
property int mangoLayoutRadiusOverride: -1 property int mangoLayoutRadiusOverride: -1
property int mangoLayoutBorderSize: -1 property int mangoLayoutBorderSize: -1
property bool mangoTrackpadNaturalScrolling: true property bool mangoTrackpadNaturalScrolling: true
@@ -29,10 +29,12 @@ var SPEC = {
niriLayoutRadiusOverride: { def: -1, onChange: "updateCompositorLayout" }, niriLayoutRadiusOverride: { def: -1, onChange: "updateCompositorLayout" },
niriLayoutBorderSize: { def: -1, onChange: "updateCompositorLayout" }, niriLayoutBorderSize: { def: -1, onChange: "updateCompositorLayout" },
hyprlandLayoutGapsOverride: { def: -1, onChange: "updateCompositorLayout" }, hyprlandLayoutGapsOverride: { def: -1, onChange: "updateCompositorLayout" },
hyprlandLayoutGapsOutOverride: { def: -1, onChange: "updateCompositorLayout" },
hyprlandLayoutRadiusOverride: { def: -1, onChange: "updateCompositorLayout" }, hyprlandLayoutRadiusOverride: { def: -1, onChange: "updateCompositorLayout" },
hyprlandLayoutBorderSize: { def: -1, onChange: "updateCompositorLayout" }, hyprlandLayoutBorderSize: { def: -1, onChange: "updateCompositorLayout" },
hyprlandResizeOnBorder: { def: false, onChange: "updateCompositorLayout" }, hyprlandResizeOnBorder: { def: false, onChange: "updateCompositorLayout" },
mangoLayoutGapsOverride: { def: -1, onChange: "updateCompositorLayout" }, mangoLayoutGapsOverride: { def: -1, onChange: "updateCompositorLayout" },
mangoLayoutGapsOutOverride: { def: -1, onChange: "updateCompositorLayout" },
mangoLayoutRadiusOverride: { def: -1, onChange: "updateCompositorLayout" }, mangoLayoutRadiusOverride: { def: -1, onChange: "updateCompositorLayout" },
mangoLayoutBorderSize: { def: -1, onChange: "updateCompositorLayout" }, mangoLayoutBorderSize: { def: -1, onChange: "updateCompositorLayout" },
mangoTrackpadNaturalScrolling: { def: true, onChange: "updateCompositorCursor" }, mangoTrackpadNaturalScrolling: { def: true, onChange: "updateCompositorCursor" },
@@ -205,6 +205,21 @@ Item {
return focusedWs ? focusedWs.num : 1; return focusedWs ? focusedWs.num : 1;
} }
// Numbered workspaces first in id order, named (negative id) after, by name
function hyprlandWorkspaceOrder(a, b) {
const keyA = a.id < 0 ? Number.MAX_SAFE_INTEGER : a.id;
const keyB = b.id < 0 ? Number.MAX_SAFE_INTEGER : b.id;
if (keyA !== keyB)
return keyA - keyB;
return (a.name ?? "").localeCompare(b.name ?? "");
}
function hyprlandWorkspaceSelector(ws) {
if (!ws)
return 1;
return ws.id > 0 ? ws.id : "name:" + (ws.name ?? "");
}
function getHyprlandWorkspaces() { function getHyprlandWorkspaces() {
const workspaces = Hyprland.workspaces?.values || []; const workspaces = Hyprland.workspaces?.values || [];
if (workspaces.length === 0) { if (workspaces.length === 0) {
@@ -216,7 +231,14 @@ Item {
]; ];
} }
let filtered = workspaces.filter(ws => ws.id > -1); // Hyprland gives named workspaces negative ids (from -1337 down); special
// workspaces always store a "special:" name prefix ("special" pre-colon era)
let filtered = workspaces.filter(ws => {
if (ws.id > 0)
return true;
const name = ws.name ?? "";
return name !== "special" && !name.startsWith("special:");
});
if (filtered.length === 0) { if (filtered.length === 0) {
return [ return [
{ {
@@ -227,10 +249,10 @@ Item {
} }
if (!root.screenName || SettingsData.workspaceFollowFocus) { if (!root.screenName || SettingsData.workspaceFollowFocus) {
filtered = filtered.slice().sort((a, b) => a.id - b.id); filtered = filtered.slice().sort(hyprlandWorkspaceOrder);
} else { } else {
const monitorWorkspaces = filtered.filter(ws => ws.monitor?.name === root.screenName); const monitorWorkspaces = filtered.filter(ws => ws.monitor?.name === root.screenName);
filtered = monitorWorkspaces.length > 0 ? monitorWorkspaces.sort((a, b) => a.id - b.id) : [ filtered = monitorWorkspaces.length > 0 ? monitorWorkspaces.sort(hyprlandWorkspaceOrder) : [
{ {
id: 1, id: 1,
name: "1" name: "1"
@@ -586,7 +608,7 @@ Item {
break; break;
case "hyprland": case "hyprland":
if (data.id) { if (data.id) {
HyprlandService.focusWorkspace(data.id); HyprlandService.focusWorkspace(hyprlandWorkspaceSelector(data));
} }
break; break;
case "mango": case "mango":
@@ -676,7 +698,7 @@ Item {
return; return;
} }
HyprlandService.focusWorkspace(realWorkspaces[nextIndex].id); HyprlandService.focusWorkspace(hyprlandWorkspaceSelector(realWorkspaces[nextIndex]));
} else if (root.isMango) { } else if (root.isMango) {
const realWorkspaces = getRealWorkspaces(); const realWorkspaces = getRealWorkspaces();
if (realWorkspaces.length < 2) { if (realWorkspaces.length < 2) {
@@ -718,7 +740,7 @@ Item {
if (CompositorService.isNiri) if (CompositorService.isNiri)
return (modelData?.idx !== undefined && modelData?.idx !== -1) ? modelData.idx : ""; return (modelData?.idx !== undefined && modelData?.idx !== -1) ? modelData.idx : "";
if (CompositorService.isHyprland) if (CompositorService.isHyprland)
return modelData?.id || ""; return modelData?.id > 0 ? modelData.id : (modelData?.name ?? "");
if (root.isMango) if (root.isMango)
return (modelData?.tag !== undefined) ? (modelData.tag + 1) : ""; return (modelData?.tag !== undefined) ? (modelData.tag + 1) : "";
if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle)
@@ -1362,7 +1384,7 @@ Item {
NiriService.switchToWorkspace(modelData.id); NiriService.switchToWorkspace(modelData.id);
} }
} else if (CompositorService.isHyprland && modelData?.id) { } else if (CompositorService.isHyprland && modelData?.id) {
HyprlandService.focusWorkspace(modelData.id); HyprlandService.focusWorkspace(root.hyprlandWorkspaceSelector(modelData));
} else if (root.isMango && modelData?.tag !== undefined) { } else if (root.isMango && modelData?.tag !== undefined) {
MangoService.switchToTag(root.screenName, modelData.tag); MangoService.switchToTag(root.screenName, modelData.tag);
} else if ((CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) && modelData?.num) { } else if ((CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) && modelData?.num) {
@@ -275,19 +275,30 @@ awk '$1 == "xray" { print FILENAME ":" FNR; exit }' $files 2>/dev/null`;
iconName: "layers" iconName: "layers"
visible: CompositorService.isNiri visible: CompositorService.isNiri
SettingsToggleRow { SettingsButtonGroupRow {
tags: ["niri", "gaps", "override"] tags: ["niri", "gaps", "override", "unmanaged"]
settingKey: "niriLayoutGapsOverrideEnabled" settingKey: "niriLayoutGapsMode"
text: I18n.tr("Override Gaps") text: I18n.tr("Gaps")
description: I18n.tr("Use custom gaps instead of bar spacing") description: I18n.tr("Auto matches bar spacing; Off leaves gaps to your niri config")
checked: SettingsData.niriLayoutGapsOverride >= 0 model: [I18n.tr("Auto"), I18n.tr("Custom"), I18n.tr("Off")]
onToggled: checked => { currentIndex: {
if (checked) { if (SettingsData.niriLayoutGapsOverride === -2)
const currentGaps = Math.max(4, (SettingsData.barConfigs[0]?.spacing ?? 4)); return 2;
SettingsData.set("niriLayoutGapsOverride", currentGaps); return SettingsData.niriLayoutGapsOverride >= 0 ? 1 : 0;
}
onSelectionChanged: (index, selected) => {
if (!selected)
return; return;
switch (index) {
case 1:
SettingsData.set("niriLayoutGapsOverride", Math.max(4, (SettingsData.barConfigs[0]?.spacing ?? 4)));
return;
case 2:
SettingsData.set("niriLayoutGapsOverride", -2);
return;
default:
SettingsData.set("niriLayoutGapsOverride", -1);
} }
SettingsData.set("niriLayoutGapsOverride", -1);
} }
} }
@@ -393,27 +404,38 @@ awk '$1 == "xray" { print FILENAME ":" FNR; exit }' $files 2>/dev/null`;
iconName: "crop_square" iconName: "crop_square"
visible: CompositorService.isHyprland visible: CompositorService.isHyprland
SettingsToggleRow { SettingsButtonGroupRow {
tags: ["hyprland", "gaps", "override"] tags: ["hyprland", "gaps", "override", "inner", "outer", "unmanaged"]
settingKey: "hyprlandLayoutGapsOverrideEnabled" settingKey: "hyprlandLayoutGapsMode"
text: I18n.tr("Override Gaps") text: I18n.tr("Gaps")
description: I18n.tr("Use custom gaps instead of bar spacing") description: I18n.tr("Auto matches bar spacing; Off leaves gaps to your Hyprland config")
checked: SettingsData.hyprlandLayoutGapsOverride >= 0 model: [I18n.tr("Auto"), I18n.tr("Custom"), I18n.tr("Off")]
onToggled: checked => { currentIndex: {
if (checked) { if (SettingsData.hyprlandLayoutGapsOverride === -2)
const currentGaps = Math.max(4, (SettingsData.barConfigs[0]?.spacing ?? 4)); return 2;
SettingsData.set("hyprlandLayoutGapsOverride", currentGaps); return SettingsData.hyprlandLayoutGapsOverride >= 0 ? 1 : 0;
}
onSelectionChanged: (index, selected) => {
if (!selected)
return; return;
switch (index) {
case 1:
SettingsData.set("hyprlandLayoutGapsOverride", Math.max(4, (SettingsData.barConfigs[0]?.spacing ?? 4)));
return;
case 2:
SettingsData.set("hyprlandLayoutGapsOverride", -2);
return;
default:
SettingsData.set("hyprlandLayoutGapsOverride", -1);
} }
SettingsData.set("hyprlandLayoutGapsOverride", -1);
} }
} }
SettingsSliderRow { SettingsSliderRow {
tags: ["hyprland", "gaps", "override"] tags: ["hyprland", "gaps", "override", "inner"]
settingKey: "hyprlandLayoutGapsOverride" settingKey: "hyprlandLayoutGapsOverride"
text: I18n.tr("Window Gaps") text: I18n.tr("Inner Gaps")
description: I18n.tr("Space between windows") + " (gaps_in/gaps_out)" description: I18n.tr("Space between windows") + " (gaps_in)"
visible: SettingsData.hyprlandLayoutGapsOverride >= 0 visible: SettingsData.hyprlandLayoutGapsOverride >= 0
value: Math.max(0, SettingsData.hyprlandLayoutGapsOverride) value: Math.max(0, SettingsData.hyprlandLayoutGapsOverride)
minimum: 0 minimum: 0
@@ -423,6 +445,20 @@ awk '$1 == "xray" { print FILENAME ":" FNR; exit }' $files 2>/dev/null`;
onSliderValueChanged: newValue => SettingsData.set("hyprlandLayoutGapsOverride", newValue) onSliderValueChanged: newValue => SettingsData.set("hyprlandLayoutGapsOverride", newValue)
} }
SettingsSliderRow {
tags: ["hyprland", "gaps", "override", "outer", "edge"]
settingKey: "hyprlandLayoutGapsOutOverride"
text: I18n.tr("Outer Gaps")
description: I18n.tr("Space between windows and screen edges") + " (gaps_out)"
visible: SettingsData.hyprlandLayoutGapsOverride >= 0
value: SettingsData.hyprlandLayoutGapsOutOverride >= 0 ? SettingsData.hyprlandLayoutGapsOutOverride : Math.max(0, SettingsData.hyprlandLayoutGapsOverride)
minimum: 0
maximum: 50
unit: "px"
defaultValue: Math.max(0, SettingsData.hyprlandLayoutGapsOverride)
onSliderValueChanged: newValue => SettingsData.set("hyprlandLayoutGapsOutOverride", newValue)
}
SettingsToggleRow { SettingsToggleRow {
tags: ["hyprland", "radius", "override", "rounding"] tags: ["hyprland", "radius", "override", "rounding"]
settingKey: "hyprlandLayoutRadiusOverrideEnabled" settingKey: "hyprlandLayoutRadiusOverrideEnabled"
@@ -520,27 +556,38 @@ awk '$1 == "xray" { print FILENAME ":" FNR; exit }' $files 2>/dev/null`;
iconName: "crop_square" iconName: "crop_square"
visible: CompositorService.isMango visible: CompositorService.isMango
SettingsToggleRow { SettingsButtonGroupRow {
tags: ["mangowc", "mango", "gaps", "override"] tags: ["mangowc", "mango", "gaps", "override", "inner", "outer", "unmanaged"]
settingKey: "mangoLayoutGapsOverrideEnabled" settingKey: "mangoLayoutGapsMode"
text: I18n.tr("Override Gaps") text: I18n.tr("Gaps")
description: I18n.tr("Use custom gaps instead of bar spacing") description: I18n.tr("Auto matches bar spacing; Off leaves gaps to your MangoWC config")
checked: SettingsData.mangoLayoutGapsOverride >= 0 model: [I18n.tr("Auto"), I18n.tr("Custom"), I18n.tr("Off")]
onToggled: checked => { currentIndex: {
if (checked) { if (SettingsData.mangoLayoutGapsOverride === -2)
const currentGaps = Math.max(4, (SettingsData.barConfigs[0]?.spacing ?? 4)); return 2;
SettingsData.set("mangoLayoutGapsOverride", currentGaps); return SettingsData.mangoLayoutGapsOverride >= 0 ? 1 : 0;
}
onSelectionChanged: (index, selected) => {
if (!selected)
return; return;
switch (index) {
case 1:
SettingsData.set("mangoLayoutGapsOverride", Math.max(4, (SettingsData.barConfigs[0]?.spacing ?? 4)));
return;
case 2:
SettingsData.set("mangoLayoutGapsOverride", -2);
return;
default:
SettingsData.set("mangoLayoutGapsOverride", -1);
} }
SettingsData.set("mangoLayoutGapsOverride", -1);
} }
} }
SettingsSliderRow { SettingsSliderRow {
tags: ["mangowc", "mango", "gaps", "override"] tags: ["mangowc", "mango", "gaps", "override", "inner"]
settingKey: "mangoLayoutGapsOverride" settingKey: "mangoLayoutGapsOverride"
text: I18n.tr("Window Gaps") text: I18n.tr("Inner Gaps")
description: I18n.tr("Space between windows") + " (gappih/gappiv/gappoh/gappov)" description: I18n.tr("Space between windows") + " (gappih/gappiv)"
visible: SettingsData.mangoLayoutGapsOverride >= 0 visible: SettingsData.mangoLayoutGapsOverride >= 0
value: Math.max(0, SettingsData.mangoLayoutGapsOverride) value: Math.max(0, SettingsData.mangoLayoutGapsOverride)
minimum: 0 minimum: 0
@@ -550,6 +597,20 @@ awk '$1 == "xray" { print FILENAME ":" FNR; exit }' $files 2>/dev/null`;
onSliderValueChanged: newValue => SettingsData.set("mangoLayoutGapsOverride", newValue) onSliderValueChanged: newValue => SettingsData.set("mangoLayoutGapsOverride", newValue)
} }
SettingsSliderRow {
tags: ["mangowc", "mango", "gaps", "override", "outer", "edge"]
settingKey: "mangoLayoutGapsOutOverride"
text: I18n.tr("Outer Gaps")
description: I18n.tr("Space between windows and screen edges") + " (gappoh/gappov)"
visible: SettingsData.mangoLayoutGapsOverride >= 0
value: SettingsData.mangoLayoutGapsOutOverride >= 0 ? SettingsData.mangoLayoutGapsOutOverride : Math.max(0, SettingsData.mangoLayoutGapsOverride)
minimum: 0
maximum: 50
unit: "px"
defaultValue: Math.max(0, SettingsData.mangoLayoutGapsOverride)
onSliderValueChanged: newValue => SettingsData.set("mangoLayoutGapsOutOverride", newValue)
}
SettingsToggleRow { SettingsToggleRow {
tags: ["mangowc", "mango", "radius", "override"] tags: ["mangowc", "mango", "radius", "override"]
settingKey: "mangoLayoutRadiusOverrideEnabled" settingKey: "mangoLayoutRadiusOverrideEnabled"
+10 -5
View File
@@ -332,7 +332,10 @@ Singleton {
const defaultBorderSize = 2; const defaultBorderSize = 2;
const cornerRadius = (typeof SettingsData !== "undefined" && SettingsData.hyprlandLayoutRadiusOverride >= 0) ? SettingsData.hyprlandLayoutRadiusOverride : defaultRadius; const cornerRadius = (typeof SettingsData !== "undefined" && SettingsData.hyprlandLayoutRadiusOverride >= 0) ? SettingsData.hyprlandLayoutRadiusOverride : defaultRadius;
const gaps = (typeof SettingsData !== "undefined" && SettingsData.hyprlandLayoutGapsOverride >= 0) ? SettingsData.hyprlandLayoutGapsOverride : defaultGaps; const gapsOverride = typeof SettingsData !== "undefined" ? SettingsData.hyprlandLayoutGapsOverride : -1;
const manageGaps = gapsOverride !== -2;
const gapsIn = gapsOverride >= 0 ? gapsOverride : defaultGaps;
const gapsOut = (gapsOverride >= 0 && SettingsData.hyprlandLayoutGapsOutOverride >= 0) ? SettingsData.hyprlandLayoutGapsOutOverride : gapsIn;
const borderSize = (typeof SettingsData !== "undefined" && SettingsData.hyprlandLayoutBorderSize >= 0) ? SettingsData.hyprlandLayoutBorderSize : defaultBorderSize; const borderSize = (typeof SettingsData !== "undefined" && SettingsData.hyprlandLayoutBorderSize >= 0) ? SettingsData.hyprlandLayoutBorderSize : defaultBorderSize;
const resizeOnBorder = (typeof SettingsData !== "undefined" && SettingsData.hyprlandResizeOnBorder) ? true : false; const resizeOnBorder = (typeof SettingsData !== "undefined" && SettingsData.hyprlandResizeOnBorder) ? true : false;
const frameEnabled = typeof SettingsData !== "undefined" && SettingsData.frameEnabled; const frameEnabled = typeof SettingsData !== "undefined" && SettingsData.frameEnabled;
@@ -341,14 +344,16 @@ Singleton {
// Connected frame mode has no separate bar/frame surface to target // Connected frame mode has no separate bar/frame surface to target
const barFrameTargetNamespace = !frameEnabled ? (SettingsData.standaloneBarXrayAvailable ? "dms:bar" : null) : (frameConnectedMode ? null : "dms:frame"); const barFrameTargetNamespace = !frameEnabled ? (SettingsData.standaloneBarXrayAvailable ? "dms:bar" : null) : (frameConnectedMode ? null : "dms:frame");
const generalLines = [];
if (manageGaps)
generalLines.push(`gaps_in = ${gapsIn},`, `gaps_out = ${gapsOut},`);
generalLines.push(`border_size = ${borderSize},`, `resize_on_border = ${resizeOnBorder},`);
let content = `-- Auto-generated by DMS do not edit manually let content = `-- Auto-generated by DMS do not edit manually
hl.config({ hl.config({
general = { general = {
gaps_in = ${gaps}, ${generalLines.map(l => "\t\t" + l).join("\n")}
gaps_out = ${gaps},
border_size = ${borderSize},
resize_on_border = ${resizeOnBorder},
}, },
decoration = { decoration = {
rounding = ${cornerRadius}, rounding = ${cornerRadius},
+11 -5
View File
@@ -589,16 +589,22 @@ Singleton {
const defaultBorderSize = 2; const defaultBorderSize = 2;
const cornerRadius = (typeof SettingsData !== "undefined" && SettingsData.mangoLayoutRadiusOverride >= 0) ? SettingsData.mangoLayoutRadiusOverride : defaultRadius; const cornerRadius = (typeof SettingsData !== "undefined" && SettingsData.mangoLayoutRadiusOverride >= 0) ? SettingsData.mangoLayoutRadiusOverride : defaultRadius;
const gaps = (typeof SettingsData !== "undefined" && SettingsData.mangoLayoutGapsOverride >= 0) ? SettingsData.mangoLayoutGapsOverride : defaultGaps; const gapsOverride = typeof SettingsData !== "undefined" ? SettingsData.mangoLayoutGapsOverride : -1;
const manageGaps = gapsOverride !== -2;
const gapsIn = gapsOverride >= 0 ? gapsOverride : defaultGaps;
const gapsOut = (gapsOverride >= 0 && SettingsData.mangoLayoutGapsOutOverride >= 0) ? SettingsData.mangoLayoutGapsOutOverride : gapsIn;
const borderSize = (typeof SettingsData !== "undefined" && SettingsData.mangoLayoutBorderSize >= 0) ? SettingsData.mangoLayoutBorderSize : defaultBorderSize; const borderSize = (typeof SettingsData !== "undefined" && SettingsData.mangoLayoutBorderSize >= 0) ? SettingsData.mangoLayoutBorderSize : defaultBorderSize;
let content = `# Auto-generated by DMS - do not edit manually let content = `# Auto-generated by DMS - do not edit manually
border_radius=${cornerRadius} border_radius=${cornerRadius}
gappih=${gaps}
gappiv=${gaps}
gappoh=${gaps}
gappov=${gaps}
borderpx=${borderSize} borderpx=${borderSize}
`;
if (manageGaps)
content += `gappih=${gapsIn}
gappiv=${gapsIn}
gappoh=${gapsOut}
gappov=${gapsOut}
`; `;
Proc.runCommand("mango-write-layout", ["sh", "-c", `mkdir -p "${mangoDmsDir}" && cat > "${layoutPath}" << 'EOF'\n${content}EOF`], (output, exitCode) => { Proc.runCommand("mango-write-layout", ["sh", "-c", `mkdir -p "${mangoDmsDir}" && cat > "${layoutPath}" << 'EOF'\n${content}EOF`], (output, exitCode) => {
+9 -10
View File
@@ -1164,7 +1164,9 @@ Singleton {
const defaultBorderSize = 2; const defaultBorderSize = 2;
const cornerRadius = (typeof SettingsData !== "undefined" && SettingsData.niriLayoutRadiusOverride >= 0) ? SettingsData.niriLayoutRadiusOverride : defaultRadius; const cornerRadius = (typeof SettingsData !== "undefined" && SettingsData.niriLayoutRadiusOverride >= 0) ? SettingsData.niriLayoutRadiusOverride : defaultRadius;
const gaps = (typeof SettingsData !== "undefined" && SettingsData.niriLayoutGapsOverride >= 0) ? SettingsData.niriLayoutGapsOverride : defaultGaps; const gapsOverride = typeof SettingsData !== "undefined" ? SettingsData.niriLayoutGapsOverride : -1;
const manageGaps = gapsOverride !== -2;
const gaps = gapsOverride >= 0 ? gapsOverride : defaultGaps;
const borderSize = (typeof SettingsData !== "undefined" && SettingsData.niriLayoutBorderSize >= 0) ? SettingsData.niriLayoutBorderSize : defaultBorderSize; const borderSize = (typeof SettingsData !== "undefined" && SettingsData.niriLayoutBorderSize >= 0) ? SettingsData.niriLayoutBorderSize : defaultBorderSize;
const frameEnabled = typeof SettingsData !== "undefined" && SettingsData.frameEnabled; const frameEnabled = typeof SettingsData !== "undefined" && SettingsData.frameEnabled;
const frameConnectedMode = frameEnabled && SettingsData.frameMode === "connected"; const frameConnectedMode = frameEnabled && SettingsData.frameMode === "connected";
@@ -1206,16 +1208,13 @@ layer-rule {
`; `;
const layoutLines = [];
if (manageGaps)
layoutLines.push(` gaps ${gaps}`, "");
layoutLines.push(" border {", ` width ${borderSize}`, " }", "", " focus-ring {", ` width ${borderSize}`, " }");
const configContent = dmsWarning + `layout { const configContent = dmsWarning + `layout {
gaps ${gaps} ${layoutLines.join("\n")}
border {
width ${borderSize}
}
focus-ring {
width ${borderSize}
}
} }
window-rule { window-rule {
+202 -128
View File
@@ -8701,6 +8701,101 @@
"description": "Always blur against the wallpaper, even with Xray off", "description": "Always blur against the wallpaper, even with Xray off",
"conditionKey": "isNiri" "conditionKey": "isNiri"
}, },
{
"section": "hyprlandLayoutGapsMode",
"label": "Gaps",
"tabIndex": 37,
"category": "Personalization",
"keywords": [
"appearance",
"auto",
"config",
"custom",
"customize",
"gap",
"gaps",
"hyprland",
"inner",
"leaves",
"margin",
"margins",
"matches",
"outer",
"override",
"padding",
"panel",
"personal",
"personalization",
"statusbar",
"taskbar",
"topbar",
"unmanaged"
],
"description": "Auto matches bar spacing; Off leaves gaps to your Hyprland config"
},
{
"section": "mangoLayoutGapsMode",
"label": "Gaps",
"tabIndex": 37,
"category": "Personalization",
"keywords": [
"appearance",
"auto",
"config",
"custom",
"customize",
"gap",
"gaps",
"inner",
"leaves",
"mango",
"mangowc",
"margin",
"margins",
"matches",
"outer",
"override",
"padding",
"panel",
"personal",
"personalization",
"statusbar",
"taskbar",
"topbar",
"unmanaged"
],
"description": "Auto matches bar spacing; Off leaves gaps to your MangoWC config"
},
{
"section": "niriLayoutGapsMode",
"label": "Gaps",
"tabIndex": 37,
"category": "Personalization",
"keywords": [
"appearance",
"auto",
"config",
"custom",
"customize",
"gap",
"gaps",
"leaves",
"margin",
"margins",
"matches",
"niri",
"override",
"padding",
"panel",
"personal",
"personalization",
"statusbar",
"taskbar",
"topbar",
"unmanaged"
],
"description": "Auto matches bar spacing; Off leaves gaps to your niri config"
},
{ {
"section": "hyprlandLayout", "section": "hyprlandLayout",
"label": "Hyprland Layout Overrides", "label": "Hyprland Layout Overrides",
@@ -8708,15 +8803,19 @@
"category": "Personalization", "category": "Personalization",
"keywords": [ "keywords": [
"appearance", "appearance",
"auto",
"border", "border",
"config",
"custom", "custom",
"customize", "customize",
"gap", "gap",
"gaps", "gaps",
"hyprland", "hyprland",
"layout", "layout",
"leaves",
"margin", "margin",
"margins", "margins",
"matches",
"overrides", "overrides",
"padding", "padding",
"panel", "panel",
@@ -8724,16 +8823,58 @@
"personalization", "personalization",
"radius", "radius",
"rounding", "rounding",
"spacing",
"statusbar", "statusbar",
"taskbar", "taskbar",
"topbar", "topbar",
"window" "window"
], ],
"icon": "crop_square", "icon": "crop_square",
"description": "Use custom gaps instead of bar spacing", "description": "Auto matches bar spacing; Off leaves gaps to your Hyprland config",
"conditionKey": "isHyprland" "conditionKey": "isHyprland"
}, },
{
"section": "hyprlandLayoutGapsOverride",
"label": "Inner Gaps",
"tabIndex": 37,
"category": "Personalization",
"keywords": [
"appearance",
"between",
"custom",
"customize",
"gaps",
"hyprland",
"inner",
"override",
"personal",
"personalization",
"space",
"windows"
],
"description": "Space between windows"
},
{
"section": "mangoLayoutGapsOverride",
"label": "Inner Gaps",
"tabIndex": 37,
"category": "Personalization",
"keywords": [
"appearance",
"between",
"custom",
"customize",
"gaps",
"inner",
"mango",
"mangowc",
"override",
"personal",
"personalization",
"space",
"windows"
],
"description": "Space between windows"
},
{ {
"section": "mangoLayout", "section": "mangoLayout",
"label": "MangoWC Layout Overrides", "label": "MangoWC Layout Overrides",
@@ -8741,31 +8882,34 @@
"category": "Personalization", "category": "Personalization",
"keywords": [ "keywords": [
"appearance", "appearance",
"auto",
"border", "border",
"config",
"custom", "custom",
"customize", "customize",
"dwl", "dwl",
"gap", "gap",
"gaps", "gaps",
"layout", "layout",
"leaves",
"mango", "mango",
"mangowc", "mangowc",
"margin", "margin",
"margins", "margins",
"matches",
"overrides", "overrides",
"padding", "padding",
"panel", "panel",
"personal", "personal",
"personalization", "personalization",
"radius", "radius",
"spacing",
"statusbar", "statusbar",
"taskbar", "taskbar",
"topbar", "topbar",
"window" "window"
], ],
"icon": "crop_square", "icon": "crop_square",
"description": "Use custom gaps instead of bar spacing", "description": "Auto matches bar spacing; Off leaves gaps to your MangoWC config",
"conditionKey": "isMango" "conditionKey": "isMango"
}, },
{ {
@@ -8775,14 +8919,18 @@
"category": "Personalization", "category": "Personalization",
"keywords": [ "keywords": [
"appearance", "appearance",
"auto",
"border", "border",
"config",
"custom", "custom",
"customize", "customize",
"gap", "gap",
"gaps", "gaps",
"layout", "layout",
"leaves",
"margin", "margin",
"margins", "margins",
"matches",
"niri", "niri",
"overrides", "overrides",
"padding", "padding",
@@ -8790,16 +8938,64 @@
"personal", "personal",
"personalization", "personalization",
"radius", "radius",
"spacing",
"statusbar", "statusbar",
"taskbar", "taskbar",
"topbar", "topbar",
"window" "window"
], ],
"icon": "layers", "icon": "layers",
"description": "Use custom gaps instead of bar spacing", "description": "Auto matches bar spacing; Off leaves gaps to your niri config",
"conditionKey": "isNiri" "conditionKey": "isNiri"
}, },
{
"section": "hyprlandLayoutGapsOutOverride",
"label": "Outer Gaps",
"tabIndex": 37,
"category": "Personalization",
"keywords": [
"appearance",
"between",
"custom",
"customize",
"edge",
"edges",
"gaps",
"hyprland",
"outer",
"override",
"personal",
"personalization",
"screen",
"space",
"windows"
],
"description": "Space between windows and screen edges"
},
{
"section": "mangoLayoutGapsOutOverride",
"label": "Outer Gaps",
"tabIndex": 37,
"category": "Personalization",
"keywords": [
"appearance",
"between",
"custom",
"customize",
"edge",
"edges",
"gaps",
"mango",
"mangowc",
"outer",
"override",
"personal",
"personalization",
"screen",
"space",
"windows"
],
"description": "Space between windows and screen edges"
},
{ {
"section": "hyprlandLayoutBorderSizeEnabled", "section": "hyprlandLayoutBorderSizeEnabled",
"label": "Override Border Size", "label": "Override Border Size",
@@ -8941,85 +9137,6 @@
], ],
"description": "Use custom window radius instead of theme radius" "description": "Use custom window radius instead of theme radius"
}, },
{
"section": "hyprlandLayoutGapsOverrideEnabled",
"label": "Override Gaps",
"tabIndex": 37,
"category": "Personalization",
"keywords": [
"appearance",
"custom",
"customize",
"gap",
"gaps",
"hyprland",
"margin",
"margins",
"override",
"padding",
"panel",
"personal",
"personalization",
"spacing",
"statusbar",
"taskbar",
"topbar"
],
"description": "Use custom gaps instead of bar spacing"
},
{
"section": "mangoLayoutGapsOverrideEnabled",
"label": "Override Gaps",
"tabIndex": 37,
"category": "Personalization",
"keywords": [
"appearance",
"custom",
"customize",
"gap",
"gaps",
"mango",
"mangowc",
"margin",
"margins",
"override",
"padding",
"panel",
"personal",
"personalization",
"spacing",
"statusbar",
"taskbar",
"topbar"
],
"description": "Use custom gaps instead of bar spacing"
},
{
"section": "niriLayoutGapsOverrideEnabled",
"label": "Override Gaps",
"tabIndex": 37,
"category": "Personalization",
"keywords": [
"appearance",
"custom",
"customize",
"gap",
"gaps",
"margin",
"margins",
"niri",
"override",
"padding",
"panel",
"personal",
"personalization",
"spacing",
"statusbar",
"taskbar",
"topbar"
],
"description": "Use custom gaps instead of bar spacing"
},
{ {
"section": "hyprlandResizeOnBorder", "section": "hyprlandResizeOnBorder",
"label": "Resize on Border", "label": "Resize on Border",
@@ -9114,49 +9231,6 @@
], ],
"description": "Rounded corners for windows" "description": "Rounded corners for windows"
}, },
{
"section": "hyprlandLayoutGapsOverride",
"label": "Window Gaps",
"tabIndex": 37,
"category": "Personalization",
"keywords": [
"appearance",
"between",
"custom",
"customize",
"gaps",
"hyprland",
"override",
"personal",
"personalization",
"space",
"window",
"windows"
],
"description": "Space between windows"
},
{
"section": "mangoLayoutGapsOverride",
"label": "Window Gaps",
"tabIndex": 37,
"category": "Personalization",
"keywords": [
"appearance",
"between",
"custom",
"customize",
"gaps",
"mango",
"mangowc",
"override",
"personal",
"personalization",
"space",
"window",
"windows"
],
"description": "Space between windows"
},
{ {
"section": "niriLayoutGapsOverride", "section": "niriLayoutGapsOverride",
"label": "Window Gaps", "label": "Window Gaps",