If I have two strings "foo" and "bar" and I want them displayed in dzen2 like this:
[foo bar]
is it possible to do this without using the -ta option at all, just positioning commands?
Yes, but it does require knowledge of the width of 1 char in that font, and the length of text you want to align. To float something left, you would need to use:
^pa(_LEFT)^p(-[n*k])sometext
Where n is the number of chars in "sometext" and k is the pixel width of one char.
Dzen does come with a program, textwidth
for calculating the size of non-monospace fonts, in chich case [n*k] would be replaced by that value.
I would recommend using a native version of the code if you can for efficiency, I have a version for golang here, but if this is not possible you can just run the textwidth
command.
SVN revision 255 of dzen apparently contains a ^ba(width, align) command, see the wiki.