forked from Shinonome/dots-hyprland
replace wlsunset with gammastep
wlsunset doesn't work w/o manually passing the latitude and longitude. gammastep can retrieve geolocation from geoclue so it works out of the box for everyone.
This commit is contained in:
@@ -78,7 +78,7 @@ export const HyprToggleIcon = async (icon, name, hyprlandConfigValue, props = {}
|
||||
}
|
||||
}
|
||||
|
||||
export const ModuleNightLight = (props = {}) => Widget.Button({ // TODO: Make this work
|
||||
export const ModuleNightLight = (props = {}) => Widget.Button({
|
||||
attribute: {
|
||||
enabled: false,
|
||||
},
|
||||
@@ -87,13 +87,13 @@ export const ModuleNightLight = (props = {}) => Widget.Button({ // TODO: Make th
|
||||
onClicked: (self) => {
|
||||
self.attribute.enabled = !self.attribute.enabled;
|
||||
self.toggleClassName('sidebar-button-active', self.attribute.enabled);
|
||||
if (self.attribute.enabled) Utils.execAsync(['wlsunset', '-t', '4500']).catch(print)
|
||||
else Utils.execAsync('pkill wlsunset').catch(print);
|
||||
if (self.attribute.enabled) Utils.execAsync('gammastep').catch(print)
|
||||
else Utils.execAsync('pkill gammastep').catch(print);
|
||||
},
|
||||
child: MaterialIcon('nightlight', 'norm'),
|
||||
setup: (self) => {
|
||||
setupCursorHover(self);
|
||||
self.attribute.enabled = !!exec('pidof wlsunset');
|
||||
self.attribute.enabled = !!exec('pidof gammastep');
|
||||
self.toggleClassName('sidebar-button-active', self.attribute.enabled);
|
||||
},
|
||||
...props,
|
||||
@@ -235,6 +235,3 @@ export const ModulePowerIcon = (props = {}) => Widget.Button({
|
||||
setupCursorHover(button);
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user