diff --git a/bin/key-mapper-control b/bin/key-mapper-control index edf92b96..d22a232c 100755 --- a/bin/key-mapper-control +++ b/bin/key-mapper-control @@ -205,7 +205,12 @@ def main(options): logger.debug('Call for "%s"', sys.argv) - if options.command == AUTOLOAD and num_logged_in_users() == 0: + from keymapper.paths import USER + during_boot = num_logged_in_users() == 0 # for the lack of a better method + is_root = USER == "root" + is_autoload = options.command == AUTOLOAD + config_dir_set = options.config_dir is not None + if is_autoload and during_boot and is_root and not config_dir_set: # No user logged in, this is probably happening during boot time and got # triggered by udev. There is no need to try to inject anything if the # service doesn't know where to look for a config file. This avoids a lot