Package: hab-gui
Hab GuiA graphical user interface built on top ofhabto take hab out of the shell.FeaturesGui for selecting hab URI's and launching aliases.Gui for setting the current uri.hab gui sub-commandhabwcommand allows using hab without popup consoles on windows.Customization of hab-gui usingentry_pointsdefined
in hab site json files.Gui foreditinghabcustom variables.
It can be added to themenuusing entry points.QuickstartEnable the use ofhab guiby adding the entry_point
in your site json file. You can use the example site files that come in thehabandhab-guirepos.Set a HAB_PATHS environment variable.Bash (Linux)Bash (Windows, Cygwin)Command Prompt (Windows)PowerShell (Windows)hab-gui.jsonextends hab's cli by adding thegui comandUse hab gui to launch the alias launch window.habguilaunchOr update the URI saved in theuser prefs.habguiset-uriConfigurationhab gui sub-commandUsinghab entry pointsyou
can add a gui sub-command to hab. This allows you to launch hab-gui commands
from the existing hab shell commands.{
    "prepend": {
        "entry_points": {
            "cli": {
                "gui": "hab_gui.cli:gui"
            }
        }
    }
}This is a minimalsite json fileenabling the use ofhab guithat can be added to your existing site files.habw.exeWhen hab-gui is installed it adds the commandhabwas a usinggui_scripts.
This is useful for windows users as it prevents showing a command prompt window
while using the other hab gui features. This exe uses the same cli interface as
hab so you can convert any existing command to using habw. Just keep in mind that
you won't see any text output on windows, so you may want to only use it when
using thehab guisub-command.Hab-gui Entry PointsBy default hab-gui uses fairly simple gui interfaces like a combo box for URI picking
and simple buttons to launch aliases. Using thehab entry pointssystem
you can implement your own widgets extending or completely re-implementing them.GroupDescriptionUsed byMultiplehab_gui.alias.widgetWidget used to display and launch a specific alias for the current URI.AliasLaunchWindowFirsthab_gui.aliases.widgetClass used to display thehab_gui.alias.widget's.AliasLaunchWindowFirsthab_gui.initUsed to customize the init of hab gui's launched from the command line. By default this installs asys.excepthookthat captures any python exceptions and shows them in a QMessageBox dialog. Seehab-gui-init.json.hab_gui.cliwhen starting a QApplication instance.Firsthab_gui.uri.menu.actionsUsed to customize the menu shown byhab_gui.uri.menu.widget. This should referenceQActionsubclasses conforming tohab_gui.actions.refresh_action.RefreshAction.MenuButtonAllhab_gui.uri.menu.widgetClass used to show a menu interface on the right ofhab_gui.uri.widget. This can be omitted by setting this entry_point tonull.AliasLaunchWindowFirsthab_gui.uri.pin.widgetClass used to allow the user to pin commonly used URIs. Pinning can be disabled by the site file, or setting this entry_point tonull.AliasLaunchWindowFirsthab_gui.uri.widgetClass used by the user to choose the current URI they want to launch aliases from. This class can be customized to provide the user with URI's generated from a DB that are not explicitly defined by configs.AliasLaunchWindowFirstSeehab-gui.jsonfor an example of adding theguisub-command tohab.Seehab-gui-alt.jsonfor an example of changing the default classes used byhab gui launch.Seehab-gui-init.jsonfor an example of changing theQApplicationbefore anyhab guicommands create it. This also allows for global customization of features like error handling etc.Note: Entry_point names should start withhab_gui.and use.between each following word following the group specification onhttps://packaging.python.org/en/latest/specifications/entry-points/#data-model.Icons and labelsFor the command line using an simplified alias name that is easy to type but harder
to read is generally preferred. However for a UI like the launcher, its nice to
be able to use a nice name with spaces and extra information. For example in the
command line using the aliasmaya24is better than having to type"Maya 2024"including double quotes.Hab gui respects extra values defined oncomplex aliases.KeyDescriptionDefaulticonPath to a icon file readable by QIcon.No icon is shown.labelThe text to show instead of the alias name.Same alias name shown in command line.min_verbosityHab-gui uses thehab-guikey. For example"min_verbosity": {"global": 1, "hab-gui": 3}would make this alias visible on the command line using-vor above, but when using hab-gui you would need to use-vvvor higher to see it. This allows you to hide aliases that only make sense on the command line but not in hab-gui.0, so always visible.Example:{
    "name": "maya2024",
    "aliases": {
        "windows": [
            [
                // Alias users are expected to launch the correct version of maya with
                "maya", {
                    "cmd": "C:\\Program Files\\Autodesk\\Maya2024\\bin\\maya.exe",
                    // Show the icon and give it the nice name "Maya"
                    "icon": "{relative_root}/.img/maya.ico",
                    "label": "Maya",
                }
            ],
            [
                // Alias used to launch Maya 2024. This allows you to also have
                // access to Maya 2023 etc in the same config and launch the
                // correct version.
                "maya24", {
                    "cmd": "C:\\Program Files\\Autodesk\\Maya2024\\bin\\maya.exe",
                    "icon": "{relative_root}/.img/maya.ico",
                    "label": "Maya 2024",
                    // In general we don't want users to have to know which version
                    // of Maya to launch so hide this alias unless the user passes `-v`
                    // when using the command line or hab-gui.
                    "min_verbosity": {"global": 1},
                }
            ],
            // The mayapy alias are being added for script access and are not really
            // meant for users, so hide them from the command line.
            // Hab-gui can't pass arguments to aliases when launching, so there
            // really is no need to show this alias in hab-gui, so require `-vvv`.
            [
                "mayapy", {
                    "cmd": "C:\\Program Files\\Autodesk\\Maya2024\\bin\\mayapy.exe",
                    "min_verbosity": {"global": 1, "hab-gui": 3},
                }
            ],
            [
                "mayapy24", {
                    "cmd": "C:\\Program Files\\Autodesk\\Maya2024\\bin\\mayapy.exe",
                    "min_verbosity": {"global": 1, "hab-gui": 3},
                }
            ]
        ]
    }
}Startup Splash ScreenA splash screen be enabled by adding image/directory paths to the site.json config.
The config takes a list entry and can contain full file paths or directory paths
that contain valid images.Valid image types: JPG, PNG, GIF{
    "prepend": {
        "splash_screen": [
            "Path(s)/To/Images"
        ]
    }
}Auto RefreshUsers are likely to keep the hab launcher open for long periods of time and this
may lead to them using out of date configuration settings. Hab Launcher has a
refresh button to let users manually force a refresh. Note that this does not
refresh the site configuration, configs and distros.By default it will automatically refresh every 30 minutes(00:30:00). You can
configure this interval by settinghab_gui_refresh_invervalin your site
configuration. This accepts a string in%H:%M:%Sformat usingtime.strptime. An
empty string will disable this auto-refresh feature.