Skip to content

Commit 1725320

Browse files
authored
improv: desktop entries update
1 parent ab7a71a commit 1725320

File tree

25 files changed

+556
-660
lines changed

25 files changed

+556
-660
lines changed

Cargo.lock

Lines changed: 308 additions & 346 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,51 @@ license = "MPL-2.0"
55
authors = ["Michael Aaron Murphy <[email protected]>"]
66
description = "Library for writing plugins and frontends for pop-launcher"
77
repository = "https://github.com/pop-os/launcher"
8-
edition = "2018"
8+
edition.workspace = true
99

1010
[workspace]
1111
members = ["bin", "plugins", "service", "toolkit"]
12+
resolver = "2"
1213

13-
[dependencies]
14-
const_format = "0.2.32"
15-
dirs = "5.0.1"
16-
futures = "0.3.30"
14+
[workspace.package]
15+
edition = "2021"
16+
17+
[workspace.dependencies]
18+
anyhow = "1.0.82"
1719
serde = { version = "1.0.198", features = ["derive"] }
1820
serde_json = "1.0.116"
21+
tracing = "0.1.40"
22+
dirs = "5.0.1"
1923
serde_with = "3.7.0"
24+
futures = "0.3.30"
25+
flume = "0.11.0"
26+
toml = "0.8.12"
27+
regex = "1.10.4"
28+
ron = "0.8.1"
29+
tokio = "1.37.0"
30+
tokio-stream = "0.1.15"
31+
32+
[dependencies]
33+
const_format = "0.2.32"
34+
dirs.workspace = true
35+
futures.workspace = true
36+
serde.workspace = true
37+
serde_json.workspace = true
38+
serde_with.workspace = true
2039

2140
[profile.release]
2241
lto = "fat"
2342
panic = "abort"
2443

2544
[dependencies.tokio]
26-
version = "1.37.0"
45+
workspace = true
2746
features = ["io-std", "io-util"]
2847

2948
[dependencies.tokio-stream]
30-
version = "0.1.15"
49+
workspace = true
3150
features = ["io-util"]
51+
52+
53+
54+
# [patch.crates-io]
55+
# freedesktop-desktop-entry = { path = "../freedesktop-desktop-entry" }

bin/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
[package]
22
name = "pop-launcher-bin"
33
version = "1.2.3"
4-
edition = "2018"
54
license = "GPL-3.0-only"
5+
edition.workspace = true
66
publish = false
77

88
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
99

1010
[dependencies]
1111
pop-launcher-toolkit = { path = "../toolkit" }
12-
tracing = "0.1.40"
13-
tracing-subscriber = { version = "0.3.18", default-features = false, features = ["std", "fmt", "env-filter"] }
14-
dirs = "5.0.1"
12+
tracing.workspace = true
13+
tracing-subscriber = { version = "0.3.18", default-features = false, features = ["std", "fmt", "env-filter", "chrono"] }
14+
dirs.workspace = true
1515
mimalloc = "0.1.39"
1616

1717
[dependencies.tokio]
18-
version = "1.37.0"
18+
workspace = true
1919
features = ["rt"]

bin/src/main.rs

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ use pop_launcher_toolkit::plugins;
55
use pop_launcher_toolkit::service;
66

77
use mimalloc::MiMalloc;
8+
use tracing_subscriber::layer::SubscriberExt;
9+
use tracing_subscriber::EnvFilter;
810

911
#[global_allocator]
1012
static GLOBAL: MiMalloc = MiMalloc;
@@ -37,7 +39,10 @@ async fn main() {
3739
}
3840
}
3941

