I’m always using a US keyboard. However, I still often need to write french text with those keyboards, hence needing accents. Of course, I don’t like when what’s written on the keyboard doesn’t match what it does :-)
This provides a custom US keyboard layout for Linux, using unintrusive deadkeys for accents.
On classical linux, there is an international version of the US layout. However, it modifies “standard” behaviour; i.e., if you want to do a double quote, you need to press it twice because in this intl layout, it is, by default, a dead key. Same applies for a couple of other symbols, such as the simple quote or tilde. So, I’ve made a custom version of the US layout, providing easy access to accent through alt-gr (both with dead keys and common accents in french), but without modifying standard behaviour of keys.
It’s partly based on us-intl, with deadkeys removed from default bindings, and the following bindings added (mainly):
altgr-`: dead grave accent
altgr-': dead acute accent
altgr-^: dead circonflex accent
altgr-": dead diaresis
Using setxkbmap, you need to copy the file
us-custom file to
/usr/share/X11/xkb/symbols and then just do:
Otherwise, with xmodmap, just get the file
us-modmap and run:
(I think xmodmap is supposed to be deprecated ; xmodmap version might not work with recent versions of ubuntu. Both mapping are slightly different but the main shortcuts are the same)