Skip to content

Instantly share code, notes, and snippets.

@appleseedexm
Created July 15, 2024 11:17
Show Gist options
  • Save appleseedexm/4e20d39ba03f03f05503a9de95c367b6 to your computer and use it in GitHub Desktop.
Save appleseedexm/4e20d39ba03f03f05503a9de95c367b6 to your computer and use it in GitHub Desktop.
Set Hyprland instance signature based of found instances
#!/bin/sh
get_instance_line() {
hyprctl instances | grep -i instance
}
INSTANCE_COUNT=$(get_instance_line | grep -c instance)
if [ $INSTANCE_COUNT -eq "1" ]; then
export HYPRLAND_INSTANCE_SIGNATURE=$(get_instance_line | grep -o -E '[a-zA-Z0-9_]+')
printf "Instance signature set to %s\n" "$HYPRLAND_INSTANCE_SIGNATURE"
else
printf "Found %s instances, unable to set instance signature.\n" "$INSTANCE_COUNT"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment