Mac OS X has a feature where it displays a list of possible accented characters when you hold a key for a few seconds. The problem is that it does not let you choose which characters are available. However the UX is very good.
Software like PopCharX or Characters can come in handy. But they are not open source nor free software.
Find a solution that makes it quick and easy to type diacritics without changing keyboard layouts and without copy and pasting.