core-agent-linux/misc/qubes-run-terminal
Rusty Bird 5ad945b674
misc/qubes-run-terminal: which -> type
'which' is an external tool, 'type' is a shell builtin. Using the latter
shaves off a bit of latency.

Also use the already open stderr file descriptor for redirection.
2018-08-28 10:54:09 +00:00

13 satır
462 B
Bash
Çalıştırılabilir Dosya

#!/bin/sh
# Try to find a terminal emulator that's installed and run it.
for terminal in x-terminal-emulator gnome-terminal xfce4-terminal konsole urxvt rxvt termit terminator Eterm aterm roxterm termite lxterminal mate-terminal terminology st xterm; do
# bogus warning from ShellCheck < 0.5.0
# shellcheck disable=SC2039
if type "$terminal" >/dev/null 2>&1 ; then
exec "$terminal"
fi
done
echo "ERROR: No suitable terminal found." >&2