misc/qubes-run-gnome-terminal: avoid external utility (grep)

Shave off a few milliseconds.
This commit is contained in:
Rusty Bird 2020-01-31 16:34:03 +00:00
parent 076275c154
commit 9d9ef25b05
No known key found for this signature in database
GPG Key ID: 469D78F47AAF2ADF

View File

@ -5,8 +5,7 @@
# Check if our gnome-terminal version supports --wait
# (we can't just run it and check exit code, because if it works, it will
# return the exit code of the child process)
if gnome-terminal --help-terminal-options | grep --silent -- --wait; then
exec gnome-terminal --wait "$@"
else
exec gnome-terminal "$@"
fi
case "$(gnome-terminal --help-terminal-options)" in
*--wait*) exec gnome-terminal --wait "$@" ;;
*) exec gnome-terminal "$@" ;;
esac