@@ -67,13 +67,21 @@ impl BorderManager { |
| 67 | } | 67 | } |
| 68 | | 68 | |
| 69 | /// Spawn ers with current settings. Kills any existing instance first. | 69 | /// Spawn ers with current settings. Kills any existing instance first. |
| | 70 | + /// Looks for ers next to the tarmac binary first, then falls back to PATH. |
| 70 | pub fn spawn(&mut self) { | 71 | pub fn spawn(&mut self) { |
| 71 | self.kill(); | 72 | self.kill(); |
| 72 | if !self.is_enabled() { return; } | 73 | if !self.is_enabled() { return; } |
| 73 | | 74 | |
| | 75 | + let ers_bin = std::env::current_exe() |
| | 76 | + .ok() |
| | 77 | + .and_then(|p| p.parent().map(|d| d.join("ers"))) |
| | 78 | + .filter(|p| p.exists()) |
| | 79 | + .map(|p| p.to_string_lossy().to_string()) |
| | 80 | + .unwrap_or_else(|| "ers".to_string()); |
| | 81 | + |
| 74 | let cmd = format!( | 82 | let cmd = format!( |
| 75 | - "ers --active-only --width {} --radius {} --color '{}' --inactive '{}'", | 83 | + "{} --active-only --width {} --radius {} --color '{}' --inactive '{}'", |
| 76 | - self.border_width, self.radius, | 84 | + ers_bin, self.border_width, self.radius, |
| 77 | self.focused_color.to_hex(), self.unfocused_color.to_hex(), | 85 | self.focused_color.to_hex(), self.unfocused_color.to_hex(), |
| 78 | ); | 86 | ); |
| 79 | tracing::debug!(cmd, "spawning ers"); | 87 | tracing::debug!(cmd, "spawning ers"); |