Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 133 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cosmic-config = { git = "https://github.com/pop-os/libcosmic" }

[dependencies]
cosmic-settings-subscriptions = { git = "https://github.com/pop-os/cosmic-settings-subscriptions", features = [
"pulse",
"pulse",
] }
anyhow = "1.0.97"
clap = "4.5.32"
Expand All @@ -25,7 +25,7 @@ zbus = { version = "5.7.1", default-features = false, features = ["tokio"] }
tokio-stream = "0.1.17"
sunrise = "2.1.0"
cosmic-theme = { git = "https://github.com/pop-os/libcosmic", features = [
"export",
"export",
] }
cosmic-config.workspace = true
cosmic-comp-config = { git = "https://github.com/pop-os/cosmic-comp" }
Expand All @@ -42,6 +42,16 @@ futures = "0.3.31"
ctrlc = { version = "3.4.5", features = ["termination"] }
xkb-data = "0.2.1"
geonames = { path = "geonames" }
tracing = "0.1.41"
tracing-journald = "0.3.1"
tracing-subscriber = { version = "0.3.19", default-features = false, features = [
"std",
"env-filter",
"registry",
"fmt",
"env-filter",
"ansi",
] }

[patch.crates-io]
smithay-client-toolkit = { git = "https://github.com/smithay/client-toolkit" }
Expand Down
20 changes: 20 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use tokio::{
task,
};
use tokio_stream::StreamExt;
use tracing_subscriber::{fmt, prelude::*, EnvFilter};
use zbus::{
names::{MemberName, UniqueName, WellKnownName},
object_server::SignalEmitter,
Expand Down Expand Up @@ -355,6 +356,7 @@ pub enum Change {

#[tokio::main(flavor = "current_thread")]
async fn main() -> zbus::Result<()> {
init_logger();
let (theme_cleanup_done_tx, mut theme_cleanup_done_rx) = tokio::sync::mpsc::channel(1);
let (sigterm_tx, sigterm_rx) = tokio::sync::broadcast::channel(1);

Expand Down Expand Up @@ -750,3 +752,21 @@ async fn watch_config_message_stream(

Ok(())
}

fn init_logger() {
let fmt_layer = fmt::layer().with_target(false);
let filter_layer = EnvFilter::try_from_default_env()
.or_else(|_| EnvFilter::try_new("warn"))
.unwrap();
if let Ok(journal_layer) = tracing_journald::layer() {
tracing_subscriber::registry()
.with(journal_layer)
.with(filter_layer)
.init();
} else {
tracing_subscriber::registry()
.with(fmt_layer)
.with(filter_layer)
.init();
}
}