francma / wob

A lightweight overlay volume/backlight/progress/anything bar for Wayland.
ISC License
896 stars 49 forks source link

Implement maximum feature #14

Closed 7415963987456321 closed 4 years ago

7415963987456321 commented 4 years ago

This pull request implements the maximum feature. This enables the use of the '-m' flag to define the maximum value the bar can represent. I took the liberty of exchanging the use of uint8_t with uint16_t to enable the maximum to be between 1 and 65535, instead of maxing out at 255.

One side effect of using an unsigned to represent the maximum value is that the user can in fact supply a negative number however it will always result in a positive value since it uses unsigned. Don't know if you maybe want me to take this into account and change how I parse the input.

francma commented 4 years ago

One side effect of using an unsigned to represent the maximum value is that the user can in fact supply a negative number however it will always result in a positive value since it uses unsigned. Don't know if you maybe want me to take this into account and change how I parse the input.

I think we don't have to be this pedantic at this stage - we can always fix it later. So it is OK with me.

7415963987456321 commented 4 years ago

@francma alright. Then feel free to merge whenever. I'll see if I can't engineer a better solution in the meantime and throw a pull request if I find anything. But yes I agree I don't think this going to be a problem, we don't really expect users to throw negative numbers at wob anyways.

7415963987456321 commented 4 years ago

All comments adressed, can merge now.