summaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs
index a20f60e..9770858 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -1,4 +1,5 @@
use crate::color::Color;
+use crate::protocol::zwlr_layer_surface_v1;
use anyhow::{Context, Result};
use dirs_next::config_dir;
use pangocairo::pango::FontDescription;
@@ -33,6 +34,7 @@ pub struct Config {
// command
pub command: Option<String>,
// misc
+ pub position: Position,
pub hide_inactive_tags: bool,
pub invert_touchpad_scrolling: bool,
pub show_layout_name: bool,
@@ -61,6 +63,7 @@ impl Default for Config {
blocks_r: 0.0,
blocks_overlap: 0.0,
command: None,
+ position: Position::Top,
hide_inactive_tags: true,
invert_touchpad_scrolling: true,
show_layout_name: true,
@@ -92,6 +95,22 @@ impl Config {
}
}
+#[derive(Deserialize, Debug, Clone, Copy)]
+#[serde(rename_all = "lowercase")]
+pub enum Position {
+ Top,
+ Bottom,
+}
+
+impl From<Position> for zwlr_layer_surface_v1::Anchor {
+ fn from(position: Position) -> Self {
+ match position {
+ Position::Top => Self::Top | Self::Left | Self::Right,
+ Position::Bottom => Self::Bottom | Self::Left | Self::Right,
+ }
+ }
+}
+
#[derive(Debug)]
pub struct Font(pub FontDescription);