feat(bspwm): Add workspace separator (#942)

Same as the i3 workspace separator
This commit is contained in:
Patrick Ziegler 2018-01-07 01:18:09 +01:00 committed by NBonaparte
parent e3c44983ce
commit a7eb7b3576
3 changed files with 14 additions and 0 deletions

View File

@ -118,6 +118,9 @@ label-empty = %index%
label-empty-foreground = ${colors.foreground-alt}
label-empty-padding = 2
; Separator in between workspaces
; label-separator = |
[module/i3]
type = internal/i3
format = <label-state> <label-mode>

View File

@ -75,6 +75,11 @@ namespace modules {
label_t m_monitorlabel;
iconset_t m_icons;
/**
* Separator that is inserted in between workspaces
*/
label_t m_labelseparator;
bool m_click{true};
bool m_scroll{true};
bool m_revscroll{true};

View File

@ -124,6 +124,8 @@ namespace modules {
m_modelabels.emplace(mode::NODE_PRIVATE, load_optional_label(m_conf, name(), "label-private"));
}
m_labelseparator = load_optional_label(m_conf, name(), "label-separator", "");
m_icons = factory_util::shared<iconset>();
m_icons->add(DEFAULT_ICON, factory_util::shared<label>(m_conf.get(name(), DEFAULT_ICON, ""s)));
@ -400,6 +402,10 @@ namespace modules {
for (auto&& ws : m_monitors[m_index]->workspaces) {
if (ws.second.get()) {
if(workspace_n != 0 && *m_labelseparator) {
builder->node(m_labelseparator);
}
workspace_n++;
if (m_click) {