Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The idea is to allow the current relative mouse position {x} and {y} within the widget in percent to be used as an argument to custom scripts
This is a change that I have been using for a while now and that I find really convenient for operating in tablet mode. This way, a script (like [1]) can be used to execute different actions depending on where exactly the mouse (or stylus in the tablet case) clicks. The script can divide the widget surface into a grid of subsurfaces, depending on the reasonable use-case (eg -/+ for brightness, -/mute/+ for volume).
The coordinates are converted to relative percentages within the widget as integers to ease processing by simple scripts that are not capable of complicated math operations. This should still give enough accuracy to accomplish any reasonable subdivision.
One alternative that has been considered considered, to implement the whole grid logic within waybar and allow it to be configured from the config file, as well as different actions for different parts of the grid. This does seem like major feature creep however, compared to the simple implementation that I chose.
If you would be interested in upstreaming this feature, I can add it to the documentation before merging!
[1]