diff --git a/usr/bin/exec-terminal b/usr/bin/exec-terminal index 6d1e5aa..ec77d8a 100644 --- a/usr/bin/exec-terminal +++ b/usr/bin/exec-terminal @@ -70,3 +70,27 @@ if [ -z "$terminal" ] || ! command -v "$terminal" &>/dev/null; then fi done fi + +if [ -z "$terminal" ]; then + notify-send -t 15000 --app-name=Garuda\ Linux "No terminal installed" "No supported terminal emulator is installed. Please install a terminal emulator like Alacritty." + exit 1 +fi + +# Special kgx, thanks gnome +if [ "$terminal" == "kgx" ]; then + sed -i '2i sleep 0.1' $initfile + echo 'kill -SIGINT $PPID' >>$initfile +fi + +eval "${terminals[${terminal}]}" || { + exitcode=$? +} + +rm "$initfile" +if [ "$codefile" != "$initfile" ]; then + rm "$codefile" +fi + +if [ ! -z "$exitcode" ] && [ "$exitcode" != 130 ]; then + exit 2 +fi