summaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
authorMaxVerevkin <maxxverrr@gmail.com>2024-08-09 21:02:22 +0300
committerMaxVerevkin <maxxverrr@gmail.com>2024-08-09 21:02:26 +0300
commita1a9933640980034783f5070d16d781f0f7cbee9 (patch)
treebd74d02573ce7e482978f13c53b0d97687631192 /src/config.rs
parent3413a203f452875c7af07284c6ac080c22555b48 (diff)
downloadi3bar-mango-a1a9933640980034783f5070d16d781f0f7cbee9.tar.gz
config: add layer option
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/config.rs b/src/config.rs
index 72ebd5f..0863e1d 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -1,5 +1,5 @@
use crate::color::Color;
-use crate::protocol::zwlr_layer_surface_v1;
+use crate::protocol::{zwlr_layer_shell_v1, zwlr_layer_surface_v1};
use anyhow::{Context, Result};
use pangocairo::pango::FontDescription;
use serde::{de, Deserialize};
@@ -41,6 +41,7 @@ pub struct Config {
pub blocks_overlap: f64,
// misc
pub position: Position,
+ pub layer: Layer,
pub hide_inactive_tags: bool,
pub invert_touchpad_scrolling: bool,
pub show_layout_name: bool,
@@ -84,6 +85,7 @@ impl Default for Config {
blocks_overlap: 0.0,
position: Position::Top,
+ layer: Layer::Top,
hide_inactive_tags: true,
invert_touchpad_scrolling: true,
show_layout_name: true,
@@ -161,6 +163,26 @@ impl From<Position> for zwlr_layer_surface_v1::Anchor {
}
}
+#[derive(Deserialize, Debug, Clone, Copy, PartialEq, Eq)]
+#[serde(rename_all = "lowercase")]
+pub enum Layer {
+ Background,
+ Bottom,
+ Top,
+ Overlay,
+}
+
+impl From<Layer> for zwlr_layer_shell_v1::Layer {
+ fn from(layer: Layer) -> Self {
+ match layer {
+ Layer::Background => Self::Background,
+ Layer::Bottom => Self::Bottom,
+ Layer::Top => Self::Top,
+ Layer::Overlay => Self::Overlay,
+ }
+ }
+}
+
#[derive(Debug, Deserialize)]
pub struct WmConfig {
pub river: RiverConfig,