mirror of
https://github.com/k0kubun/xremap
synced 2024-11-02 03:40:25 +00:00
Use xremap's original extension to talk to GNOME
This commit is contained in:
parent
0a775b6aa6
commit
7d0d829647
@ -31,23 +31,17 @@ impl Client for GnomeClient {
|
||||
None => return None,
|
||||
};
|
||||
|
||||
let code = "
|
||||
const actor = global.get_window_actors().find(a=>a.meta_window.has_focus()===true)
|
||||
actor && actor.get_meta_window().get_wm_class()
|
||||
";
|
||||
if let Ok(message) = connection.call_method(
|
||||
Some("org.gnome.Shell"),
|
||||
"/org/gnome/Shell",
|
||||
Some("org.gnome.Shell"),
|
||||
"Eval",
|
||||
&(code),
|
||||
"/com/k0kubun/Xremap",
|
||||
Some("com.k0kubun.Xremap"),
|
||||
"WMClass",
|
||||
&(),
|
||||
) {
|
||||
if let Ok((_actor, json)) = message.body::<(bool, String)>() {
|
||||
if let Ok(wm_class) = serde_json::from_str::<String>(&json) {
|
||||
if let Ok(wm_class) = message.body::<String>() {
|
||||
return Some(wm_class);
|
||||
}
|
||||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user