mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-03-21 00:49:25 +01:00
perf(cli): validate komorebi proc earlier on start
This is a small change to the start command which moves the check for the komorebi processes to come a little bit earlier. This small change will make running commands like "komorebic start --bar" around 3s faster when komorebi is already running.
This commit is contained in:
@@ -1990,8 +1990,14 @@ fn main() -> Result<()> {
|
||||
)
|
||||
};
|
||||
|
||||
let mut system = sysinfo::System::new_all();
|
||||
system.refresh_processes(ProcessesToUpdate::All);
|
||||
|
||||
let mut attempts = 0;
|
||||
let mut running = false;
|
||||
let mut running = system
|
||||
.processes_by_name("komorebi.exe".as_ref())
|
||||
.next()
|
||||
.is_some();
|
||||
|
||||
while !running && attempts <= 2 {
|
||||
match powershell_script::run(&script) {
|
||||
@@ -2006,7 +2012,6 @@ fn main() -> Result<()> {
|
||||
print!("Waiting for komorebi.exe to start...");
|
||||
std::thread::sleep(Duration::from_secs(3));
|
||||
|
||||
let mut system = sysinfo::System::new_all();
|
||||
system.refresh_processes(ProcessesToUpdate::All);
|
||||
|
||||
if system
|
||||
|
||||
Reference in New Issue
Block a user