mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-15 02:02:08 -04:00
hypr: add disable output option
This commit is contained in:
@@ -205,6 +205,27 @@ Singleton {
|
|||||||
const result = {};
|
const result = {};
|
||||||
const lines = content.split("\n");
|
const lines = content.split("\n");
|
||||||
for (const line of lines) {
|
for (const line of lines) {
|
||||||
|
const disableMatch = line.match(/^\s*monitor\s*=\s*([^,]+),\s*disable\s*$/);
|
||||||
|
if (disableMatch) {
|
||||||
|
const name = disableMatch[1].trim();
|
||||||
|
result[name] = {
|
||||||
|
"name": name,
|
||||||
|
"logical": {
|
||||||
|
"x": 0,
|
||||||
|
"y": 0,
|
||||||
|
"scale": 1.0,
|
||||||
|
"transform": "Normal"
|
||||||
|
},
|
||||||
|
"modes": [],
|
||||||
|
"current_mode": -1,
|
||||||
|
"vrr_enabled": false,
|
||||||
|
"vrr_supported": false,
|
||||||
|
"hyprlandSettings": {
|
||||||
|
"disabled": true
|
||||||
|
}
|
||||||
|
};
|
||||||
|
continue;
|
||||||
|
}
|
||||||
const match = line.match(/^\s*monitor\s*=\s*([^,]+),\s*(\d+)x(\d+)@([\d.]+),\s*(-?\d+)x(-?\d+),\s*([\d.]+)/);
|
const match = line.match(/^\s*monitor\s*=\s*([^,]+),\s*(\d+)x(\d+)@([\d.]+),\s*(-?\d+)x(-?\d+),\s*([\d.]+)/);
|
||||||
if (!match)
|
if (!match)
|
||||||
continue;
|
continue;
|
||||||
@@ -842,6 +863,8 @@ Singleton {
|
|||||||
|
|
||||||
for (const outputId in pendingHyprlandChanges) {
|
for (const outputId in pendingHyprlandChanges) {
|
||||||
const changes = pendingHyprlandChanges[outputId];
|
const changes = pendingHyprlandChanges[outputId];
|
||||||
|
if (changes.disabled !== undefined)
|
||||||
|
changeDescriptions.push(outputId + ": " + I18n.tr("Disabled") + " → " + (changes.disabled ? I18n.tr("Yes") : I18n.tr("No")));
|
||||||
if (changes.bitdepth !== undefined)
|
if (changes.bitdepth !== undefined)
|
||||||
changeDescriptions.push(outputId + ": " + I18n.tr("Bit Depth") + " → " + changes.bitdepth);
|
changeDescriptions.push(outputId + ": " + I18n.tr("Bit Depth") + " → " + changes.bitdepth);
|
||||||
if (changes.colorManagement !== undefined)
|
if (changes.colorManagement !== undefined)
|
||||||
|
|||||||
@@ -71,6 +71,13 @@ Column {
|
|||||||
}
|
}
|
||||||
property bool isHdrMode: currentCm === "hdr" || currentCm === "hdredid"
|
property bool isHdrMode: currentCm === "hdr" || currentCm === "hdredid"
|
||||||
|
|
||||||
|
DankToggle {
|
||||||
|
width: parent.width
|
||||||
|
text: I18n.tr("Disable Output")
|
||||||
|
checked: DisplayConfigState.getHyprlandSetting(root.outputData, root.outputName, "disabled", false)
|
||||||
|
onToggled: checked => DisplayConfigState.setHyprlandSetting(root.outputData, root.outputName, "disabled", checked)
|
||||||
|
}
|
||||||
|
|
||||||
DankDropdown {
|
DankDropdown {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
text: I18n.tr("Mirror Display")
|
text: I18n.tr("Mirror Display")
|
||||||
|
|||||||
@@ -35,6 +35,11 @@ Singleton {
|
|||||||
const identifier = getOutputIdentifier(output, outputName);
|
const identifier = getOutputIdentifier(output, outputName);
|
||||||
const outputSettings = settings[identifier] || {};
|
const outputSettings = settings[identifier] || {};
|
||||||
|
|
||||||
|
if (outputSettings.disabled) {
|
||||||
|
lines.push("monitor = " + identifier + ", disable");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
let resolution = "preferred";
|
let resolution = "preferred";
|
||||||
if (output.modes && output.current_mode !== undefined) {
|
if (output.modes && output.current_mode !== undefined) {
|
||||||
const mode = output.modes[output.current_mode];
|
const mode = output.modes[output.current_mode];
|
||||||
@@ -73,10 +78,7 @@ Singleton {
|
|||||||
|
|
||||||
lines.push(monitorLine);
|
lines.push(monitorLine);
|
||||||
|
|
||||||
const needsMonitorv2 = outputSettings.supportsHdr || outputSettings.supportsWideColor ||
|
const needsMonitorv2 = outputSettings.supportsHdr || outputSettings.supportsWideColor || outputSettings.sdrMinLuminance !== undefined || outputSettings.sdrMaxLuminance !== undefined || outputSettings.minLuminance !== undefined || outputSettings.maxLuminance !== undefined || outputSettings.maxAvgLuminance !== undefined;
|
||||||
outputSettings.sdrMinLuminance !== undefined || outputSettings.sdrMaxLuminance !== undefined ||
|
|
||||||
outputSettings.minLuminance !== undefined || outputSettings.maxLuminance !== undefined ||
|
|
||||||
outputSettings.maxAvgLuminance !== undefined;
|
|
||||||
|
|
||||||
if (needsMonitorv2) {
|
if (needsMonitorv2) {
|
||||||
let block = "monitorv2 {\n";
|
let block = "monitorv2 {\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user