Skip to content

Conversation

@BluePhi09
Copy link

Description

This pull request fixes a race condition during startup that causes Ambxst to fail to initialize correctly on the first launch.

The issue is caused by the daemon_priority.sh script, which is responsible for starting background services like litellm and easyeffects. This script is executed in the background by the main cli.sh script, which then immediately launches the quickshell UI.

The UI's QML components attempt to connect to the background services as soon as they are initialized. However, because the daemon_priority.sh script is running in parallel, the services are often not yet ready to accept connections. This results in connection failures and a broken user experience on the first start.

On subsequent launches, the services from the first launch are already running, so the UI can connect successfully.

Fix

This PR addresses the race condition by modifying the daemon_priority.sh script to wait for the services to become ready before exiting.

  • A wait_for_port function has been added to poll for a service on a given TCP port. This is used to wait for litellm to be ready on port 4000.
  • A sleep 1 command has been added after starting easyeffects to give it a moment to initialize, as it does not have a specific port to check.

These changes ensure that the background services are fully initialized before the UI attempts to connect to them, resolving the startup issue.

…tness values

this is necessary because brightnessctl returns more than one brightness values for some displays

fixes part of Axenide#29
@BluePhi09 BluePhi09 marked this pull request as draft January 27, 2026 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant