What desktop environment do you use? If Gnome, all you have to do is install the ibus package for pinyin input (I use ibus-libpinyin) and select it from the "Region and Language" menu in system settings. You can type the pinyin "nihao" and it will show a list of candidate characters underneath, pressing space chooses the current one, and you can use the arrow or number keys to select more.
The default shortcut for switching input methods is
<super> + space.
For Budgie the process is pretty similar. You will need to add the "keyboard layout indicator" applet to the panel after installing the ibus package. I am not sure about MATE but there are instructions in the help article I linked.
For KDE I got it to work by installing
ibus-libpinyin and setting the environment variables in
The easiest way to do this is run
kate /etc/environment and paste in the following lines:
Then save and exit, log in and log out, and it should work.
To get it to start automatically I run the command
ibus-daemon -drxR at startup.