diff options
| author | MaxVerevkin <maxxverrr@gmail.com> | 2024-08-09 21:02:22 +0300 |
|---|---|---|
| committer | MaxVerevkin <maxxverrr@gmail.com> | 2024-08-09 21:02:26 +0300 |
| commit | a1a9933640980034783f5070d16d781f0f7cbee9 (patch) | |
| tree | bd74d02573ce7e482978f13c53b0d97687631192 /src | |
| parent | 3413a203f452875c7af07284c6ac080c22555b48 (diff) | |
| download | i3bar-mango-a1a9933640980034783f5070d16d781f0f7cbee9.tar.gz | |
config: add layer option
Diffstat (limited to 'src')
| -rw-r--r-- | src/bar.rs | 2 | ||||
| -rw-r--r-- | src/config.rs | 24 |
2 files changed, 24 insertions, 2 deletions
@@ -57,7 +57,7 @@ impl Bar { conn, surface, Some(output.wl), - zwlr_layer_shell_v1::Layer::Top, + state.shared_state.config.layer.into(), c"i3bar-river".into(), layer_surface_cb, ); 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, |
