mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-30 00:12:50 -05:00
Compare commits
2 Commits
5ae2cd1dfb
...
af0166a553
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af0166a553 | ||
|
|
a283017f26 |
@@ -599,6 +599,39 @@ Item {
|
||||
return barConfig.autoHide ? "BAR_MANUAL_HIDE_SUCCESS" : "BAR_AUTO_HIDE_SUCCESS";
|
||||
}
|
||||
|
||||
function getPosition(selector: string, value: string): string {
|
||||
const {
|
||||
barConfig,
|
||||
error
|
||||
} = getBarConfig(selector, value);
|
||||
if (error)
|
||||
return error;
|
||||
const positions = ["top", "bottom", "left", "right"];
|
||||
return positions[barConfig.position] || "unknown";
|
||||
}
|
||||
|
||||
function setPosition(selector: string, value: string, position: string): string {
|
||||
const {
|
||||
barConfig,
|
||||
error
|
||||
} = getBarConfig(selector, value);
|
||||
if (error)
|
||||
return error;
|
||||
const positionMap = {
|
||||
"top": SettingsData.Position.Top,
|
||||
"bottom": SettingsData.Position.Bottom,
|
||||
"left": SettingsData.Position.Left,
|
||||
"right": SettingsData.Position.Right
|
||||
};
|
||||
const posValue = positionMap[position.toLowerCase()];
|
||||
if (posValue === undefined)
|
||||
return "BAR_INVALID_POSITION";
|
||||
SettingsData.updateBarConfig(barConfig.id, {
|
||||
position: posValue
|
||||
});
|
||||
return "BAR_POSITION_SET_SUCCESS";
|
||||
}
|
||||
|
||||
target: "bar"
|
||||
}
|
||||
|
||||
|
||||
@@ -510,6 +510,16 @@ Singleton {
|
||||
objects: Pipewire.nodes.values.filter(node => node.audio && !node.isStream)
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: Pipewire
|
||||
function onDefaultAudioSinkChanged() {
|
||||
if (soundsAvailable) {
|
||||
Qt.callLater(root.destroySoundPlayers);
|
||||
Qt.callLater(root.createSoundPlayers);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setVolume(percentage) {
|
||||
if (!root.sink?.audio) {
|
||||
return "No audio sink available";
|
||||
|
||||
Reference in New Issue
Block a user