added WaitForDefaultClient
This commit is contained in:
parent
8c1df2310c
commit
f358112c7e
@ -70,6 +70,15 @@ func GetClients() ([]*Client, error) {
|
|||||||
return clients, nil
|
return clients, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func WaitForDefaultClient(ctx context.Context) (*Client, error) {
|
||||||
|
signature, ok := os.LookupEnv("HYPRLAND_INSTANCE_SIGNATURE")
|
||||||
|
if !ok {
|
||||||
|
return nil, errors.New("default instance not found because HYPRLAND_INSTANCE_SIGNATURE is not set")
|
||||||
|
}
|
||||||
|
|
||||||
|
return WaitForClient(ctx, signature)
|
||||||
|
}
|
||||||
|
|
||||||
func WaitForClient(ctx context.Context, signature string) (*Client, error) {
|
func WaitForClient(ctx context.Context, signature string) (*Client, error) {
|
||||||
lockFilePath := fmt.Sprintf("/run/user/1000/hypr/%s/hyprland.lock", signature)
|
lockFilePath := fmt.Sprintf("/run/user/1000/hypr/%s/hyprland.lock", signature)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user