Files
sxmo-utils/scripts/core/sxmo_dmenu_with_kb.sh
2022-03-15 08:00:00 -04:00

21 lines
349 B
Bash
Executable File

#!/bin/sh
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2022 Sxmo Contributors
if [ -n "$WAYLAND_DISPLAY$DISPLAY" ]; then
if sxmo_keyboard.sh isopen; then
wasopen="1"
fi
sxmo_keyboard.sh open
fi
OUTPUT="$(cat | sxmo_dmenu.sh "$@")"
exitcode=$?
if [ -z "$wasopen" ]; then
sxmo_keyboard.sh close
fi
printf %s "$OUTPUT"
exit $exitcode