gardesk/gar / 8661e62

Browse files

fix compositor kill: use pkill -f for NixOS wrappers, kill garchomp on exit

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
8661e62f824ad214065773a508140c9529baa455
Parents
772a119
Tree
0d1f974

3 changed files

StatusFile+-
M .gitignore 1 0
M gar/src/config/mod.rs 9 8
M gar/src/x11/events.rs 7 4
.gitignoremodified
@@ -1,3 +1,4 @@
11
 docs/
22
 target/
33
 CLAUDE.md
4
+flake.lock
gar/src/config/mod.rsmodified
@@ -374,9 +374,9 @@ wintypes:
374374
                 // picom will be started by write_picom_config -> reload_picom
375375
             }
376376
             "garchomp" => {
377
-                // Kill any existing compositor first
378
-                let _ = Command::new("pkill").arg("picom").status();
379
-                let _ = Command::new("pkill").arg("garchomp").status();
377
+                // Kill any existing compositor first (use -f for NixOS wrappers)
378
+                let _ = Command::new("pkill").args(["-f", "picom"]).status();
379
+                let _ = Command::new("pkill").args(["-f", "garchomp"]).status();
380380
 
381381
                 std::thread::sleep(std::time::Duration::from_millis(100));
382382
 
@@ -395,9 +395,9 @@ wintypes:
395395
             }
396396
             "none" => {
397397
                 tracing::info!("Compositor disabled (compositor=none)");
398
-                // Kill any running compositor
399
-                let _ = Command::new("pkill").arg("picom").status();
400
-                let _ = Command::new("pkill").arg("garchomp").status();
398
+                // Kill any running compositor (use -f for NixOS wrappers)
399
+                let _ = Command::new("pkill").args(["-f", "picom"]).status();
400
+                let _ = Command::new("pkill").args(["-f", "garchomp"]).status();
401401
             }
402402
             _ => {
403403
                 tracing::warn!("Unknown compositor '{}', defaulting to picom", self.compositor);
@@ -411,8 +411,9 @@ wintypes:
411411
     /// Stop any running compositor.
412412
     pub fn stop_compositor() {
413413
         use std::process::Command;
414
-        let _ = Command::new("pkill").arg("picom").status();
415
-        let _ = Command::new("pkill").arg("garchomp").status();
414
+        // Use -f to match full command line (needed for NixOS wrappers)
415
+        let _ = Command::new("pkill").args(["-f", "picom"]).status();
416
+        let _ = Command::new("pkill").args(["-f", "garchomp"]).status();
416417
     }
417418
 
418419
     /// Apply screen timeout/DPMS settings using xset
gar/src/x11/events.rsmodified
@@ -2714,11 +2714,14 @@ impl WindowManager {
27142714
         }
27152715
         self.garnotify_process = None;
27162716
 
2717
-        // Kill picom to prevent compositor effects from bleeding into the greeter
2718
-        tracing::info!("Killing picom...");
2717
+        // Kill compositor to prevent overlay from bleeding into the greeter
2718
+        tracing::info!("Killing compositor...");
2719
+        // Use -f to match against full command line (needed for NixOS wrappers)
27192720
         let _ = std::process::Command::new("pkill")
2720
-            .arg("-x")
2721
-            .arg("picom")
2721
+            .args(["-f", "garchomp"])
2722
+            .status();
2723
+        let _ = std::process::Command::new("pkill")
2724
+            .args(["-f", "picom"])
27222725
             .status();
27232726
 
27242727
         // Signal systemd that graphical session has ended