Skip to content

Instantly share code, notes, and snippets.

@bscott
Created October 3, 2025 00:57
Show Gist options
  • Select an option

  • Save bscott/32a9a5aa6381b98fc86b2ccfde1d21b4 to your computer and use it in GitHub Desktop.

Select an option

Save bscott/32a9a5aa6381b98fc86b2ccfde1d21b4 to your computer and use it in GitHub Desktop.

Revisions

  1. bscott created this gist Oct 3, 2025.
    57 changes: 57 additions & 0 deletions restart-walker.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,57 @@
    #!/usr/bin/env bash
    #
    # Walker Service Restart Script
    # Addresses: https://github.com/basecamp/omarchy/issues/2089
    #
    # This script kills and restarts the Walker service which powers
    # the Omarchy application launcher when it becomes unresponsive.

    set -e

    echo "πŸ” Checking for Walker process..."

    # Find Walker process ID
    WALKER_PID=$(pgrep -x walker || true)

    if [ -z "$WALKER_PID" ]; then
    echo "⚠️ Walker is not running"
    echo "πŸš€ Starting Walker..."
    /usr/bin/walker --gapplication-service &
    echo "βœ… Walker started successfully (PID: $!)"
    exit 0
    fi

    echo "πŸ“ Found Walker process (PID: $WALKER_PID)"
    echo "πŸ›‘ Killing Walker process..."

    # Kill the process gracefully first
    kill "$WALKER_PID" 2>/dev/null || true

    # Wait up to 5 seconds for graceful shutdown
    for i in {1..5}; do
    if ! ps -p "$WALKER_PID" > /dev/null 2>&1; then
    echo "βœ… Walker stopped gracefully"
    break
    fi
    sleep 1
    done

    # Force kill if still running
    if ps -p "$WALKER_PID" > /dev/null 2>&1; then
    echo "⚑ Force killing Walker..."
    kill -9 "$WALKER_PID" 2>/dev/null || true
    sleep 1
    fi

    echo "πŸš€ Restarting Walker..."
    /usr/bin/walker --gapplication-service &
    NEW_PID=$!

    sleep 1

    if ps -p "$NEW_PID" > /dev/null 2>&1; then
    echo "βœ… Walker restarted successfully (PID: $NEW_PID)"
    else
    echo "❌ Failed to restart Walker"
    exit 1
    fi