mission-control-desktop

    Rules of the Mission Control desktop app: its arguments, its instance and its application identifier

    mission-control
    proton
    desktop
    ui
    Download zip
    Author
    Version
    0.5.0
    License
    Apache-2.0
    Last updated
    2 hours ago
    Downloads
    109

    #mission-control-desktop

    The rules of the Mission Control desktop app. The module has no I/O and no window. It builds on wasm, wasm-gc, js and native, so all its rules have tests that need no browser engine.

    • DesktopCommand is what the app does: OpenWindow opens the window of an instance, and Serve runs the server of an instance. DesktopCommand::parse reads the arguments of the app, and to_arguments writes them.
    • asked_instance gives the instance of the option --instance or of the variable MISSION_CONTROL_INSTANCE.
    • installed_instance_path gives the path of the file mission-control-instance.txt next to an installed app, and installed_instance reads its text. The file has the name of one instance in one line.
    • app_identifier gives the identifier of the app for an instance. The system opens one window for each identifier.
    • window_title gives the title of the window.
    • InstallPlace is the place of an app that is installed for one instance, below the base folder: its folder, its program and the file with the name of the instance. InstallPlace::parse reads the arguments of mise run desktop:install. The default is the instance dev.
    • MenuEntry is the entry of an installed app in the application menu of Linux, with the place of its icon.

    mission-control desktop uses DesktopCommand::to_arguments to start the app. The app itself is apps/desktop-host. It opens the window with Proton, and it is not a member of moon.work, because a build of Proton needs the CEF SDK.

    #Arguments

    ArgumentsResult
    [--instance NAME] [--folder PATH]Opens the window. With a folder, the window shows the project of that folder. PATH is a complete path.
    serve --instance NAMERuns the server of the instance. The app starts itself with these arguments.

    ArgumentError

    pub(all) suberror ArgumentError {
    UnknownArgument(String)
    MissingValue(DesktopOption)
    RepeatedOption(DesktopOption)
    MissingInstance
    WrongInstance(
    InstanceNameError
    )
    WrongFolder(
    FolderPathError
    )
    } derive(Eq,
    Debug
    )

    Raised when the desktop app cannot use its arguments.

    ArgumentError::equal

    automatically derived

    ArgumentError::message

    fn ArgumentError::message(self : ArgumentError) -> String

    The problem, as text for people.

    ArgumentError::not_equal

    fn ArgumentError::not_equal(x : ArgumentError, y : ArgumentError) -> Bool
    automatically derived

    ArgumentError::to_repr

    automatically derived

    InstanceError

    Raised when the app cannot know its instance from the variable or the file.

    InstanceError::equal

    automatically derived

    InstanceError::message

    fn InstanceError::message(self : InstanceError) -> String

    The problem, as text for people.

    InstanceError::not_equal

    fn InstanceError::not_equal(x : InstanceError, y : InstanceError) -> Bool
    automatically derived

    InstanceError::to_repr

    automatically derived

    DesktopCommand

    What the desktop app does.

    DesktopCommand::equal

    automatically derived

    DesktopCommand::not_equal

    fn DesktopCommand::not_equal(x : DesktopCommand, y : DesktopCommand) -> Bool
    automatically derived

    DesktopCommand::parse

    Reads the arguments after the name of the program:

    • [--instance NAME] [--folder PATH] opens the window.
    • serve --instance NAME runs the server.

    --folder needs a complete path, because the working directory of an app depends on how the user opens it. The platform gives the rules for the path.

    DesktopCommand::to_arguments

    fn DesktopCommand::to_arguments(self : DesktopCommand) -> ReadOnlyArray[String]

    The arguments that give this command.

    DesktopCommand::to_repr

    automatically derived

    DesktopOption

    pub(all) enum DesktopOption {
    Instance
    Folder
    } derive(Eq,
    Debug
    )

    An option of the desktop app.

    DesktopOption::equal

    automatically derived

    DesktopOption::not_equal

    fn DesktopOption::not_equal(x : DesktopOption, y : DesktopOption) -> Bool
    automatically derived

    DesktopOption::text

    fn DesktopOption::text(self : DesktopOption) -> String

    The text of the option.

    DesktopOption::to_repr

    automatically derived

    InstallPlace

    type InstallPlace derive(Eq,
    Debug
    )

    The place of an app that is installed for one instance. mise run desktop:install installs an app there, and mission-control desktop finds it there.

    InstallPlace::InstallPlace

    The place of the app of an instance, below the base folder.

    InstallPlace::binary

    The path of the program that runs. On Linux program is a script that gives this program its engine. On Windows and macOS it is the same file as program.

    InstallPlace::equal

    automatically derived

    InstallPlace::folder

    The folder that has the app, and nothing else.

    InstallPlace::instance

    The instance that the app opens.

    InstallPlace::instance_file

    The path of the file with the name of the instance, in the folder.

    InstallPlace::not_equal

    fn InstallPlace::not_equal(x : InstallPlace, y : InstallPlace) -> Bool
    automatically derived

    InstallPlace::parse

    Reads the arguments of an installation: [--instance NAME]. An app from the repository is for the instance dev, so it does not change the instance of a release.

    InstallPlace::program

    The path of the program in the folder that mission-control desktop starts.

    InstallPlace::to_json

    The JSON form has the texts of the name and the paths. scripts/desktop-install.mbtx reads it, because a script cannot import a module of the workspace.

    InstallPlace::to_repr

    automatically derived
    type MenuEntry derive(Eq,
    Debug
    )

    The entry of an installed app in the application menu of Linux, and the place of its icon. mise run desktop:install writes them.
    impl ToJson for MenuEntry
    fn MenuEntry::equal(MenuEntry, MenuEntry) -> Bool
    automatically derived

    The path of the file of the entry.
    fn MenuEntry::not_equal(x : MenuEntry, y : MenuEntry) -> Bool
    automatically derived

    The entry of an app that is installed with these variables. There is none on Windows and macOS. There is also none when MISSION_CONTROL_HOME gives the base folder: the menu does not set this variable, so the app would use the default folder.

    The name of the file and of the icon is the identifier of the app. Its windows have the same class, so the desktop knows which entry a window belongs to.
    fn MenuEntry::text(self : MenuEntry) -> String

    The text of the file of the entry.

    The JSON form. scripts/desktop-install.mbtx reads it, because a script cannot import a module of the workspace. An icon of 48 pixels is at 48x48/apps/<icon_file> in the folder icon_theme.
    automatically derived

    app_identifier

    The identifier of the desktop app for an instance. The system opens one app for each identifier, and keeps the data of its window under it.

    asked_instance

    The instance that the user asks for: the one of the option, or else the one of the variable MISSION_CONTROL_INSTANCE. An empty variable has no name. The option wins over a variable that has a wrong value.

    Without an answer, the app uses the instance of its file, or else the one of its channel.

    installed_instance

    Reads the text of the file next to an installed app: the name of its instance in one line. Spaces around the name and the end of the line do not count.

    installed_instance_file

    let installed_instance_file : String

    The name of the file next to an installed app that has the name of its instance.

    installed_instance_path

    The path of the file next to the app, from the complete path of its program. On macOS the app is the bundle NAME.app, which contains the program.

    FolderPath has the rules for the path of each file also.

    window_title

    The title of the window. It is the title that the server gives to the page.