testing ghostty and lock update, which results in some build errors. rocmrocmrocm

This commit is contained in:
cnst
2024-12-28 15:06:50 +01:00
parent 3fb3398f59
commit 76e1fb5028
16 changed files with 398 additions and 135 deletions

View File

@@ -1,13 +1,11 @@
# Define TERMINAL if not set
TERMINAL="${TERMINAL:-foot}"
# Path to the tuirun executable
TUIRUN_PATH="/etc/profiles/per-user/$USER/bin/tuirun"
# Use absolute paths for commands
PGREP="/run/current-system/sw/bin/pgrep"
PKILL="/run/current-system/sw/bin/pkill"
HYPRCTL="/etc/profiles/per-user/$USER/bin/hyprctl"
UWSM="/run/current-system/sw/bin/uwsm"
TUIRUN_PATH="/etc/profiles/per-user/$USER/bin/tuirun"
# Determine OPTIONS based on TERMINAL
if [ "$TERMINAL" = "foot" ]; then
@@ -20,17 +18,20 @@ fi
# Matching pattern for the process
MATCH_PATTERN="$TERMINAL --title tuirun"
if "$PGREP" -f "$MATCH_PATTERN" >/dev/null; then
echo "$(date): Killing existing process"
"$PKILL" -f "$MATCH_PATTERN"
else
# Construct the command
CMD="$TERMINAL --title tuirun"
# Log the environment for debugging
env >/tmp/script_env.txt
# Construct the command as an array for proper argument handling
CMD=("$TERMINAL" "--title" "tuirun")
if [ -n "$OPTIONS" ]; then
CMD="$CMD $OPTIONS"
CMD+=("$OPTIONS")
fi
CMD="$CMD -e $TUIRUN_PATH"
CMD+=("-e" "$TUIRUN_PATH")
# Launch the terminal with OPTIONS
"$HYPRCTL" dispatch exec "$CMD"
echo "$(date): Executing command: ${CMD[*]}"
# Use eval to expand the command or pass the arguments directly
"$UWSM" app -- "${CMD[@]}"
fi