42+
// todo: support journald once this issue is resolved: https://github.com/tokio-rs/tracing/issues/2348
4043
fn init_logging(cmd: &str) {
44+
use tracing_subscriber::{fmt, Registry};
45+
4146
let logdir = match dirs::state_dir() {
4247
Some(dir) => dir.join("pop-launcher/"),
4348
None => dirs::home_dir()
@@ -49,15 +54,27 @@ fn init_logging(cmd: &str) {
4954

5055
let logfile = std::fs::OpenOptions::new()
5156
.create(true)
52-
.truncate(true)
53-
.write(true)
57+
.append(true)
5458
.open(logdir.join([cmd, ".log"].concat().as_str()).as_path());
5559

5660
if let Ok(file) = logfile {
57-
use tracing_subscriber::{fmt, EnvFilter};
58-
fmt()
59-
.with_env_filter(EnvFilter::from_default_env())
60-
.with_writer(file)
61-
.init();
61+
if let Ok(meta) = file.metadata() {
62+
if meta.len() > 1000 {
63+
let _ = file.set_len(0);
64+
}
65+
}
66+
67+
let filter_layer = EnvFilter::try_from_default_env()
68+
.or_else(|_| EnvFilter::try_new("warn"))
69+
.unwrap();
70+
71+
let fmt_layer = fmt::layer()
72+
.with_target(false)
73+
.with_timer(fmt::time::ChronoLocal::new("%T".into()))
74+
.with_writer(file);
75+
76+
let subscriber = Registry::default().with(filter_layer).with(fmt_layer);
77+
78+
tracing::subscriber::set_global_default(subscriber).expect("Failed to set subscriber");
6279
}
6380
}

plugins/Cargo.toml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,33 @@ name = "pop-launcher-plugins"
33
version = "1.2.3"
44
license = "GPL-3.0-only"
55
authors = ["Michael Aaron Murphy <[email protected]>"]
6-
edition = "2018"
6+
edition.workspace = true
77
publish = false
88

99
[dependencies]
1010
async-pidfd = "0.1.4"
1111
fork = "0.1.23"
12-
freedesktop-desktop-entry = "0.6.0"
12+
freedesktop-desktop-entry = "0.6.2"
1313
human_format = "1.1.0"
1414
human-sort = "0.2.2"
1515
new_mime_guess = "4.0.1"
1616
pop-launcher = { path = "../" }
17-
regex = "1.10.4"
18-
ron = "0.8.1"
19-
serde = "1.0.198"
20-
serde_json = "1.0.116"
17+
regex.workspace = true
18+
ron.workspace = true
19+
serde.workspace = true
20+
serde_json.workspace = true
2121
slab = "0.4.9"
2222
strsim = "0.11.1"
23-
tracing = "0.1.40"
23+
tracing.workspace = true
2424
urlencoding = "2.1.3"
25-
zbus = "3.15.2"
26-
zvariant = "3.15.2"
27-
ward = "2.1.0"
25+
zbus = "4.2.2"
26+
zvariant = "4.1.1"
2827
url = "2.5.0"
2928
sysfs-class = "0.1.3"
30-
anyhow = "1.0.82"
31-
flume = "0.11.0"
32-
dirs = "5.0.1"
33-
futures = "0.3.30"
29+
anyhow.workspace = true
30+
flume.workspace = true
31+
dirs.workspace = true
32+
futures.workspace = true
3433
bytes = "1.6.0"
3534
recently-used-xbel = "1.0.0"
3635

@@ -49,5 +48,5 @@ default-features = false
4948
features = ["rustls-tls"]
5049

5150
[dependencies.tokio]
52-
version = "1.37.0"
51+
workspace = true
5352
features = ["fs", "io-std", "macros", "process", "rt"]

plugins/src/calc/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ impl App {
116116
async fn qcalc(regex: &mut Regex, expression: &str, decimal_comma: bool) -> Option<String> {
117117
let mut command = Command::new("qalc");
118118

119-
command.args(&["-u8"]);
120-
command.args(&["-set", "maxdeci 9"]);
119+
command.args(["-u8"]);
120+
command.args(["-set", "maxdeci 9"]);
121121

122122
if decimal_comma {
123-
command.args(&["-set", "decimal comma on"]);
123+
command.args(["-set", "decimal comma on"]);
124124
} else {
125-
command.args(&["-set", "decimal comma off"]);
125+
command.args(["-set", "decimal comma off"]);
126126
}
127127

128128
let spawn = command

plugins/src/cosmic_toplevel/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ impl<W: AsyncWrite + Unpin> App<W> {
213213
}
214214

215215
send(&mut self.tx, PluginResponse::Finished).await;
216-
let _ = self.tx.flush();
216+
let _ = self.tx.flush().await;
217217
}
218218
}
219219

plugins/src/cosmic_toplevel/toplevel_handler.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ pub enum ToplevelEvent {
3434
Update(ZcosmicToplevelHandleV1, ToplevelInfo),
3535
}
3636

37+
#[allow(dead_code)]
3738
#[derive(Debug, Clone)]
3839
pub struct Toplevel {
3940
pub name: String,

0 commit comments

Comments
 (0)