Add options to draw indicator as polygon#258
Open
Zabot wants to merge 2 commits into
Open
Conversation
Owner
|
This is SO COOL. I'll review and merge soon! |
58198de to
d19b9bd
Compare
Raymo111
requested changes
Jul 21, 2022
Owner
Raymo111
left a comment
There was a problem hiding this comment.
Great work! This was a static review, just a couple of code points to fix. Once they're updated I'll do a full test and then approve+merge!
a4a6bcf to
8c22426
Compare
8c22426 to
4920faf
Compare
Raymo111
requested changes
Aug 6, 2022
Owner
Raymo111
left a comment
There was a problem hiding this comment.
Good changes, couple more. Please add more commits instead of amending so it's easier for me to review, thanks!
| "--bar-total-width" | ||
| # Polygon indicator | ||
| "--polygon-sides" | ||
| "--polygon-offset" |
|
|
||
| .TP | ||
| .B \-\-polygon\-sides | ||
| Draw the indicator as a regular polygon instead of a circle. |
Owner
There was a problem hiding this comment.
Should document the required arg (number of sides, in addition to current info here)
| if (sscanf(arg, "%d", &polygon_sides) != 1) | ||
| errx(EXIT_FAILURE, "polygon-sides must be a number\n"); | ||
| if (polygon_sides < 3) | ||
| errx(EXIT_FAILURE, "polygon-sides must be greater then 2 or 0\n"); |
| case 405: | ||
| arg = optarg; | ||
| if (sscanf(arg, "%lf", &polygon_rotation) != 1) | ||
| errx(1, "polygon-rotation must be a number\n"); |
| case 406: | ||
| arg = optarg; | ||
| if (sscanf(arg, "%d", &polygon_highlight) != 1) | ||
| errx(1, "polygon-highlight must be a number\n"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
I needed a hexagon unlock indicator for my config, thought it turned out pretty neat and was worth sharing. This adds three new config options.
--polygon-sides=nenables drawing a regular polygon instead of a circle for the indicator. It defaults to0, which draws a circle, and can be any integer greater then2.--polygon-offset=dspecifies a rotation in degrees to apply to the polygon. At zero offset the first vertex is at(ind_x+radius,ind_y).--polygon-highlight={0,1,2}defines the highlight mode while typing.0highlights a random edge on each keystroke.1highlights sequential edges walking clockwise around the indicator.2walks counter clockwise. The edge to highlight is based on the buffer position, so backspacing characters reverses the direction of rotation.The value of
--radiusis the center to vertex distance of the polygon.--line-*,--inside-*, and--ring-*are all respected. Separators are not drawn.Screenshots/screencaps
Release notes
Notes: Added config options to draw indicator as a polygon.