diff options
| author | Quentin Rameau <quinq@fifth.space> | 2016-01-04 02:21:04 +0100 |
|---|---|---|
| committer | Christoph Lohmann <20h@r-36.net> | 2016-01-04 18:29:40 +0100 |
| commit | 8920c1ba196df53a8ca06c179a3aa3ee260a6935 (patch) | |
| tree | 8df03c94ca8ab7c3351728edd8b71ace37771014 /tabbed.c | |
| parent | eb0ff62120df6a5e87f26ba0b1e86bbaebeccb87 (diff) | |
| download | tabbed-8920c1ba196df53a8ca06c179a3aa3ee260a6935.tar.gz | |
Add configuration option for title truncation string
Permit to use arbitrary string instead of "..." (ie "$") when truncating
client title.
Signed-off-by: Christoph Lohmann <20h@r-36.net>
Diffstat (limited to 'tabbed.c')
| -rw-r--r-- | tabbed.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -369,7 +369,7 @@ drawbar(void) void drawtext(const char *text, unsigned long col[ColLast]) { - int i, x, y, h, len, olen; + int i, j, x, y, h, len, olen; char buf[256]; XRectangle r = { dc.x, dc.y, dc.w, dc.h }; @@ -391,8 +391,11 @@ drawtext(const char *text, unsigned long col[ColLast]) return; memcpy(buf, text, len); - if (len < olen) - for(i = len; i && i > len - 3; buf[--i] = '.'); + if (len < olen) { + for (i = len, j = strlen(titletrim); j && i; + buf[--i] = titletrim[--j]) + ; + } XSetForeground(dpy, dc.gc, col[ColFG]); if (dc.font.set) |