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 @@
1
 docs/
1
 docs/
2
 target/
2
 target/
3
 CLAUDE.md
3
 CLAUDE.md
4
+flake.lock
gar/src/config/mod.rsmodified
@@ -374,9 +374,9 @@ wintypes:
374
                 // picom will be started by write_picom_config -> reload_picom
374
                 // picom will be started by write_picom_config -> reload_picom
375
             }
375
             }
376
             "garchomp" => {
376
             "garchomp" => {
377
-                // Kill any existing compositor first
377
+                // Kill any existing compositor first (use -f for NixOS wrappers)
378
-                let _ = Command::new("pkill").arg("picom").status();
378
+                let _ = Command::new("pkill").args(["-f", "picom"]).status();
379
-                let _ = Command::new("pkill").arg("garchomp").status();
379
+                let _ = Command::new("pkill").args(["-f", "garchomp"]).status();
380
 
380
 
381
                 std::thread::sleep(std::time::Duration::from_millis(100));
381
                 std::thread::sleep(std::time::Duration::from_millis(100));
382
 
382
 
@@ -395,9 +395,9 @@ wintypes:
395
             }
395
             }
396
             "none" => {
396
             "none" => {
397
                 tracing::info!("Compositor disabled (compositor=none)");
397
                 tracing::info!("Compositor disabled (compositor=none)");
398
-                // Kill any running compositor
398
+                // Kill any running compositor (use -f for NixOS wrappers)
399
-                let _ = Command::new("pkill").arg("picom").status();
399
+                let _ = Command::new("pkill").args(["-f", "picom"]).status();
400
-                let _ = Command::new("pkill").arg("garchomp").status();
400
+                let _ = Command::new("pkill").args(["-f", "garchomp"]).status();
401
             }
401
             }
402
             _ => {
402
             _ => {
403
                 tracing::warn!("Unknown compositor '{}', defaulting to picom", self.compositor);
403
                 tracing::warn!("Unknown compositor '{}', defaulting to picom", self.compositor);
@@ -411,8 +411,9 @@ wintypes:
411
     /// Stop any running compositor.
411
     /// Stop any running compositor.
412
     pub fn stop_compositor() {
412
     pub fn stop_compositor() {
413
         use std::process::Command;
413
         use std::process::Command;
414
-        let _ = Command::new("pkill").arg("picom").status();
414
+        // Use -f to match full command line (needed for NixOS wrappers)
415
-        let _ = Command::new("pkill").arg("garchomp").status();
415
+        let _ = Command::new("pkill").args(["-f", "picom"]).status();
416
+        let _ = Command::new("pkill").args(["-f", "garchomp"]).status();
416
     }
417
     }
417
 
418
 
418
     /// Apply screen timeout/DPMS settings using xset
419
     /// Apply screen timeout/DPMS settings using xset
gar/src/x11/events.rsmodified
@@ -2714,11 +2714,14 @@ impl WindowManager {
2714
         }
2714
         }
2715
         self.garnotify_process = None;
2715
         self.garnotify_process = None;
2716
 
2716
 
2717
-        // Kill picom to prevent compositor effects from bleeding into the greeter
2717
+        // Kill compositor to prevent overlay from bleeding into the greeter
2718
-        tracing::info!("Killing picom...");
2718
+        tracing::info!("Killing compositor...");
2719
+        // Use -f to match against full command line (needed for NixOS wrappers)
2719
         let _ = std::process::Command::new("pkill")
2720
         let _ = std::process::Command::new("pkill")
2720
-            .arg("-x")
2721
+            .args(["-f", "garchomp"])
2721
-            .arg("picom")
2722
+            .status();
2723
+        let _ = std::process::Command::new("pkill")
2724
+            .args(["-f", "picom"])
2722
             .status();
2725
             .status();
2723
 
2726
 
2724
         // Signal systemd that graphical session has ended
2727
         // Signal systemd that graphical session has ended