Open
Description
Description of the requested feature
Add the following string case related functions to the expression language:
lower(string) -> string
upper(string) -> string
I don't other conversions (uppercase first letter, snake case, camel case, etc) are that common and can be done with regex.
Potentially also useful:strip(string) -> string
- (remove whitespace from either side of a string) maybe the default string widget andlabel
should automatically strip their text?
Proposed configuration syntax
I'm assigning css classes based on the battery status from EWW_BATTERY.BAT0.status
, which returns the status as a string starting with a capital letter, which isn't the convention for css classes. It would look like this:
(defwidget battery []
(box :class "battery ${lower(EWW_BATTERY.BAT0.status)}"
...)
)
Additional context
All these operations are already possible with regex, but I feel like they're common enough to warrant dedicated methods.
Activity