#!/bin/sh
# Context-aware pinentry wrapper
# Uses pinentry-curses for terminal sessions and pinentry-gtk for GUI sessions

# Check if we're in a graphical environment
if [ -n "$DISPLAY" ] || [ -n "$WAYLAND_DISPLAY" ]; then
    # GUI environment - use GTK pinentry
    exec /usr/bin/pinentry-gtk "$@"
else
    # Terminal environment - use curses pinentry
    exec /usr/bin/pinentry-curses "$@"
fi
