On Ubuntu 20.04 Focal ibus gets started by a shell command so that we
end up with two processes mentioning `ibus-daemon`. This change limits
the search to processes that specify with full path to `ibus-daemon` or
without path, but `ibus-daemon` has to be the command, not a parameter.
IBus around version 1.5.28 introduced the `start` subcommand for `ibus`.
If available we use that because that starts `ibus-daemon` with the
correct arguments. If the available IBus version is too old we use
our previous code where we pass arguments to `ibus-daemon` which might
be different from how ibus gets started on that system otherwise.
If we can't create the cache dir, e.g. if `~/.cache` doesn't exist or
if we don't have enough permissions, we now return a temporary directory.
Fixes#10033.
1. Fcitx does not need restart to load newly installed keyman keyboard
2. Restart fcitx may cause issue on kwin/weston Wayland where input
method have to be spawned by compositor process.
Ubuntu 20.04 comes with Python 3.8 which doesn't have
`platform.freedesktop_os_release()`. This change catches the exception
if this happens, as well as other exceptions we might get so that the
initialization of Sentry will succeed.
Fixes#9773.
- during installation add to the list of custom keyboards if necessary
- during uninstallation remove from the list of custom keyboards
- if list of custom keyboards has invalid values, remove those before
saving the list
Closes#8598.
This change adds additional details to Sentry events so that the "All
Events" tab on keyman.sentry.io will show helpful values in the
"device" and "os" columns instead of emptry strings.
The `hash` method that we previously used calculates the hash based on
the memory location, i.e. with each program run we get a different value
for the same user. This change now uses the md5 algorithm so that the
same user always produces the same hash.
Usually this is done automatically. However, if e.g. no `DISPLAY` variable
is set it'll fail. When we explicitly initialize GTK it still fails, but
shows a more helpful warning instead of throwing a runtime error.
Fixes#9705.
When running on Ubuntu 20.04 Focal, one of the Python dependencies
loads the `unittest` module so that running `km-config` output the
message that Sentry would be disabled because unit tests are running.
This change now uses the callstack to check if we're running unit
tests.
Fixes#9577.
This works around the issue where browsers installed as snap package
can't access files under `$HOME/.local`. Instead we now only open
external links with the browser. Local non-html files we open with
the default app, and links to local html file we open in webview
(like we did previously with `welcome.htm` files).
Fixes#9600.
This change fixes an exception that occurs if the user specifies
an outputfile in a non-existing directory. Also catch several other
related exceptions.
Fixes#9522.
This change reworks the output we show if the user tries to
uninstall a non-existing keyboard. This could be trying to uninstall
a shared keyboard when a user keyboard exists and vice versa. This
change rewords the message to include the area (shared/user), so
hopefully this makes it a bit clearer. We also now output this as a
warning instead of an error.
Completely suppressing the message as suggested in #9213 doesn't seem
to be the right way as that would lead to the user blaming uninstall
to not work when the real reason are wrong parameters.
Closes#9213.
We can't initialize Sentry during module initialization because our
`initialize_sentry` logs some status info. Setting the logging level
later on is then a no-op, breaking verbose and very-verbose logging.
This change fixes this by putting Sentry initialization into a
separate method that gets called after we set the log level.
Also refactor some common code into methods that appear in all our
executables.