Commit graph

723 commits

Author SHA1 Message Date
Eberhard Beilharz
42fd48c808
fix(linux): Improve error values 2024-02-29 18:54:25 +01:00
Eberhard Beilharz
8ff35c8657
fix(linux): fix regex to detect running ibus-daemon
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.
2024-02-26 18:40:23 +01:00
Eberhard Beilharz
d396a397e3
chore(linux): Use ibus start if available
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.
2024-02-26 16:34:46 +01:00
Eberhard Beilharz
5e661c4196
fix(linux): When starting km-package-install verify that ibus-daemon is running 2024-02-26 16:34:45 +01:00
Eberhard Beilharz
131d4989ec
fix(linux): When starting km-config verify that ibus-daemon is running 2024-02-26 16:34:44 +01:00
Eberhard Beilharz
8c8d339bb1
refactor(linux): Change verify_ibus_daemon to return a state 2024-02-26 16:34:44 +01:00
Eberhard Beilharz
4bad36089f
fix(linux): Use temp dir if we can't create cache dir
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.
2024-02-09 18:01:40 +01:00
Eberhard Beilharz
6722faab4d
fix(linux): Use raw string for regex
This change fixes a syntax warning with Python 3.12. See
https://stackoverflow.com/a/50504635/487503 and
https://docs.python.org/3/whatsnew/3.12.html#other-language-changes.
2024-02-06 17:01:59 +01:00
Eberhard Beilharz
29c71253db
chore(core): Update debian package to use webkit2 4.1
Ubuntu 20.04 Focal doesn't have webkit2 4.1. The API is the same as
with 4.0, so we use that if we can't find 4.1.
2024-01-24 16:47:22 +01:00
Jeremy Bícha
7ea8d9648b chore(linux): Build with webkitgtk 4.1 instead of 4.0 2024-01-23 14:40:57 -05:00
Eberhard Beilharz
5069d8c67b
chore(linux): Small refactoring to make it easier to read 2023-12-08 18:50:38 +01:00
Weng Xuetian
4517c03f1d
Do not restart Fcitx
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.
2023-12-07 13:41:21 -08:00
Eberhard Beilharz
3cc016fc8a
fix(linux): Fix uninstallation of shared keyboard
This fixes the uninstallation of shared keyboards if the
`additional-keyboards` settings doesn't exist yet.

Closes #9879.
2023-10-27 19:26:35 +02:00
Eberhard Beilharz
09907b66e0
chore(linux): Additionally specify regular schemas path 2023-10-18 18:20:48 +02:00
Eberhard Beilharz
4a3556ca89
chore(linux): Allow to collect coverage on TC 2023-10-18 16:06:28 +02:00
Eberhard Beilharz
f178959c02
Merge pull request #9774 from keymanapp/fix/linux/9773_python3.8
fix(linux): Fix crash initializing Sentry with Python < 3.10
2023-10-17 18:02:39 +02:00
Eberhard Beilharz
91e731a955
Merge pull request #9756 from keymanapp/feat/linux/8598_kmconfig
feat(linux): Allow installing keyboards with arbitrary language 🏘️
2023-10-17 18:02:19 +02:00
Eberhard Beilharz
a76945615b
Merge pull request #9735 from keymanapp/feat/linux/8598_arbitrary-lang
feat(linux): Allow loading of keyboards with arbitrary language 🏘️
2023-10-16 19:48:56 +02:00
Eberhard Beilharz
d7a72e6baf
fix(linux): Fix crash initializing Sentry with Python < 3.10
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.
2023-10-16 18:44:18 +02:00
Eberhard Beilharz
c56b8a72eb
chore(linux): rename parameters
This addresses code review comments.
2023-10-16 09:12:28 +02:00
Eberhard Beilharz
23cc98a690
feat(linux): Allow installing keyboards with arbitrary language 🏘️
- 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.
2023-10-13 16:57:57 +02:00
Eberhard Beilharz
303e57ba68
refactor(linux): Refactor mocks in ibus-util tests 2023-10-12 18:45:12 +02:00
Eberhard Beilharz
d92808e779
chore(linux): Speed up ibus-util tests 2023-10-12 18:34:50 +02:00
Eberhard Beilharz
2a7d1758ae
feat(linux): Store user-added keyboards in GSettings 🏘️ 2023-10-12 18:31:41 +02:00
Eberhard Beilharz
4ad730d6f6
chore(linux): Add code coverage report for keyman-config 2023-10-12 10:21:11 +02:00
Eberhard Beilharz
405f2e8243
Merge pull request #9725 from keymanapp/chore/linux/sentrydetails
chore(linux): Improve Sentry reports
2023-10-10 15:06:35 +02:00
Eberhard Beilharz
1dd3eae01a
chore(linux): Add more details to Sentry events
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.
2023-10-09 11:44:24 +02:00
Eberhard Beilharz
9650b3f0a2
fix(linux): Fix calculation of user hash
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.
2023-10-09 11:42:19 +02:00
Eberhard Beilharz
2e4dd10522
fix(linux): Explicitly initialize GTK
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.
2023-10-06 16:50:30 +02:00
Darcy Wong
040e41a8f6
Merge pull request #9550 from keymanapp/chore/common/crowdin-mon
chore(common): Add Crowdin strings for Mon
2023-09-28 16:03:34 +07:00
Eberhard Beilharz
b2084930af
fix(linux): Fix detection of unit tests
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.
2023-09-21 12:02:33 +02:00
Eberhard Beilharz
b764a1c965
fix(linux): Correctly open files linked from help page
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.
2023-09-20 11:49:53 +02:00
Eberhard Beilharz
a03eca3d81
refactor(linux): Rename defines to clarify purpose 🏘️ 2023-09-18 19:00:29 +02:00
Darcy Wong
427459ce29 chore(common): Add crowdin strings for Mon 2023-09-12 13:05:44 +07:00
Eberhard Beilharz
456254a896
chore(linux): Log if user not set 2023-09-11 18:21:36 +02:00
Eberhard Beilharz
ffa3324be2 fix(linux): Prevent exception if neither USER, LOGNAME nor SUDO_USER set
Closes #9542.
2023-09-05 09:17:10 +02:00
Eberhard Beilharz
aaef0f3c7f
chore(linux): Add clean target to rules
This allows to completely cleanup after a package build. Also fixes
`keyman-config/build.sh` to do a better job with clean.

