If I understand correctly, you're running the script directly from a GUI environment, not from inside a terminal.
The terminal is what provides the script a way to receive input. If you run the script from the GUI via a menu entry or a keyboard shortcut, the script's input is connected to nothing (this nothing is called
/dev/null), so when you ask to read a line, the
read command says that there is nothing to read (end of file).
You have two solutions: change the way you call your script, or change your script. The former is simpler and allows your script to be executed inside a terminal sometimes. The latter is more complex but more flexible.
You can easily change your script to run in a terminal. Instead of setting a keyboard shortcut for
/path/to/script, set a keyboard shortcut for
xterm -e /path/to/script or
gnome-terminal -e /path/to/script or whatever terminal emulator you prefer. The terminal window will appear as soon as you press the key and will disappear when your script terminates.
Alternatively, you can change your script to read input through a GUI window instead of from its standard input. Zenity is a common choice for this (there's an Ubuntu package Install zenity http://bit.ly/software-small). Inside your script, you can use
[ -t 0 ] to test whether it's running in a terminal.
if [ -t 0 ]; then
echo "What is your favorite color?"
read -r color
color=$(zenity --entry --text "What is your favorite color?")