Add Hyprsunset for Blue Light Filtering / Nightlight#447
Conversation
… toggle blue light filtering
|
I would like the tooltip for the waybar widget to show the state (like with an |
|
Going to try this one out because i had issues with a custom implementation i did with hyprsunset. If it works it's a good thing to have. |
|
in auto enabling time, geo location, i use sunsetr. It uses hyprsunset and automatically enables if in your location is sunset and disables if sunrise |
|
This is a nice implementation, but I don't think it's worth a default spot in the icon toolbar. You don't actually need the indication that it's on, imo. So I think we're better off doing this like we did toggle-idle. It's on a hotkey and we tell you status using notify-send. Let's give that a try instead of using the icon. |
|
@dhh ok, I will work on that. Could I at least leave the waybar module in there, but commented out? I feel that many people will want control over this in that spot, similar to a phone's quick settings or the Gnome Desktop. |
|
I think better to document how to add this in the Manual section of discussions. |
|
@dhh this should be good to go unless the migration needs to do something to the |
|
@JaxonWright thanks for this. removing my failed hyprsunset install xd |
* install hyprsunset when installing other hypr packages * add hyprsunset to autostart * add default hyprsunset config to make it do nothing by default * waybar: add hyprsunset shortcut next to bluetooth shortcut to quickly toggle blue light filtering * waybar: fix icon switching for hyprsunset widget * add migration for hyprsunset * waybar: rename "Blue Light Filter" to "Nightlight" * waybar: make nightlight module appear next to bluetooth module * waybar: do not include nightlight module by default * add omarchy-toggle-nightlight script * add default keybinding for toggling hyprsunset nightlight (SUPER + CTRL + N) * waybar: remove nightlight module from config entirely * waybar: remove nightlight from css * update hyprsunset migration to skip yay install if already installed * omarchy-toggle-nightlight: use `omarchy-restart-waybar` script instead of pkill with -SIG * omarchy-toggle-nightlight: only restart waybar if nightlight is in the waybar config --------- Co-authored-by: David Heinemeier Hansson <david@hey.com>
Description
A blue light filter is useful when using a computer at night / in the dark so you experience less eye fatigue.
hyprsunsetis an official hyprland plugin that adds this functionality.#81 attempted to add this, but DHH rejected it due to
hyprsunsetsetting a slight amount of filtering by default when it runs. I figured out how to make it not do that by default. It just needed a config file.Keyboard Shortcut
This PR adds a default keybind for toggling nightlight. The keybind is SUPER+CTRL+N (for "Nightlight"). This will trigger a notification telling you the state, but your eyes should also be able to tell.
Notifications
Optional Waybar Toggle
This was originally in the PR, but DHH wanted me to remove it. If you want a simple toggle for hyprsunset in waybar, add the following to the
config.jsoncfor waybar:In
"modules_right":"custom/nightlight",Somewhere in the top-level, like above
"network":I also recommend adding
#custom-nightlightto the CSS that adds left and right margin to#trayand a bunch of other items. This keeps the spacing consistent.Off:

On:

I made this use a 4000K color temperature when enabled. If this is too much or too little, let me know. You can play around with the value by changing the 4000 value in the
"custom/nightlight"section of the Waybarconfig.jsoncThe keyboard shortcut mentioned above triggers in a way that updates this waybar module with the state.
Auto-Enabling By Time?
You can add profiles to trigger at specific times, but I find that essentially useless. What I have not figured out is a way to make it turn on/off automatically at sunset and sunrise based on your location and time of year. If anyone figures that out, please contribute or comment!
Migration
The migration does the following:
hyprsunsetviayayhyprsunset.confinto thehyprconfig folderhyprsunsetUseful Links