Closed cafetestrest closed 1 year ago
wlsunset
, or any other binary you want to use/monitor, I recommend you have a look at modules/brightness.js
Essentially it is a wrapper over said binary, so that you can control its state. Instead of running wlsunset
in your other script make a Service like in brightness.js and then do
# in your script which I assume is a shell script
ags run-js "ags.Service.Nightlight.yourWrapperFunction()"
or you can make that other script inside an ags module
I see you are using the Settings Service for this variable but that service is for the settings dialog and It would more sense to have that in nightlight.js as a Service. You can also look at modules/asusctl.js
for reference
also just a side note
// you don't need to run these with bash
if (Settings.nightlight) {
execAsync("wlsunset -t 3500 -S 06:00 -s 06:01")
} else {
execAsync("killall -9 wlsunset")
}
There is no right click menu yet. Or if you mean like an onClick
on icon then no, but you have onSecondaryClick
on buttons
I've implemented a nightlight (using wlsunset) toggle in the quick settings. On/Off toggling is working fine. I have 2 problems with my implementation:
What is expected behavior: The icon is representing exact state of night-light and by clicking of the toggle I can choose to either enable/disable the night-light effect on the screen - hard switch.
This is my nightlight.js file: https://github.com/cafetestrest/dotfiles/blob/develop/.config/ags/modules/nightlight.js
PS: Is there a right-click command of the icon?