#!/bin/bash # Focuses the existing OpenRGB GUI window if one is already open, # otherwise starts a new GUI (which connects to the headless # autostart server instead of spawning a duplicate server instance). if hyprctl clients -j | jq -e '.[] | select(.class == "openrgb")' > /dev/null; then exec hyprctl dispatch focuswindow "class:^(openrgb)$" 2>/dev/null else exec /usr/bin/openrgb fi