forked from Shinonome/dots-hyprland
Audio popups also showing up if the volume changes e.g. by keys (#557)
This commit is contained in:
@@ -59,6 +59,7 @@ export default (monitor = 0) => {
|
|||||||
}, 'notify::screen-value'),
|
}, 'notify::screen-value'),
|
||||||
progressSetup: (self) => self.hook(Brightness[monitor], (progress) => {
|
progressSetup: (self) => self.hook(Brightness[monitor], (progress) => {
|
||||||
const updateValue = Brightness[monitor].screen_value;
|
const updateValue = Brightness[monitor].screen_value;
|
||||||
|
if (updateValue !== progress.value) Indicator.popup(1);
|
||||||
progress.value = updateValue;
|
progress.value = updateValue;
|
||||||
}, 'notify::screen-value'),
|
}, 'notify::screen-value'),
|
||||||
});
|
});
|
||||||
@@ -67,7 +68,7 @@ export default (monitor = 0) => {
|
|||||||
name: 'Volume',
|
name: 'Volume',
|
||||||
extraClassName: 'osd-volume',
|
extraClassName: 'osd-volume',
|
||||||
extraProgressClassName: 'osd-volume-progress',
|
extraProgressClassName: 'osd-volume-progress',
|
||||||
attribute: { headphones: undefined },
|
attribute: { headphones: undefined , device: undefined},
|
||||||
nameSetup: (self) => Utils.timeout(1, () => {
|
nameSetup: (self) => Utils.timeout(1, () => {
|
||||||
const updateAudioDevice = (self) => {
|
const updateAudioDevice = (self) => {
|
||||||
const usingHeadphones = (Audio.speaker?.stream?.port)?.toLowerCase().includes('headphone');
|
const usingHeadphones = (Audio.speaker?.stream?.port)?.toLowerCase().includes('headphone');
|
||||||
@@ -86,7 +87,14 @@ export default (monitor = 0) => {
|
|||||||
}),
|
}),
|
||||||
progressSetup: (self) => self.hook(Audio, (progress) => {
|
progressSetup: (self) => self.hook(Audio, (progress) => {
|
||||||
const updateValue = Audio.speaker?.volume;
|
const updateValue = Audio.speaker?.volume;
|
||||||
if (!isNaN(updateValue)) progress.value = updateValue;
|
const newDevice = (Audio.speaker?.name);
|
||||||
|
if (!isNaN(updateValue)) {
|
||||||
|
if (newDevice === volumeIndicator.attribute.device && updateValue !== progress.value) {
|
||||||
|
Indicator.popup(1);
|
||||||
|
}
|
||||||
|
progress.value = updateValue;
|
||||||
|
}
|
||||||
|
volumeIndicator.attribute.device = newDevice;
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
return MarginRevealer({
|
return MarginRevealer({
|
||||||
|
|||||||
Reference in New Issue
Block a user