mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-15 13:22:19 +01:00
chore(deps): bump zbus to 6
zbus 6 splits the proxy and service parts of the crate into features, which komorebi now asks for, makes the builders of connections, proxies and match rules infallible until build(), and renames the zvariant aliases.
This commit is contained in:
1 parent
d1b7d27835
commit
0bb19915c3
7 files changed
+98
-33
No files matched your search
Generated
+69
-8
@@ -77,7 +77,7 @@ dependencies = [
|
||||
"futures-lite",
|
||||
"futures-util",
|
||||
"serde",
|
||||
"zbus",
|
||||
"zbus 5.19.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -475,7 +475,7 @@ dependencies = [
|
||||
"enumflags2",
|
||||
"serde",
|
||||
"static_assertions",
|
||||
"zbus",
|
||||
"zbus 5.19.0",
|
||||
"zbus-lockstep",
|
||||
"zbus-lockstep-macros",
|
||||
"zbus_names",
|
||||
@@ -491,7 +491,7 @@ dependencies = [
|
||||
"atspi-common",
|
||||
"atspi-proxies",
|
||||
"futures-lite",
|
||||
"zbus",
|
||||
"zbus 5.19.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -502,7 +502,7 @@ checksum = "d2eebcb9e7e76f26d0bcfd6f0295e1cd1e6f33bedbc5698a971db8dc43d7751c"
|
||||
dependencies = [
|
||||
"atspi-common",
|
||||
"serde",
|
||||
"zbus",
|
||||
"zbus 5.19.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2520,7 +2520,7 @@ dependencies = [
|
||||
"tracing-subscriber",
|
||||
"uuid",
|
||||
"version",
|
||||
"zbus",
|
||||
"zbus 6.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4875,7 +4875,6 @@ dependencies = [
|
||||
"signal-hook-registry",
|
||||
"socket2",
|
||||
"tokio-macros",
|
||||
"tracing",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
@@ -6199,17 +6198,44 @@ dependencies = [
|
||||
"rustix 1.1.6",
|
||||
"serde",
|
||||
"serde_repr",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"uds_windows",
|
||||
"uuid",
|
||||
"windows-sys 0.61.2",
|
||||
"winnow",
|
||||
"zbus_macros",
|
||||
"zbus_macros 5.19.0",
|
||||
"zbus_names",
|
||||
"zvariant",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zbus"
|
||||
version = "6.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fcff5faa63a63d5b81051740f7382017f10b3440b3f401d97f0cf0b3b39c62d9"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"bitflags 2.13.2",
|
||||
"endi",
|
||||
"futures-core",
|
||||
"hex",
|
||||
"libc",
|
||||
"ordered-stream",
|
||||
"rustix 1.1.6",
|
||||
"serde",
|
||||
"serde_repr",
|
||||
"socket2",
|
||||
"tokio",
|
||||
"uds_windows",
|
||||
"uuid",
|
||||
"windows-sys 0.61.2",
|
||||
"winnow",
|
||||
"zbus_macros 6.1.0",
|
||||
"zbus_utils",
|
||||
"zcheapstr",
|
||||
"zruntime",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zbus-lockstep"
|
||||
version = "0.5.2"
|
||||
@@ -6249,6 +6275,18 @@ dependencies = [
|
||||
"zvariant_utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zbus_macros"
|
||||
version = "6.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5bba6e2bfe19571dc81b3e0be9f8daec6e5422db3e2eea2e766a859553e7bd37"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 3.0.9",
|
||||
"zbus_utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zbus_names"
|
||||
version = "4.3.5"
|
||||
@@ -6260,6 +6298,19 @@ dependencies = [
|
||||
"zvariant",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zbus_utils"
|
||||
version = "6.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c27a055b114bd9fc3686e90f62bd1fe612d523fc5f620bac3b1d2f42d3f6cab8"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"serde",
|
||||
"syn 3.0.9",
|
||||
"winnow",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zbus_xml"
|
||||
version = "5.2.1"
|
||||
@@ -6367,6 +6418,16 @@ version = "1.0.23"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
|
||||
|
||||
[[package]]
|
||||
name = "zruntime"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dfc035df602243402949ddf3dcc5bcfad7edeb732dd49ec6e605431c4eca54ce"
|
||||
dependencies = [
|
||||
"futures-core",
|
||||
"futures-io",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zune-core"
|
||||
version = "0.5.3"
|
||||
|
||||
+5
-1
@@ -36,7 +36,11 @@ tokio = { version = "1", features = [
|
||||
tracing = { workspace = true }
|
||||
tracing-appender = { workspace = true }
|
||||
tracing-subscriber = { workspace = true }
|
||||
zbus = { version = "5", default-features = false, features = ["tokio"] }
|
||||
zbus = { version = "6", default-features = false, features = [
|
||||
"tokio",
|
||||
"proxy",
|
||||
"service",
|
||||
] }
|
||||
futures-util = "0.3"
|
||||
|
||||
[dev-dependencies]
|
||||
|
||||
@@ -106,8 +106,8 @@ use std::time::Duration;
|
||||
use std::time::Instant;
|
||||
use tokio::sync::mpsc;
|
||||
use zbus::Connection;
|
||||
use zbus::OwnedObjectPath;
|
||||
use zbus::proxy::Proxy;
|
||||
use zbus::zvariant::OwnedObjectPath;
|
||||
|
||||
/// The name of komorebi's component in kglobalaccel.
|
||||
pub const COMPONENT: &str = "komorebi";
|
||||
|
||||
@@ -434,20 +434,20 @@ pub fn connect() -> eyre::Result<Arc<KWinBackend>> {
|
||||
}
|
||||
|
||||
async fn start(shared: Arc<Shared>) -> eyre::Result<()> {
|
||||
let connection = zbus::connection::Builder::session()?
|
||||
.name(SERVICE)?
|
||||
let connection = zbus::connection::Builder::session()
|
||||
.name(SERVICE)
|
||||
.serve_at(
|
||||
PATH,
|
||||
Events {
|
||||
shared: shared.clone(),
|
||||
},
|
||||
)?
|
||||
)
|
||||
.serve_at(
|
||||
POLL_PATH,
|
||||
Poll {
|
||||
shared: shared.clone(),
|
||||
},
|
||||
)?
|
||||
)
|
||||
.build()
|
||||
.await
|
||||
.map_err(|error| {
|
||||
@@ -675,9 +675,9 @@ async fn desktop_manager(shared: &Shared) -> eyre::Result<Proxy<'static>> {
|
||||
let connection = shared.connection().await?;
|
||||
// uncached: a property read right after createDesktop must not return the list from before it
|
||||
Ok(zbus::proxy::Builder::new(&connection)
|
||||
.destination("org.kde.KWin")?
|
||||
.path("/VirtualDesktopManager")?
|
||||
.interface("org.kde.KWin.VirtualDesktopManager")?
|
||||
.destination("org.kde.KWin")
|
||||
.path("/VirtualDesktopManager")
|
||||
.interface("org.kde.KWin.VirtualDesktopManager")
|
||||
.cache_properties(CacheProperties::No)
|
||||
.build()
|
||||
.await?)
|
||||
|
||||
@@ -79,9 +79,9 @@ async fn screen_lock(session: Connection) {
|
||||
// KDE's lock screen says whether it is up, on KWin's name for the freedesktop interface
|
||||
let rule = MatchRule::builder()
|
||||
.msg_type(Type::Signal)
|
||||
.interface("org.freedesktop.ScreenSaver")?
|
||||
.member("ActiveChanged")?
|
||||
.build();
|
||||
.interface("org.freedesktop.ScreenSaver")
|
||||
.member("ActiveChanged")
|
||||
.build()?;
|
||||
let mut stream = MessageStream::for_match_rule(rule, &session, None).await?;
|
||||
|
||||
while let Some(message) = stream.next().await {
|
||||
@@ -113,10 +113,10 @@ async fn sleep(system: Connection) {
|
||||
let result = async {
|
||||
let rule = MatchRule::builder()
|
||||
.msg_type(Type::Signal)
|
||||
.sender("org.freedesktop.login1")?
|
||||
.interface("org.freedesktop.login1.Manager")?
|
||||
.member("PrepareForSleep")?
|
||||
.build();
|
||||
.sender("org.freedesktop.login1")
|
||||
.interface("org.freedesktop.login1.Manager")
|
||||
.member("PrepareForSleep")
|
||||
.build()?;
|
||||
let mut stream = MessageStream::for_match_rule(rule, &system, None).await?;
|
||||
|
||||
while let Some(message) = stream.next().await {
|
||||
|
||||
@@ -25,9 +25,9 @@ use color_eyre::eyre;
|
||||
use std::collections::HashMap;
|
||||
use std::path::Path;
|
||||
use zbus::Connection;
|
||||
use zbus::OwnedVariant;
|
||||
use zbus::Variant;
|
||||
use zbus::proxy::Proxy;
|
||||
use zbus::zvariant::OwnedValue;
|
||||
use zbus::zvariant::Value;
|
||||
|
||||
/// The Plasma shell's name on the session bus.
|
||||
const SHELL: &str = "org.kde.plasmashell";
|
||||
@@ -75,7 +75,7 @@ fn screen_script(output: &str) -> String {
|
||||
|
||||
/// Returns true if and only if the shell's answer about a screen's wallpaper is the picture at
|
||||
/// `url`, shown by [`PLUGIN`] with [`FILL_MODE`].
|
||||
fn shows(current: &HashMap<String, OwnedValue>, url: &str) -> bool {
|
||||
fn shows(current: &HashMap<String, OwnedVariant>, url: &str) -> bool {
|
||||
let text = |key: &str| {
|
||||
current
|
||||
.get(key)
|
||||
@@ -113,14 +113,14 @@ pub async fn apply(connection: &Connection, output: &str, path: &Path) -> eyre::
|
||||
};
|
||||
|
||||
let url = file_url(path);
|
||||
let current: HashMap<String, OwnedValue> = proxy.call("wallpaper", &(screen,)).await?;
|
||||
let current: HashMap<String, OwnedVariant> = proxy.call("wallpaper", &(screen,)).await?;
|
||||
if shows(¤t, &url) {
|
||||
return Ok(false);
|
||||
}
|
||||
|
||||
let mut parameters: HashMap<&str, Value<'_>> = HashMap::new();
|
||||
parameters.insert("Image", Value::from(url));
|
||||
parameters.insert("FillMode", Value::from(FILL_MODE));
|
||||
let mut parameters: HashMap<&str, Variant<'_>> = HashMap::new();
|
||||
parameters.insert("Image", Variant::from(url));
|
||||
parameters.insert("FillMode", Variant::from(FILL_MODE));
|
||||
proxy
|
||||
.call_method("setWallpaper", &(PLUGIN, parameters, screen))
|
||||
.await?;
|
||||
|
||||
@@ -40,9 +40,9 @@ impl Bus {
|
||||
}
|
||||
|
||||
async fn connect(&self, name: Option<&str>) -> Connection {
|
||||
let mut builder = zbus::connection::Builder::address(self.address.as_str()).unwrap();
|
||||
let mut builder = zbus::connection::Builder::address(self.address.as_str());
|
||||
if let Some(name) = name {
|
||||
builder = builder.name(name.to_string()).unwrap();
|
||||
builder = builder.name(name.to_string());
|
||||
}
|
||||
builder.build().await.unwrap()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user