fix not working in systemd injection

This commit is contained in:
LeonardoTrapani
2025-10-10 19:27:52 +02:00
parent 8f94df4ad3
commit b437f575e6
4 changed files with 27 additions and 4 deletions
+10
View File
@@ -3,6 +3,7 @@ package injection
import (
"context"
"fmt"
"os"
"os/exec"
"time"
)
@@ -29,5 +30,14 @@ func checkWtypeAvailable() error {
return fmt.Errorf("wtype not found: %w (install wtype package)", err)
}
// Check for Wayland environment
if os.Getenv("WAYLAND_DISPLAY") == "" {
return fmt.Errorf("WAYLAND_DISPLAY not set - wtype requires Wayland session")
}
if os.Getenv("XDG_RUNTIME_DIR") == "" {
return fmt.Errorf("XDG_RUNTIME_DIR not set - wtype requires proper session environment")
}
return nil
}