docs: def shell_focusd(data_dir):
      """ Shells a new instance of a focusd daemon process.
  
          `data_dir`
              Home directory for focusd data.
  
          Returns boolean.
  
          * Raises ``ValueError`` if sudo used and all passwords tries failed.
          """
  
      command = 'focusd {0}'.format(data_dir)
  
      # see what event hook plugins are registered
      plugins = registration.get_registered(event_hooks=True)
  
      if not plugins:  # none registered, bail
          raise errors.NoPluginsRegistered
  
      # do any of the plugins need root access?
      # if so, wrap command with sudo to escalate privs, if not already root
      needs_root = any(p for p in plugins if p.needs_root)
  
      if needs_root and os.getuid() != 0:  # only if not already root
          command = 'sudo ' + command
      else:
          needs_root = False
  
      # shell the daemon process
      _, code = common.shell_process(command, exitcode=True)
  
      if code == 1 and needs_root:  # passwords failed?
          raise ValueError
  
      return code == 0