Skip to content

Commit a549ee8

Browse files
committed
Update for i3 4.12
Commit i3/i3@dc05d90 introduces three new colorable bar parts. Add opt-in support via conditional compilation.
1 parent 644d878 commit a549ee8

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ unix_socket = "0.4.5"
1111
byteorder = "0.3"
1212
log = "0.3.7"
1313
serde_json = "0.6.0"
14+
15+
[features]
16+
i3-4-12 = []

src/common.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,16 @@ pub fn build_bar_config(j: &json::Value) -> reply::BarConfig {
110110
"background" => reply::ColorableBarPart::Background,
111111
"statusline" => reply::ColorableBarPart::Statusline,
112112
"separator" => reply::ColorableBarPart::Separator,
113+
114+
#[cfg(feature = "i3-4-12")]
115+
"focused_background" => reply::ColorableBarPart::FocusedBackground,
116+
117+
#[cfg(feature = "i3-4-12")]
118+
"focused_statusline" => reply::ColorableBarPart::FocusedStatusline,
119+
120+
#[cfg(feature = "i3-4-12")]
121+
"focused_separator" => reply::ColorableBarPart::FocusedSeparator,
122+
113123
"focused_workspace_text" => reply::ColorableBarPart::FocusedWorkspaceText,
114124
"focused_workspace_bg" => reply::ColorableBarPart::FocusedWorkspaceBg,
115125
"focused_workspace_border" => reply::ColorableBarPart::FocusedWorkspaceBorder,

src/reply.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,20 @@ pub enum ColorableBarPart {
219219
/// Text color to be used for the separator.
220220
Separator,
221221

222+
/// Background color of the bar on the currently focused monitor output.
223+
#[cfg(feature = "i3-4-12")]
224+
FocusedBackground,
225+
226+
/// Text color to be used for the statusline on the currently focused
227+
/// monitor output.
228+
#[cfg(feature = "i3-4-12")]
229+
FocusedStatusline,
230+
231+
/// Text color to be used for the separator on the currently focused
232+
/// monitor output.
233+
#[cfg(feature = "i3-4-12")]
234+
FocusedSeparator,
235+
222236
/// Text color for a workspace button when the workspace has focus.
223237
FocusedWorkspaceText,
224238

0 commit comments

Comments
 (0)