mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-07-03 03:31:03 +02:00
feat: add support for showing bar at top of screen
This commit is contained in:
parent
19d009fe5b
commit
a358037d3e
8 changed files with 77 additions and 15 deletions
|
@ -21,8 +21,24 @@ pub enum ModuleConfig {
|
|||
Script(ScriptModule),
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Clone, PartialEq)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
pub enum BarPosition {
|
||||
Top,
|
||||
Bottom
|
||||
}
|
||||
|
||||
impl Default for BarPosition {
|
||||
fn default() -> Self {
|
||||
BarPosition::Bottom
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Clone, Default)]
|
||||
pub struct Config {
|
||||
#[serde(default = "default_bar_position")]
|
||||
pub position: BarPosition,
|
||||
|
||||
pub left: Option<Vec<ModuleConfig>>,
|
||||
pub center: Option<Vec<ModuleConfig>>,
|
||||
pub right: Option<Vec<ModuleConfig>>,
|
||||
|
@ -30,6 +46,10 @@ pub struct Config {
|
|||
pub monitors: Option<Vec<Config>>,
|
||||
}
|
||||
|
||||
const fn default_bar_position() -> BarPosition {
|
||||
BarPosition::Bottom
|
||||
}
|
||||
|
||||
impl Config {
|
||||
pub fn load() -> Option<Self> {
|
||||
let config_dir = config_dir().expect("Failed to locate user config dir");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue