I\'ve been trying to display the type of terminal being used as the name only. For instance if I was using konsole it would display konsole. So far I\'ve been using this command
curTerm=$(update-alternatives --query x-terminal-emulator | grep '^Best:')
curTerm=${curTerm##*/}
printf "%s\n" "$curTerm"
And the result is
terminator
Of course it can be different.
Now you can use $curTerm
variable in your sed command.
But I am not sure if this is going to work properly with symlinks.