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 of 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.
- class maestral.autostart.SupportedImplementations(value)[source]
Bases:
enum.Enum
Enumeration of supported implementations
- systemd = 'systemd'
- launchd = 'launchd'
- xdg_desktop = 'xdg_desktop'
- class maestral.autostart.AutoStartSystemd(service_name, start_cmd, unit_dict=None, service_dict=None, install_dict=None)[source]
Bases:
maestral.autostart.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 (Optional[Dict[str, str]]) – Dictionary of additional keys and values for the Unit section.
service_dict (Optional[Dict[str, str]]) – Dictionary of additional keys and values for the Service section.
install_dict (Optional[Dict[str, str]]) – Dictionary of additional keys and values for the “Install” section.
- Return type
None
- class maestral.autostart.AutoStartLaunchd(bundle_id, start_cmd, **kwargs)[source]
Bases:
maestral.autostart.AutoStartBase
Autostart backend for launchd
- Parameters
- Return type
None
- class maestral.autostart.AutoStartXDGDesktop(app_name, start_cmd, filename, **kwargs)[source]
Bases:
maestral.autostart.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 (Optional[str]) – 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.
- Return type
None
- maestral.autostart.get_available_implementation()[source]
Returns the supported implementation depending on the platform.
- Return type
- maestral.autostart.get_maestral_command_path()[source]
Returns the path to the maestral executable. May be an empty string if the executable cannot be found.
- Return type
- class maestral.autostart.AutoStart(config_name)[source]
Bases:
object
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.
- Return type
None