Addresses multiple issues related to GTK4 Layer Shell initialization and Ollama integration. - Reorders initialization to ensure the layer shell is set up before window properties. - Adds error detection for layer shell initialization failures. - Implements a focus event handler to prevent focus-out warnings. - Introduces a launcher script to activate the virtual environment, force native Wayland, and preload the GTK4 Layer Shell library. - Warns users of incorrect GDK_BACKEND settings. - Updates the Ollama client to handle responses from both older and newer versions of the Ollama SDK. These changes improve the application's stability, compatibility, and functionality on Wayland systems.
20 lines
585 B
Bash
Executable File
20 lines
585 B
Bash
Executable File
#!/bin/bash
|
|
# Launcher script for Niri AI Sidebar with proper Wayland configuration
|
|
|
|
# Get the directory where this script is located
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
|
|
# Activate virtual environment if it exists
|
|
if [ -f "$SCRIPT_DIR/.venv/bin/activate" ]; then
|
|
source "$SCRIPT_DIR/.venv/bin/activate"
|
|
fi
|
|
|
|
# Force GTK to use native Wayland backend (not XWayland)
|
|
export GDK_BACKEND=wayland
|
|
|
|
# Preload GTK4 Layer Shell library to ensure proper initialization
|
|
export LD_PRELOAD=/usr/lib/libgtk4-layer-shell.so
|
|
|
|
# Run the application
|
|
exec python3 "$SCRIPT_DIR/main.py" "$@"
|