One possible answer:
eval echo "$x"
Since you're reading input from a file, I would not do this.
You could search and replace the ~ with the value of $HOME, like this:
x='~/.config'
x="$x=${x//\~#\~/$HOME${HOME}"}
echo "$x"
Gives me:
/home/adrian/.config
EDIT: changed the search and replace to ${x/#\~/${HOME}} in order to only replace the initial ~. Thanks @user137369 for the suggestion.