When installing ibus-keyman it could happen that we got an (ignored)
error "user name does not exist". This change tries to work around
this problem.
(cherry picked from commit 9d1004b9ec)
When the installation runs from `unattended-upgrade`, `$SUDO_USER`
and `$USER` will probably not be set.
Fixes#6983
(cherry picked from commit d99265b967)
This change fixes the ibus-keyman post install script which
previously failed if for whatever reason `SUDO_USER` is not set.
Fixes#6893
(cherry picked from commit 1f84299d08)
This change deals with restarting ibus in the post-install script.
Also, on Ubuntu 21.10 Impish there are two `ibus-daemon` processes
running for the current user. One of them has the `--xim` flag
and is the one we care about. This change improves the detection
that ibus is running in the post installation script.