TheRepoClub-DotFiles/localbin/.local/bin/xterm

42 lines
1.4 KiB
Plaintext
Raw Normal View History

#!/usr/bin/env bash
#------------------------------------------------------------------------------
# Path - /usr/bin/xterm
# GitHub - https://github.com/The-Repo-Club/
# Author - The-Repo-Club [wayne6324@gmail.com]
# Start on - Sun 24 Oct 13:26:51 BST 2021
# Modified On - Sun 31 Oct 00:28:04 BST 2021
#------------------------------------------------------------------------------
run_terminal() {
Arg1=$1; shift; export ArgX=$@
if [ "$terminal" = "alacritty" ]; then
exec "$terminal" --title "$Arg1" --class "$Arg1,$Arg1" -e "$Arg1" "$ArgX"
elif [ "$terminal" = "kitty" ]; then
exec "$terminal" --title="$Arg1" --class="$Arg1" --name=$Arg1 -e "$Arg1" "$ArgX"
else
exec "$terminal" "$Arg1" "$ArgX"
fi
}
xterm () {
for terminal in "$TERMINAL" kitty alacritty terminator xfce4-terminal urxvt termit termite lxterminal terminology st konsole ; do
if command -v "$terminal" > /dev/null 2>&1; then
Arg1=$1; shift; Arg2=$1;
if command -v $Arg2 &> /dev/null; then
shift; export ArgX=$@
run_terminal "$Arg2" "$ArgX"
echo "$Arg2" "$ArgX"
exit 0
else
export ArgX=$@
run_terminal "$Arg1" "$ArgX"
echo "$Arg1" "$ArgX"
exit 0
fi
fi
done
}
xterm $@