1
0
Fork 0

Initial commit

This commit is contained in:
Henrik Hautakoski 2025-09-14 08:38:30 +02:00
commit 0245a5cb43
22 changed files with 610 additions and 0 deletions

23
engine/system/hypr.go Normal file
View file

@ -0,0 +1,23 @@
package system
import (
"os"
"path/filepath"
"strings"
)
func IsHyprland() bool {
// Primary signals
xdg := os.Getenv("XDG_RUNTIME_DIR")
his := os.Getenv("HYPRLAND_INSTANCE_SIGNATURE")
if xdg != "" && his != "" {
sock := filepath.Join(xdg, "hypr", his, ".socket.sock")
if st, err := os.Stat(sock); err == nil && !st.IsDir() {
return true
}
}
// Fallback: desktop hint
hint := strings.ToLower(os.Getenv("XDG_CURRENT_DESKTOP"))
return strings.Contains(hint, "hypr")
}