mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-13 09:12:08 -04:00
displays: support for multiple output profiles
- add support for deleting unplugged configs - Option to hide disconnected displays fixes #1453
This commit is contained in:
@@ -519,6 +519,10 @@ Singleton {
|
||||
property var showOnLastDisplay: ({})
|
||||
property var niriOutputSettings: ({})
|
||||
property var hyprlandOutputSettings: ({})
|
||||
property var displayProfiles: ({})
|
||||
property var activeDisplayProfile: ({})
|
||||
property bool displayProfileAutoSelect: false
|
||||
property bool displayShowDisconnected: false
|
||||
|
||||
property var barConfigs: [
|
||||
{
|
||||
@@ -2256,6 +2260,39 @@ Singleton {
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
function getDisplayProfiles(compositor) {
|
||||
return displayProfiles[compositor] || {};
|
||||
}
|
||||
|
||||
function setDisplayProfile(compositor, profileId, data) {
|
||||
const updated = JSON.parse(JSON.stringify(displayProfiles));
|
||||
if (!updated[compositor])
|
||||
updated[compositor] = {};
|
||||
updated[compositor][profileId] = data;
|
||||
displayProfiles = updated;
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
function removeDisplayProfile(compositor, profileId) {
|
||||
if (!displayProfiles[compositor] || !displayProfiles[compositor][profileId])
|
||||
return;
|
||||
const updated = JSON.parse(JSON.stringify(displayProfiles));
|
||||
delete updated[compositor][profileId];
|
||||
displayProfiles = updated;
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
function getActiveDisplayProfile(compositor) {
|
||||
return activeDisplayProfile[compositor] || "";
|
||||
}
|
||||
|
||||
function setActiveDisplayProfile(compositor, profileId) {
|
||||
const updated = JSON.parse(JSON.stringify(activeDisplayProfile));
|
||||
updated[compositor] = profileId;
|
||||
activeDisplayProfile = updated;
|
||||
saveSettings();
|
||||
}
|
||||
|
||||
ListModel {
|
||||
id: leftWidgetsModel
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user