maestral.autostart¶
This module handles starting the maestral daemon on user login and supports multiple platform specific backends such as launchd or systemd.
Note that launchd agents will not show as “login items” in macOS system preferences. As a result, the user does not have a convenient UI to remove Maestral autostart entries manually outside Maestral itself. Login items however only support app bundles and provide no option to pass command line arguments to the app. They would therefore neither support pip installed packages nor multiple configurations.
Module Contents¶
- class maestral.autostart.SupportedImplementations[source]¶
Bases:
enum.Enum
Enumeration of supported implementations
- class maestral.autostart.AutoStartSystemd(service_name, start_cmd, unit_dict=None, service_dict=None, install_dict=None)[source]¶
Bases:
AutoStartBase
Autostart backend for systemd
- Parameters:
service_name (str) – Name of systemd service.
start_cmd (str) – Absolute path to executable and optional program arguments.
unit_dict (dict[str, str] | None) – Dictionary of additional keys and values for the Unit section.
service_dict (dict[str, str] | None) – Dictionary of additional keys and values for the Service section.
install_dict (dict[str, str] | None) – Dictionary of additional keys and values for the “Install” section.
- class maestral.autostart.AutoStartLaunchd(launchd_id, start_cmd, **kwargs)[source]¶
Bases:
AutoStartBase
Autostart backend for launchd
- Parameters:
- class maestral.autostart.AutoStartXDGDesktop(app_name, start_cmd, filename, **kwargs)[source]¶
Bases:
AutoStartBase
Autostart backend for XDG desktop entries
Used to start a GUI on user login for most Linux desktops. For a full specifications, please see:
https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
- Parameters:
app_name (str) – Name of application.
start_cmd (str) – Executable on $PATH or absolute path to executable and optional program arguments.
filename (str | None) – Name of desktop entry file. If not given, the application name will be used.
kwargs (str) – Additional key, value pairs to be used in the desktop entries. Values must be strings and may not contain “=”, otherwise no additional validation will be performed.
- maestral.autostart.get_available_implementation()[source]¶
Returns the supported implementation depending on the platform.
- Return type:
SupportedImplementations | None
- maestral.autostart.get_command_path(dist, command)[source]¶
Returns the path to a command line script. Tries to check dist_files first, falls back to
shutil.which()
otherwise.
- class maestral.autostart.AutoStart(config_name)[source]¶
Starts Maestral on user log-in
Creates auto-start files in the appropriate system location to automatically start Maestral when the user logs in. Different backends are used depending on the platform.
- Parameters:
config_name (str) – Name of Maestral config.