1.0.4 • Published 4 years ago

hyper-themes v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Hyper Launch Menu

Adds the ability to select (at runtime) the theme to launch on Hyper

Screenshot

Installation

Run

hyper i hyper-launch-menu

Or add 'hyper-launch-menu' to the list of plugins in .hyper.js

Configuration

Usage:

Add the themes key to the config object in your .hyper.js with a list of themes, e.g.:

module.exports = {
  config: {
    // ...

    themes: [
      {
        name: "CMD",
        theme: 'cmd.exe',
        args: ['--login'],
      },
      {
        name: "Bash",
        group: [
          {
            name: "WSL",
            theme: 'C:\\Windows\\System32\\wsl.exe',
            args: ['--login'],
          },
          {
            name: "Git",
            theme: "C:\\Program Files\\Git\\bin\\bash.exe",
            args: ["--login"],
          },
        ],
      },
      {
        name: "Powertheme",
        theme: "powertheme.exe",
        default: true,
      },
      {
        name: "Cygwin",
        theme: "C:\\cygwin64\\bin\\bash.exe",
        args: ["--login"],
      },
    ],

    // ...
  }
  // ...
}

theme parameters:

  • name: The name displayed for this theme in the menu
  • theme: A path to a custom theme to run when Hyper starts a new session
  • args: An array of theme arguments Optional
  • env: An object of environment variables to set before launching theme Optional
  • shortcut: Combined with the global parameter selectthemeKeymap, binds a keymap to select the theme. This is used to add the last key for your keymap Optional

Global parameters:

  • themeName: Name for the config (vanilla) default theme Default: "Default"
  • showthemeInfo: If the menu should show info about each theme Default: false
  • showthemeNotifications: If a notification should popup each time you select a theme Default: true
  • openOnSelect: If true, a new tab will be opened whenever you select a theme Default: false
  • setOnSelect: If false, the selected theme will only be used the next time you open a theme Default: true
  • detectthemes: If true, a themes list will be automatically created according to your operating system. Default: false
  • selectthemeKeymap: Combined with the theme parameter shortcut, binds a keymap to select the theme. This is used to add the modifiers of any theme's keymap (i.e: 'ctrl+shift') Default: undefined

Features

theme groups

Since version 4.0.0, you can group related themes together. This allows you to organize your themes list, specially useful if it is a long one.

You can do this by wrapping multiple themes in a "theme group", like this:

{
  name: "Bash",
  group: [
    {
      name: "WSL",
      theme: 'C:\\Windows\\System32\\bash.exe',
      args: ['--login']
    },
    {
      name: "Git",
      theme: "C:\\Program Files\\Git\\bin\\bash.exe",
      args: ["--login"]
    },
  ],
},

Default theme

You can now have your default theme alongside the others inside the themes key.

By adding a default flag inside the theme object marked as true, the plugin will automatically select it, overriding any theme provided the vanilla way.

(Its name is always defined by its name attribute, and not the themeName parameter, as that only works for the vanilla one)

Example:

{name: "Powertheme", theme: "powertheme.exe", default: true}

Selecting the default theme directly from your themes list lets you more flexibility when changing things.

Auto-detect themes

If you dont specify a themes list, but set the detectthemes flag to true, it will automatically create a themes list according to your operating system.

Side note: When this is true, the config vanilla theme attributes wont be taken into account.

Import/Export themes list

This feature is mainly thought to be used alongside the auto-detection.

You can export your current themes configuration to a JSON file (or your clipboard), and also import them, in order to try out a configuration without the need of modifying Hyper's config file.

Exporting is useful as JSON format is supported in the hyper.js file, so you can directly copy and paste the object into the file (setting the themes property to that object), and have it persistently.

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago