-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
[Req] Command to query the current temperature value #3
Comments
what |
Command to query the current temperature value so we can store it as a state. By that, we can use it to output it to, e.g. waybar. |
but it's just whatever you configured hyprsunset to? why not keep track of it yourself? |
Yes, that would be an option. If one creates a script for it, they could write it to a file or a FIFO upon committing the temperature with Sorry for my ignorance, but aren't there options to query the temperature value of the current running daemon? The approach mentioned might lose track of the temperature. It's not a big deal, but this would be more optimal—hopefully without overcomplicating the logic of hyprsunset. If that’s the case, I’ll just consider the option above. I have another concern: to avoid multiple instances of hyprsunset, is the best way to do it by using This will be helpful in creating a knob/slider GUI. |
yes. hyprsunse for now has no ipc |
Can you not just make |
Heres a quick workaround for waybar, bluelighttoggle.sh#!/bin/sh
# Check if hyprsunset is running using pgrep
pid=$(pgrep -x hyprsunset)
if [ -z "$pid" ]; then
# If not running, start hyprsunset with the specified temperature
hyprsunset -t 5700 &
echo "hyprsunset started with temperature 5700"
else
# If running, kill hyprsunset
kill "$pid"
echo "hyprsunset stopped"
fi bluelightinfo.sh#!/bin/sh
# Check if hyprsunset is running
pid=$(pgrep -x hyprsunset)
# Set temperature based on whether hyprsunset is running or not
if [ -z "$pid" ]; then
# If hyprsunset is not running, default temperature is 6500K
temperature=6500
else
# If hyprsunset is running, temperature is 5700K
temperature=5700
fi
# Format the output for Waybar with line breaks
formatted_output="Temperature: $temperature"
# Check if the temperature is greater than or equal to 6500K
if [ "$temperature" -ge 6500 ]; then
# Output as JSON for Waybar, escaping newlines
echo "{\"text\": \"\", \"tooltip\": \"$formatted_output\"}"
else
# Otherwise, output a different icon for lower temperature
echo "{\"text\": \"\", \"tooltip\": \"$formatted_output\"}"
fi Waybar "custom/hyprsunset-temperature": {
"format": " {} ",
"exec": "$HOME/.local/bin/bluelightinfo.sh",
"tooltip": true,
"interval": 1,
"return-type": "json",
"on-click": "$HOME/.local/bin/bluelighttoggle.sh"
},
|
Helps to make some tools around this. Like a UI with values displayed. Also, easier to index current temperature.👍🏽 Much better is to have a CLI for this tool to increase, decrease the temp.🐒
The text was updated successfully, but these errors were encountered: