mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-05 03:52:07 -04:00
feat(display): Fix and implement display auto-switching with JSON profile storage (#2275)
* feat(display): fix monitor auto config and add output disable guard * feat(display): fixed some race conditions and sole display getting disabled. Co-authored-by: Copilot <copilot@github.com> * feat(display): changes console log to use new log service * feat(display): fix trailing spaces * prek run * add migration, fix missing hyprland HDR parameters, use FileView > python --------- Co-authored-by: Copilot <copilot@github.com> Co-authored-by: bbedward <bbedward@gmail.com>
This commit is contained in:
@@ -1622,13 +1622,15 @@ Item {
|
||||
|
||||
for (const id in profiles) {
|
||||
const p = profiles[id];
|
||||
if (!p.name)
|
||||
continue;
|
||||
const flags = [];
|
||||
if (id === activeId)
|
||||
flags.push("active");
|
||||
if (id === matchedId)
|
||||
flags.push("matched");
|
||||
const flagStr = flags.length > 0 ? " [" + flags.join(",") + "]" : "";
|
||||
lines.push(p.name + flagStr + " -> " + JSON.stringify(p.outputSet));
|
||||
lines.push(p.name + flagStr + " -> " + JSON.stringify(Object.keys(p.outputs)));
|
||||
}
|
||||
|
||||
if (lines.length === 0)
|
||||
@@ -1660,13 +1662,16 @@ Item {
|
||||
return `PROFILE_SET_SUCCESS: ${profileName}`;
|
||||
}
|
||||
|
||||
// ! TODO - auto profile switching is buggy on niri and other compositors
|
||||
function toggleAuto(): string {
|
||||
return "ERROR: Auto profile selection is temporarily disabled due to compositor bugs";
|
||||
SettingsData.displayProfileAutoSelect = !SettingsData.displayProfileAutoSelect;
|
||||
SettingsData.saveSettings();
|
||||
if (SettingsData.displayProfileAutoSelect)
|
||||
DisplayConfigState.applyAutoConfig();
|
||||
return `Auto profile selection: ${SettingsData.displayProfileAutoSelect ? "enabled" : "disabled"}`;
|
||||
}
|
||||
|
||||
function status(): string {
|
||||
const auto = "off"; // disabled for now
|
||||
const auto = SettingsData.displayProfileAutoSelect ? "on" : "off";
|
||||
const activeId = SettingsData.getActiveDisplayProfile(CompositorService.compositor);
|
||||
const matchedId = DisplayConfigState.matchedProfile;
|
||||
const profiles = DisplayConfigState.validatedProfiles;
|
||||
|
||||
Reference in New Issue
Block a user