mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-07-03 11:41:04 +02:00
feat: logging support and proper error handling
This commit is contained in:
parent
917838c98c
commit
ab8f7ecfc8
28 changed files with 1056 additions and 388 deletions
|
@ -14,13 +14,12 @@ pub mod tray;
|
|||
pub mod workspaces;
|
||||
|
||||
use crate::config::BarPosition;
|
||||
use color_eyre::Result;
|
||||
/// Shamelessly stolen from here:
|
||||
/// <https://github.com/zeroeightysix/rustbar/blob/master/src/modules/module.rs>
|
||||
use glib::IsA;
|
||||
use gtk::gdk::Monitor;
|
||||
use gtk::{Application, Widget};
|
||||
use serde::de::DeserializeOwned;
|
||||
use serde_json::Value;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub enum ModuleLocation {
|
||||
|
@ -43,12 +42,5 @@ where
|
|||
{
|
||||
/// Consumes the module config
|
||||
/// and produces a GTK widget of type `W`
|
||||
fn into_widget(self, info: &ModuleInfo) -> W;
|
||||
|
||||
fn from_value(v: &Value) -> Box<Self>
|
||||
where
|
||||
Self: DeserializeOwned,
|
||||
{
|
||||
serde_json::from_value(v.clone()).unwrap()
|
||||
}
|
||||
fn into_widget(self, info: &ModuleInfo) -> Result<W>;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue