mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-05 23:09:26 -05:00
disable night light button until gammastep fully terminated
This commit is contained in:
@@ -88,7 +88,19 @@ export const ModuleNightLight = (props = {}) => Widget.Button({
|
||||
self.attribute.enabled = !self.attribute.enabled;
|
||||
self.toggleClassName('sidebar-button-active', self.attribute.enabled);
|
||||
if (self.attribute.enabled) Utils.execAsync('gammastep').catch(print)
|
||||
else Utils.execAsync('pkill gammastep').catch(print);
|
||||
else Utils.execAsync('pkill gammastep')
|
||||
.then(() => {
|
||||
// disable the button until fully terminated to avoid race
|
||||
self.sensitive = false;
|
||||
const source = setInterval(() => {
|
||||
Utils.execAsync('pkill -0 gammastep')
|
||||
.catch(() => {
|
||||
self.sensitive = true;
|
||||
source.destroy();
|
||||
});
|
||||
}, 500);
|
||||
})
|
||||
.catch(print);
|
||||
},
|
||||
child: MaterialIcon('nightlight', 'norm'),
|
||||
setup: (self) => {
|
||||
|
||||
Reference in New Issue
Block a user