Fixes #9518.
2023-08-31 16:18:18 +02:00
Eberhard Beilharz
940d5be5b9
fix(linux): Fix exception in km-kvk2ldml
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.
2023-08-29 18:58:07 +02:00
Eberhard Beilharz
ea249da3b3
refactor(linux): Fix warning
Follow-up of #4999 (which mentions different warnings). This
change fixes other warnings that we were still getting.
2023-08-28 20:11:41 +02:00
Darcy Wong
9f651d00e6 chore(common): Update crowdin strings for French 2023-08-24 08:31:56 +07:00
Eberhard Beilharz
8f39a04375
Merge pull request #9027 from keymanapp/fix/linux/8620_keyboards-with-mul-tag
fix(linux): Fix installation of keyboards with lang tag `mul`
2023-07-21 06:34:58 +02:00
Eberhard Beilharz
f9896756f6
Merge pull request #9310 from keymanapp/fix/linux/logging
fix(linux): Fix logging
2023-07-20 22:48:52 +02:00
Eberhard Beilharz
2f25d198f4
fix(linux): Output not connected ibus as info instead of warning
There is nothing the user can do, and it's usually irrelevant
(except when troubleshooting).
2023-07-20 11:11:43 +02:00
Eberhard Beilharz
8a34a5d6ce
refactor(linux): Some refactorings 2023-07-20 11:09:55 +02:00
Eberhard Beilharz
33603c0f71
refactor(linux): Use better way to get username
`getpass.getuser()` tries several different ways to get the username
and is the recommended way of getting the username.
2023-07-20 11:04:04 +02:00
Eberhard Beilharz
8058d50999
fix(linux): Also output username 2023-07-20 10:48:50 +02:00
Eberhard Beilharz
b814bdd9fa
fix(linux): Reword error if uninstalling non-existent keyboard
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.
2023-07-20 10:11:14 +02:00
Eberhard Beilharz
12165d73bc
fix(linux): Fix logging
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.
2023-07-19 19:47:28 +02:00
Eberhard Beilharz
152d36a654
fix(linux): Fix installation of keyboards with lang tag mul
We now use the canonical tag without appending the script (unless
necessary).

Fixes #8620.
2023-07-19 12:01:52 +02:00
Eberhard Beilharz
8624ebcfb0
Merge pull request #9245 from keymanapp/refactor/linux/refactor
refactor(linux): Refactor image loading
2023-07-13 12:32:07 +02:00