Giter VIP home page Giter VIP logo

hyper-tab-icons's Introduction

Hyper.app Tab Icons

Icons in the header tabs for the current running process in Hyper.app.

How It Works

Uses fuzzaldrin to try to match the current tab title with the SVG icons that have been added to the repo, then displays the matched icon. Has the ability to map different icons and styles.

Demo

alt demo

Configuration

There are few options to customize the different icons and styles applied. You may configure these inside of ~/.hyper.js.

config.tabIcons.activeStyle

  • Type: object
  • Default:
    {
      display: 'inline-block',
      marginRight: '0.25rem',
      transition: 'opacity 200ms ease-in',
      verticalAlign: 'middle',
      width: '1rem',
    }
    

This object can be any CSSStyleDeclaration allowed. Pass an inline style object the same way you would with React.

config.tabIcons.inactiveStyle

  • Type: object
  • Default:
    {
      display: 'inline-block',
      marginRight: '0.25rem',
      transition: 'opacity 200ms ease-in',
      verticalAlign: 'middle',
      width: '1rem',
      opacity: 0.3,
    }

This object can be any CSSStyleDeclaration allowed. Pass an inline style object the same way you would with React.

config.tabIcons.mapIcons

  • Type: object
  • Default: {}

Map of icon to array of process names. Example:

{
  nodejs: ['node'],
  docker: ['docker-compose'],
}

Look inside src/icons for possible icons to map to. Look at src/constants/mapIcons.js for defaults.

config.tabIcons.mapColors

  • Type: object
  • Default: {}

Map of process name to color string. Example:

{
  bash: '#FFF',
  fish: '#D8494F',
  zsh: '#C5DB00',
}

Look at src/constants/mapColors.js for defaults.

config.tabIcons.disableColors

  • Type: boolean
  • Default: false

Toggles icon colors. Inherits color from current CSS applied to tab text โœจmagicallyโœจ.

config.tabIcons.processNameRegex

  • Type: object
  • Default: /^(.*?) /

The regex used to capture the process name in the title.

If you use something like zsh that swaps the process name and current working directory, the following regex should work: /: (.*?)$/.

Alternatively, supply an object with the properties source and flags.

{
  source: '^(.*?) ',
  flags: '',
}

config.tabIcons.processNameMatch

  • Type: number (integer)
  • Default: 1

The index of the match out of the array of matches made by config.tabIcons.processNameRegex.

An index of 0 is the full match made by the regex. An index of 1 or more is used to get an exact match from one of the matching groups.

Contribution

There are an almost infinite amount of processes out there, so any help adding new icons, mapping colors, et cetera is greatly appreciated!

Credit

Inspired by Atom's file-icons.

hyper-tab-icons's People

Contributors

anirudhb avatar dfrankland avatar jbergstroem avatar otterpocket avatar peritpatrio avatar trieloff avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.