mirror of
https://github.com/polybar/polybar.git
synced 2024-11-11 13:50:56 -05:00
parent
d71e5b909b
commit
12a64bd3d6
1 changed files with 6 additions and 6 deletions
|
@ -119,14 +119,14 @@ namespace modules {
|
|||
|
||||
string wsname{workspace->name};
|
||||
|
||||
if (m_strip_wsnumbers) {
|
||||
auto index = string_util::split(wsname, ':');
|
||||
// Remove workspace numbers "0:"
|
||||
if (m_strip_wsnumbers)
|
||||
wsname.erase(0, string_util::find_nth(wsname, 0, ":", 1) + 1);
|
||||
|
||||
if (index.size() == 2) {
|
||||
wsname = index[1];
|
||||
}
|
||||
}
|
||||
// Trim leading and trailing whitespace
|
||||
wsname = string_util::trim(wsname, ' ');
|
||||
|
||||
// Cap at configured max length
|
||||
if (m_wsname_maxlen > 0 && wsname.length() > m_wsname_maxlen)
|
||||
wsname.erase(m_wsname_maxlen);
|
||||
|
||||
|
|
Loading…
Reference in a new issue