domsson / succade

Run, feed and style your Lemonbar with ease
Creative Commons Zero v1.0 Universal
55 stars 3 forks source link

Implement raw mode #39

Closed domsson closed 4 years ago

domsson commented 4 years ago

Currently, it isn't possible to feed pre-formatted strings to succade, as succade will escape all % characters. However, this means that we need to resort to multiple-block trickery to implement workspace indicators and other blocks where only part of the output should have a certain formatting.

In order to work around this, we could implement a raw (boolean) option, that would tell succade to not escape the output of a block. This should enable users to write blocks that output lemonbar-formatted strings.

domsson commented 4 years ago

Couldn't the user just have their program escape the format string? Wouldn't that work? This way, succade would un-escape it, right?

domsson commented 4 years ago

Manual escaping by the user doesn't work because our escape() function simply replaces every occurence of % with %%, so if the input string had %% in it, ecape() would turn that into %%%%. We could change the escape function, but frankly: implementing the raw option was easier, so I did that with ff80cf5490929220c578d7a9dd3dd173a2686feb