This change allows to collect data for a diagnostic report. This can be
done either from the command line through the new `km-diag-report` tool,
or in `km-config` from the new `Support` tab that allows to generate the
report and then copy it to the clipboard or save as a file.
The diagnostic report contains installed browsers and their versions and
installation methods as well as the default browser. It checks for
browsers installed through apt (Ubuntu/Debian), snap, and flatpak.
The change also has an implementation for pacman (Arch Linux) and
dnf/yum (Fedora), although these have not been tested.
Fixes: #7784
Installing into the shared area (`/usr/local/share`) requires `root`
permissions, so in order to install into the shared area the user has
to call `km-package-install` with `sudo`. But we also want to add the
keyboard to the user's list of available keyboards so that he can
switch to it. That needs to be done in the user context. However,
when `sudo` ran the command in the user context, the environment
variables to connect to the user's session dbus were not set.
This change fixes this by passing `DBUS_SESSION_BUS_ADDRESS` along
with the `sudo -u <user>` call. Since `root` doesn't have this variable
set (or at least not pointing to the user's dbus), we construct the
dbus address based on the user's uid.
On newer Ubuntu versions (>=25.04) we also have to set `XDG_RUNTIME_DIR`,
at least when running the autopkgtests.
Fixes: #14911
Some keyboards seem to be missing the `keyboards` section in the
`kmp.json` file. This change prevents a crash and instead returns `None`
and thus we don't create a .ldml file and so onboard will show the
default keyboard instead. The alternative would be to create an empty
.ldml file, but that causes onboard to show a keyboard with all key caps
being empty.
Fixes: #14707
Fixes: KEYMAN-LINUX-8P
Test-bot: skip
This fixes a bug where a keyboard didn't show up in the language dropdown
if the first language it specified wasn't a normalized language tag.
Previously in that case we added a custom keyboard with whatever language
tag the keyboard specified. With this change we now continue to use
the first language of the first keyboard but normalize it. Since the
selection of the language now happens a little earlier it is slightly
possible that there will be unexpected side effects that didn't show up
in my testing.
Fixes: #14465
This changes the shebang at the top of the file to allow use Python
from a virtual environment instead of hard-coding the path. This might
not be strictly necessary, but reduces confusion and doesn't hurt.
The 2025-02-18 release of langtags.json includes tag data for sa-Latn
and he-Latn, so tests related to those tags now need to account for
region.
Fixes: #13288
This change rename the test files for Linux according to the discussion
at the Keyman conference in November 2024.
Python is pretty opinionated about the naming of files, so we have to
use `*_tests.py` as test filename instead of the usual `*.tests.py`.
Names can be Unicode strings or byte arrays. This change allows for both
kinds. Also properly deal with the case when we can't get the name from
the .ttf file. And finally change the test so that we don't need the
`KbdKhmr.ttf` font.
This change adds the `keymanFacename` attribute based on UnicodeFont
or AnsiFont to the root element of the generated .ldml file so that
onboard-keyman can display the proper font for the osk.
Fixes: #12019
This suddenly started failing. I guess there was a deprecated
`assertEquals` in older Python libraries, but with the latest version in
Ubuntu 24.04 Noble this disappeared. Anyway, with this change we use
the same assert method as in the other test files.
This change improves the way we detect if we're running a Gnome based
UI that needs it's keyboards installed under
`org.gnome.desktop.input-sources`. We use the environment variable
`XDG_CURRENT_DESKTOP` and check if it contains the word `gnome`.
Additionally this change renames `is_gnome_shell()` to
`is_gnome_desktop()`.
Fixes#11225.
When we launch dbus if it is not running, we're probably (un-)installing
keyboards for a different user. This is an unusual environment where not
everything is available, e.g. dconf-service won't be running and can't
be started because DISPLAY variable is not set. This means we can't
write gsettings values through the API. However, we can read them, and we
can write a keyfile and update the database. This is what this change
implements for the cases where we started dbus.
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.
- 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.
After this change uninstalling a keyboard will remove all installed
language/keyboard combinations for that particular keyboard.
Previously we only uninstalled for the first language listed in the
keyboard.
This change refactors and cleans uninstall:
- rename methods to make it clear which ones are private/protected
- extract common code
- improve error reporting
- Introduce `InstallKmp` class
- Remove unused `list_files` method
- Extract common method that `install_kmp_shared` and
`install_kmp_user` use
- Make internal methods protected
This improves the implementation for normalizing language tags
when installing a keyboard. Based on the Windows implementation
in `Keyman.System.CanonicalLanguageCodeUtils.pas`.
One difference to the Windows implementation is that the mapping of
3- to 2-letter tags is based on `langtags.json` instead of
`iso639-3.tab`.
Closes#3399.
When installing a keyboard with a bcp47 tag we now look up the
language tag in the keyboard kmp.json file. This fixes#3399 in
case a script subtag is required for the language and will cause
the keyboard to properly show up in the Linux keyboard selection
list.