From 8eb2a3c738f5bc8ca596affb14ba9d7b3137fd06 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Tue, 24 Aug 2021 14:44:02 +0200 Subject: [PATCH 1/2] fix(linux): Fix launch of km-config km-config provides a .desktop file that allows the user to start the configuration app like any other app. Unfortunately, a recent change that improved the consistency of the manual pages broke that because the .desktop file used to call km-config with the parameter `-i` (plus file if given). With the recent change `-i` now requires a filename, which caused `km-config` to output an error and quit. For the user this looked like it didn't do anything. This change adds the file/url as a new optional positional parameter while keeping the existing `-i`/`--install` parameter. --- linux/debian/km-config.desktop | 2 +- linux/keyman-config/km-config | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/linux/debian/km-config.desktop b/linux/debian/km-config.desktop index 83bf1a8b99..5646f67601 100644 --- a/linux/debian/km-config.desktop +++ b/linux/debian/km-config.desktop @@ -3,7 +3,7 @@ Name=Keyman Keyboards Name[en_GB]=Keyman Keyboards Comment=Configure Keyman keyboards Comment[en_GB]=Configure Keyman keyboards -Exec=km-config -i %u +Exec=km-config %u Icon=km-config Terminal=false Type=Application diff --git a/linux/keyman-config/km-config b/linux/keyman-config/km-config index 4345d25a1c..d936e9aee5 100755 --- a/linux/keyman-config/km-config +++ b/linux/keyman-config/km-config @@ -20,6 +20,11 @@ if __name__ == '__main__': 'package. INSTALL can either be a downloaded .kmp file, a file:// URL ' + 'pointing to a .kmp file, or a keyman:// URL, possibly with a ' + 'bcp47= specified.') + parser.add_argument('url', nargs='?', default='', metavar='INSTALL', + help='download and/or install .kmp ' + + 'package. INSTALL can either be a downloaded .kmp file, a file:// URL ' + + 'pointing to a .kmp file, or a keyman:// URL, possibly with a ' + + 'bcp47= specified.') args = parser.parse_args() if args.verbose: @@ -31,6 +36,8 @@ if __name__ == '__main__': if args.install: download_and_install_package(args.install) + elif args.url: + download_and_install_package(args.url) else: from keyman_config.view_installed import ViewInstalledWindow w = ViewInstalledWindow() From 27cede213c6693d4882e05836a479e8632ab6d16 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Tue, 24 Aug 2021 15:07:15 +0200 Subject: [PATCH 2/2] fix(linux): Fix km-config man page Previously the included file replaced the entire description, including the parameters. With this change the text from the include file gets added to the beginning of the description. --- linux/keyman-config/km-config | 6 +++++- linux/keyman-config/maninc/km-config.inc | 6 +----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/linux/keyman-config/km-config b/linux/keyman-config/km-config index d936e9aee5..b7e73bf46d 100755 --- a/linux/keyman-config/km-config +++ b/linux/keyman-config/km-config @@ -12,7 +12,11 @@ if __name__ == '__main__': versionstring = "%s (package version %s)" % (__versionwithtag__, __pkgversion__) else: versionstring = "%s" % __versionwithtag__ - parser = argparse.ArgumentParser(description='Keyman keyboards installation and information') + parser = argparse.ArgumentParser(description='km-config shows the currently installed ' + + 'Keyman keyboard packages and allows you to view ' + + 'information about them. It enables you to download new ' + + 'keyboard packages from the website or install from ' + + 'local files.') parser.add_argument('--version', action='version', version='%(prog)s version ' + versionstring) parser.add_argument('-v', '--verbose', action='store_true', help='verbose logging') parser.add_argument('-vv', '--veryverbose', action='store_true', help='very verbose logging') diff --git a/linux/keyman-config/maninc/km-config.inc b/linux/keyman-config/maninc/km-config.inc index 9e12939e24..9783cd6b60 100644 --- a/linux/keyman-config/maninc/km-config.inc +++ b/linux/keyman-config/maninc/km-config.inc @@ -1,14 +1,10 @@ -[=DESCRIPTION] +[