forked from Shinonome/dots-hyprland
structured my code better
This commit is contained in:
@@ -63,6 +63,7 @@ export default (monitor = 0) => {
|
|||||||
progress.value = updateValue;
|
progress.value = updateValue;
|
||||||
}, 'notify::screen-value'),
|
}, 'notify::screen-value'),
|
||||||
});
|
});
|
||||||
|
|
||||||
const volumeIndicator = OsdValue({
|
const volumeIndicator = OsdValue({
|
||||||
name: 'Volume',
|
name: 'Volume',
|
||||||
extraClassName: 'osd-volume',
|
extraClassName: 'osd-volume',
|
||||||
@@ -87,15 +88,13 @@ 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;
|
||||||
const newDevice = (Audio.speaker?.name);
|
const newDevice = (Audio.speaker?.name);
|
||||||
// print(newDevice, device);
|
|
||||||
if (!isNaN(updateValue)) {
|
if (!isNaN(updateValue)) {
|
||||||
if ((volumeIndicator.attribute.device === undefined || newDevice === volumeIndicator.attribute.device)
|
if (newDevice === volumeIndicator.attribute.device && updateValue !== progress.value) {
|
||||||
&& updateValue !== progress.value) {
|
Indicator.popup(1);
|
||||||
Indicator.popup(1);
|
}
|
||||||
}
|
|
||||||
volumeIndicator.attribute.device = newDevice;
|
|
||||||
progress.value = updateValue;
|
progress.value = updateValue;
|
||||||
}
|
}
|
||||||
|
volumeIndicator.attribute.device = newDevice;
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
return MarginRevealer({
|
return MarginRevealer({
|
||||||
|
|||||||
Reference in New Issue
Block a user