xremap/src/client/hypr_client.rs
Yavor Kolev e75c0bae09
Update Hyprland-rs to 0.3.0 (#247)
* Update Hyprland-rs

* Remove needless serialize and deserializing

* Remove needless conversion of string
2023-02-18 23:23:12 -08:00

25 lines
536 B
Rust

use crate::client::Client;
use hyprland::{data::Client as HyprClient, prelude::*};
pub struct HyprlandClient;
impl HyprlandClient {
pub fn new() -> HyprlandClient {
HyprlandClient {}
}
}
impl Client for HyprlandClient {
fn supported(&mut self) -> bool {
true
}
fn current_application(&mut self) -> Option<String> {
if let Ok(win_opt) = HyprClient::get_active() {
if let Some(win) = win_opt {
return Some(win.class);
}
}
None
}
}