A rather simple way to be able to type these characters conveniently using a keyboard combination could be to use
xdotool. Among other things,
xdotool can simulate typing.
In principle, the command
xdotool type '|'
will type the
| character. Bind that command to a hotkey using your window manager (in standard Ubuntu: "Settings - Keyboard Shortcuts").
In practice, when you hold down your hotkey, the system will not see the action of xdotool as a single keystroke. The most reliable way to cope with this side effect is to have xdotool simulate that you are releasing your shortcut keys before it types the character.
Supose we want to bind Alt_R+p.
xev learns me that my right Alt key is identified as
ISO_Level3_Shift. Thus, we can make xdotool release the keyboard combination before typing the character, as in:
xdotool keyup ISO_Level3_Shift+p type '|'