fucking something i forgot

This commit is contained in:
2026-09-12 12:24:36 +01:00
parent bdec970b62
commit 539c80cda9
20 changed files with 260 additions and 128 deletions
+2
View File
@@ -12,6 +12,8 @@ iced = { workspace = true }
iced_layershell = { workspace = true }
tokio = { workspace = true }
chrono = { workspace = true }
clap = {workspace = true}
toml = {workspace =true}
# Modules + services
modules = { path = "../modules" }
services = { path = "../services" }
+10
View File
@@ -0,0 +1,10 @@
use clap::Parser;
use std::path::PathBuf;
#[derive(Parser)]
pub struct Args {
#[arg(short, long)]
pub config: PathBuf,
// #[arg(long)]
// demo: bool,
}
+21 -2
View File
@@ -4,11 +4,17 @@
//! `wlr-layer-shell`. Optional first CLI arg = target output name.
//! Clicking a module's button spawns a LayerShell popup anchored to it.
use std::fs::File;
use std::io::Read;
use clap::Parser;
use common::BarbarConfig;
use iced_layershell::daemon;
use iced_layershell::reexport::Anchor;
use iced_layershell::settings::{LayerShellSettings, Settings, StartMode};
mod app;
mod args;
mod msg;
mod popup;
mod subscription;
@@ -22,8 +28,21 @@ pub(crate) use msg::{Message, Msg};
const BAR_HEIGHT: u32 = 36;
fn main() -> Result<(), iced_layershell::Error> {
let start_mode = match std::env::args().nth(1) {
Some(output) => StartMode::TargetScreen(output),
let args = args::Args::parse();
let config_handle = File::open(args.config);
let config: BarbarConfig;
if let Ok(mut config_file) = config_handle {
let mut string = String::new();
config_file.read_to_string(&mut string).unwrap();
config = toml::from_str(&string).unwrap();
} else {
println!("cant open config file");
return Ok(());
}
let start_mode = match config.monitor {
Some(x) => StartMode::TargetScreen(x),
None => StartMode::Active,
};