Initial commit
This commit is contained in:
commit
0245a5cb43
22 changed files with 610 additions and 0 deletions
23
engine/system/hypr.go
Normal file
23
engine/system/hypr.go
Normal 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")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue