Home: https://github.com/asmagill/mjolnir_asm.hydra
Minor functions from Hydra and a checklist function for indicating Hydra function replacements.
This module provides some of the functionality which Hydra had regarding its environment, but aren't currently in a module of their own for various reasons.
This module is not needed for any of the submodules, and the submodules can be loaded and installed independently of this one. Loads all of the modules corresponding to Hydra's internal functions. This module is not strictly needed, as it will load as many of the modules as have been created so far. Individual modules can be loaded if you prefer only specific support.
This module is based primarily on code from the previous incarnation of Mjolnir by Steven Degutis.
mjolnir._asm.hydra._paths() -> table
Returns a table containing the resourcePath, the bundlePath, and the executablePath for the Mjolnir application.
mjolnir._asm.hydra._version() -> number
Return the current Mjolnir version as a string.
mjolnir._asm.hydra.autolaunch([arg]) -> bool
When argument is absent or not a boolean value, this function returns true or false indicating whether or not Mjolnir is set to launch when you first log in. When a boolean argument is provided, it's true or false value is used to set the auto-launch status.
mjolnir._asm.hydra.call(fn, ...) -> ...
Just like pcall, except that failures are handled using mjolnir.showerror
mjolnir._asm.hydra.check_accessibility(shouldprompt) -> isenabled
Returns whether accessibility is enabled. If passed true
, prompts the user to enable it.
mjolnir._asm.hydra.exec(command[, with_user_env]) -> string
Runs a shell command and returns stdout as a string (may include a trailing newline). If with_user_env
is true
, then invoke the user's default shell as an interactive login shell in which to execute the provided command in order to make sure their setup files are properly evaluated so extra path and environment variables can be set. This is not done, if with_user_env
is false
or not provided, as it does add some overhead and is not always strictly necessary.
mjolnir._asm.hydra.fileexists(path) -> exists, isdir
Checks if a file exists, and whether it's a directory.
mjolnir._asm.hydra.hydra_namespace() -> table
Returns the full hydra name space replicated as closely as reasonable for Mjolnir. Really more of a checklist then a real environment to choose to live in <grin>.
This module attempts to require modules known to provide former Hydra functionality and prints a list to the Mjolnir console indicating what modules you don't have and which Hydra modules are currently have no known replacement in Mjolnir. If you think that an existing module does exist to cover lost functionality, but it is not represented here, please let me know and I'll add it.
This module returns a table of the Hydra namespace, as it has been able to be reconstituted with your installed modules.
NOTE: While this function does load the compatible modules into memory, it does so only when you invoke this function. Until and unless you call this function, no additional modules are loaded into memory.
mjolnir._asm.hydra.showabout()
Displays the standard OS X about panel; implicitly focuses Mjolnir.
mjolnir._asm.hydra.uuid() -> string
Returns a newly generated UUID as a string