feat(bspwm,i3): Fuzzy-matching names for icons

Added support for fuzzy matching workspace names when assigning icons.
This feature is enabled/disabled through a new option, 'fuzzy-match'.
It is disabled by default.
This commit is contained in:
Patrick Yates
2017-01-20 15:35:52 +11:00
committed by Michael Carlberg
parent ca0d7345a1
commit 2dfdbd240e
6 changed files with 18 additions and 4 deletions

View File

@ -30,6 +30,7 @@ namespace modules {
m_indexsort = m_conf.get(name(), "index-sort", m_indexsort);
m_pinworkspaces = m_conf.get(name(), "pin-workspaces", m_pinworkspaces);
m_strip_wsnumbers = m_conf.get(name(), "strip-wsnumbers", m_strip_wsnumbers);
m_fuzzy_match = m_conf.get(name(), "fuzzy-match", m_fuzzy_match);
m_conf.warn_deprecated(name(), "wsname-maxlen", "%name:min:max%");
@ -143,7 +144,7 @@ namespace modules {
// Trim leading and trailing whitespace
ws_name = string_util::trim(move(ws_name), ' ');
auto icon = m_icons->get(ws->name, DEFAULT_WS_ICON);
auto icon = m_icons->get(ws->name, DEFAULT_WS_ICON, m_fuzzy_match);
auto label = m_statelabels.find(ws_state)->second->clone();
label->reset_tokens();