From d8414c6ec547b58c9ec05db1db46509847f09380 Mon Sep 17 00:00:00 2001
From: Patrick Ziegler
Date: Sun, 7 Jan 2018 01:19:02 +0100
Subject: [PATCH] feat(i3): Add workspace separator (#938)
Puts a label-separator node between workspaces on the bar. Since the
separator uses a label it can be configured like any other label
Closes: #929
---
doc/config.cmake | 4 ++++
include/modules/i3.hpp | 5 +++++
src/modules/i3.cpp | 14 ++++++++++++++
3 files changed, 23 insertions(+)
diff --git a/doc/config.cmake b/doc/config.cmake
index a757b22f..f99fab72 100644
--- a/doc/config.cmake
+++ b/doc/config.cmake
@@ -155,6 +155,10 @@ label-urgent = %index%
label-urgent-background = ${module/bspwm.label-urgent-background}
label-urgent-padding = ${module/bspwm.label-urgent-padding}
+; Separator in between workspaces
+; label-separator = |
+
+
[module/mpd]
type = internal/mpd
format-online =
diff --git a/include/modules/i3.hpp b/include/modules/i3.hpp
index 103f15a9..ccf45691 100644
--- a/include/modules/i3.hpp
+++ b/include/modules/i3.hpp
@@ -76,6 +76,11 @@ namespace modules {
label_t m_modelabel;
bool m_modeactive{false};
+ /**
+ * Separator that is inserted in between workspaces
+ */
+ label_t m_labelseparator;
+
bool m_click{true};
bool m_scroll{true};
bool m_revscroll{true};
diff --git a/src/modules/i3.cpp b/src/modules/i3.cpp
index 07580d41..56c2fb48 100644
--- a/src/modules/i3.cpp
+++ b/src/modules/i3.cpp
@@ -52,6 +52,8 @@ namespace modules {
m_modelabel = load_optional_label(m_conf, name(), "label-mode", "%mode%");
}
+ m_labelseparator = load_optional_label(m_conf, name(), "label-separator", "");
+
m_icons = factory_util::shared();
m_icons->add(DEFAULT_WS_ICON, factory_util::shared