Automatic keyboard detection

[endlessm/eos-shell#3425]
`g_strdup` works fine on `NULL`