mirror of
https://github.com/2e3s/awatcher.git
synced 2025-06-07 03:55:29 +00:00
Skip KWin watcher if X11 is detectable
This commit is contained in:
parent
451346901d
commit
8eed243593
@ -7,7 +7,7 @@ use super::Watcher;
|
|||||||
use crate::report_client::ReportClient;
|
use crate::report_client::ReportClient;
|
||||||
use anyhow::{anyhow, Context};
|
use anyhow::{anyhow, Context};
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use std::env::temp_dir;
|
use std::env::{self, temp_dir};
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::sync::{mpsc::channel, Arc};
|
use std::sync::{mpsc::channel, Arc};
|
||||||
use std::thread;
|
use std::thread;
|
||||||
@ -175,6 +175,12 @@ impl Watcher for WindowWatcher {
|
|||||||
debug!("KWin script is already loaded, unloading");
|
debug!("KWin script is already loaded, unloading");
|
||||||
kwin_script.unload().await?;
|
kwin_script.unload().await?;
|
||||||
}
|
}
|
||||||
|
if env::var("WAYLAND_DISPLAY").is_err()
|
||||||
|
&& env::var_os("XDG_SESSION_TYPE").unwrap_or("".into()) == "x11"
|
||||||
|
{
|
||||||
|
return Err(anyhow!("X11 should be tried instead"));
|
||||||
|
}
|
||||||
|
|
||||||
kwin_script.load().await.unwrap();
|
kwin_script.load().await.unwrap();
|
||||||
|
|
||||||
let active_window = Arc::new(Mutex::new(ActiveWindow {
|
let active_window = Arc::new(Mutex::new(ActiveWindow {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user