mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-03-26 19:31:16 +01:00
fix(scoop): account for all shims on startup check
This commit fixes a bug with the startup check which tries to ensure that there is only ever one instance of komorebi running at any given time. Previously, only one shim was being checked for, but if a user runs 'komorebic start' multiple times, multiple shims will be active, causing the check to mistakenly pass. The changes in this commit now account for N active shims.
This commit is contained in:
@@ -386,14 +386,14 @@ fn main() -> Result<()> {
|
||||
let matched_procs: Vec<&Process> = system.processes_by_name("komorebi.exe").collect();
|
||||
|
||||
if matched_procs.len() > 1 {
|
||||
let mut shim_is_active = false;
|
||||
let mut len = matched_procs.len();
|
||||
for proc in matched_procs {
|
||||
if proc.root().ends_with("shims") {
|
||||
shim_is_active = true;
|
||||
len -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
if !shim_is_active {
|
||||
if len > 1 {
|
||||
tracing::error!("komorebi.exe is already running, please exit the existing process before starting a new one");
|
||||
std::process::exit(1);
|
||||
}
|
||||
|
||||
@@ -188,8 +188,8 @@ WorkspaceCustomLayout(monitor, workspace, path) {
|
||||
Run, komorebic.exe workspace-custom-layout %monitor% %workspace% %path%, , Hide
|
||||
}
|
||||
|
||||
WorkspaceLayoutRule(monitor, workspace, at_container_count, default_layout) {
|
||||
Run, komorebic.exe workspace-layout-rule %monitor% %workspace% %at_container_count% %default_layout%, , Hide
|
||||
WorkspaceLayoutRule(monitor, workspace, at_container_count, layout) {
|
||||
Run, komorebic.exe workspace-layout-rule %monitor% %workspace% %at_container_count% %layout%, , Hide
|
||||
}
|
||||
|
||||
WorkspaceCustomLayoutRule(monitor, workspace, at_container_count, path) {
|
||||
|
||||
Reference in New Issue
Block a user