Hypridle timeout changer #4122
TheElevatedOne
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello I wrote a Hypridle timeout changer for my waybar.
Waybar Config
Bash Script
Hypridle Config
Hypridle cannot be restarted after it has been ran and you cannot reload the config. So this script user the hypridle.service through systemctl to workaround this issue.
Since My hypridle config uses a timeout widget (using eww) which just counts down the last 30 seconds, the script uses two values, but may be easily modified to use one or to use different margin than 30 seconds.
The script uses
sed "Nq;d"
to find the number it need to replace as only runningResults in
There are predefined timeouts
Which may be changed, but if some are added, the numbers in this comparison should be increased by one to not break the code (made it hardcoded for my use case)
The script has been made in a CLI way, so you can toggle through the predefined values using
> hypridle-timeout toggle
Or set a custom time with the
set
arguments, although that one does not return anything, so usage in waybar is nonexisted at the moment, may change it later though.The return value for waybar is
Which echo's both the text in minutes in the
$RET
variable and the tooltip for the module.It used
sed "s/'/\"/g"
to overcome the limitation ofbash
andjq
, which does not allow this expression (or at least I have not found a way to how)That's kinda it from me.
Beta Was this translation helpful? Give feedback.
All reactions