-
Notifications
You must be signed in to change notification settings - Fork 471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add hueshift block & updated list of blocks #802
Conversation
* Scrolling up or down updates the screen temperature by a "step" amount (max_step 2000K). * Supports either sct or redshift to change screen color temperature. * Redshift is preferred as it as a much larger range of temperature color changes (between 1000K and 25_000K). * Currently for testing purpose only redshift is supported.
* Check command with has_command from util.rs * Redshift stdout/stderr redirected to /dev/null * New JSON error appears when the block is scrolled
You forgot to update the documentation to include your block and its configuration options |
* Update documentation with parameters and block description * Added checks in code (whether using sct, redshift)
Does your output still look like this when scrolling?
As a sanity check can you change your scroll commands to "echo test" and see what the output looks like? |
Yeah it still does look like that when scrolling down.
When I scroll up a 4 get printed, when I scroll down a 5 shows up, finally when I click onto the block a 1 shows up and the JSON error shows up as well. |
I will also add that a 3 is printed when I right-click on it and a 2 is printed when I use the |
I've got even more interesting now, even without the new block the JSON error appears with the numbers as well in the debug. So i3 seems to be somewhat interfering with the i3status-rs JSON output I suppose, how that is happening is a little beyond me to be honest but the link is that scrolling does two actions on the bottom status bar. |
What's the bare minimum config you can reproduce this with? |
This is the bare minimum config I can reproduce this with : [[block]]
block = "hueshift" Or with any other config that doesn't have this block either, it happens even if I choose another block than the custom one I've made. |
OK I can reproduce the numbers in the output, however they are only logged to stderr so it shouldn't have an affect on i3/swaybar. When using tee command from before it was redirecting stderr to stdout which explains why it was causing those JSON errors. I think the stderr output was added by accident in fe517af. I'm thinking about added a |
I can confirm that without the debug the sliding works with no errors on the bottom status bar. Seems the redirection of the stderr in stdout was indeed the culprit. |
* Add redshift -P flag to reset existing gamma ramps before applying new color effect.
The block is done and it's documentation is too, I did not test however changing the temperature when setting the hue_shifter to My issue came from a custom block I had made to change my color temperature every time the i3bar updated the command with the default 6500K would change back conflicting with the new |
* Fix a "bug" if max_temp and min_temp are a range in which current_temp is not. * Fix a conditional mistake about ensuring that min_temp gets ensured to not go under 1000K. * Fix step enforcing of a "discrete" step limit. * Move assignement of new_temp outside of match to avoid writing two assignements in each matched members.
* Details some more the documentation of the block * Add right click to reset hue color temperature to default (6500K)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great otherwise, thanks for this block, it's super useful for me!
A bug I found while using it throughout the day: Seems like left click anywhere in the bar (for example, pausing/unpausing music) triggers the left click action on the hueshift block |
* Match the blog by its id when an event is triggered * Left click changed to now switch to set color temperature in click_temp variable (default to 6500K)
Thanks for the help to fix the bug, I believe that the block is now fully ready, if you wish to test it some more and provide some feedback however I think there won't be any issues anymore. |
LGTM and looks like you already have a happy user in @omertuc I checked some other status bars and apart from geolocation/GPS (which I don't think should be handled by us), it looks like we are feature complete. Thanks! |
Also, I'm thinking of opening another PR or continuing this one if possible? To improve the The current implementation does not work under Wayland (which I was going to transition to), even if Redshift has a specific package which works well under Wayland provided you use the However, I'm thinking that to be broader, I should try to include more Wayland compatible hue shifting programs to the |
Thanks for this widget. It recognizes the |
I might be wrong, but AFAIK there is no way to query current temperature from
Can you describe current behavior and expected behavior?
Covered in #1465 |
I believe I agree that it would be a good improvement for the block to display the current temperature, as set by redshift itself outside of the status bar. |
Good to know! I did some initial work in 34e2b45, PRs implementing temperature updates for concrete back-ends are welcome. |
amount (max_step 2000K).
color changes (between 1000K and 25_000K).
I'm open to any feedback or suggestion.
I'm a fairly new to Rust and willing to learn if there is anything I can make a little nicer, just say so.
Also I've used u16 because the temperature of the color should never be negative nor go over 65535 since the highest limit I've seen is 25 000K that Redshift can set.
I'm also planning to add a MouseButton event later perhaps to toogle between different values instantly by clicking on the text.
But first I have to find out what's going on with the JSON error #801 I'm getting from i3bar.