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.

Revisions

  1. appleseedexm created this gist Jul 15, 2024.
    15 changes: 15 additions & 0 deletions set_hyprland_instance_signature.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    #!/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