From 023d94a0b364817e2aa4b8ef3980eec4d4fcf5f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Pierret=20=28fepitre=29?= Date: Tue, 17 Mar 2020 13:23:53 +0100 Subject: [PATCH] qvm-start-daemon: improve parsing args for setting keyboard layout --- qubesadmin/tools/qvm_start_daemon.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/qubesadmin/tools/qvm_start_daemon.py b/qubesadmin/tools/qvm_start_daemon.py index 0d2ff32..5ccf69a 100644 --- a/qubesadmin/tools/qvm_start_daemon.py +++ b/qubesadmin/tools/qvm_start_daemon.py @@ -478,7 +478,8 @@ parser.add_argument('--notify-monitor-layout', action='store_true', help='Notify running instance in --watch mode' ' about changed monitor layout') parser.add_argument('--set-keyboard-layout', action='store_true', - help='Set keyboard layout values into GuiVM features') + help='Set keyboard layout values into GuiVM features.' + 'This option is implied by --watch') # Add it for the help only parser.add_argument('--force', action='store_true', default=False, help='Force running daemon without enabled services' @@ -499,8 +500,8 @@ def main(args=None): parser.error('--watch option must be used with --all') if args.watch and args.notify_monitor_layout: parser.error('--watch cannot be used with --notify-monitor-layout') - if not args.set_keyboard_layout: - args.set_keyboard_layout = args.watch + if args.watch and 'guivm-gui-agent' in enabled_services: + args.set_keyboard_layout = True if args.set_keyboard_layout or os.path.exists('/etc/qubes-release'): guivm = args.app.domains[args.app.local_name] set_keyboard_layout(guivm)