├── .gitignore ├── index.js ├── licence ├── media └── screen-shot.png ├── package.json └── readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const hashbow = require('hashbow'); 4 | 5 | function getOverrides(path) { 6 | return window.config.getConfig()['hyperterm-dibdabs'].overrides[path]; 7 | } 8 | 9 | function getColor(path) { 10 | return getOverrides(path) || hashbow(path); 11 | } 12 | 13 | exports.getTabProps = function (uid, parentProps, props) { 14 | return Object.assign({}, props, { 15 | dabColor: getColor(props.text) 16 | }); 17 | }; 18 | 19 | exports.decorateTab = function (Tab, { React }) { 20 | return class extends Tab { 21 | render() { 22 | const dab = React.createElement('span', { 23 | className: 'tab_dibdab', 24 | style: { 25 | 'background-color': this.props.dabColor 26 | } 27 | }); 28 | const customChildrenBefore = Array.from(this.props.customChildrenBefore || []).concat(dab); 29 | return React.createElement(Tab, Object.assign({}, this.props, { customChildrenBefore })); 30 | } 31 | } 32 | }; 33 | 34 | exports.decorateConfig = function (config) { 35 | return Object.assign({}, config, { 36 | css: ` 37 | ${config.css || ''} 38 | .tab_dibdab { 39 | position: absolute; 40 | left: 13px; 41 | top: 13px; 42 | width: 10px; 43 | height: 10px; 44 | border-radius: 50%; 45 | } 46 | ` 47 | }); 48 | }; 49 | -------------------------------------------------------------------------------- /licence: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) George Crabtree (https://github.com/supercrabtree) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /media/screen-shot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supercrabtree/hyperterm-dibdabs/0e60b74021f20770b46c729db73df86ac7b12954/media/screen-shot.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hyperterm-dibdabs", 3 | "version": "0.0.8", 4 | "description": "Add dibdabs to your hyperterm tabs", 5 | "main": "index.js", 6 | "repository": { 7 | "type": "git", 8 | "url": "git+https://github.com/supercrabtree/hyperterm-dibdabs.git" 9 | }, 10 | "keywords": [ 11 | "hyperterm", 12 | "tabs", 13 | "tab" 14 | ], 15 | "author": "George Crabtree (https://github.com/supercrabtree)", 16 | "license": "MIT", 17 | "bugs": { 18 | "url": "https://github.com/supercrabtree/hyperterm-dibdabs/issues" 19 | }, 20 | "homepage": "https://github.com/supercrabtree/hyperterm-dibdabs#readme", 21 | "dependencies": { 22 | "hashbow": "1.1.1" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # hyperterm-dibdabs 2 | 3 | 4 | 5 | The little colored dot on the left of the tab is added for quick identification 6 | of commonly used tabs. The dot is always the same color for every tab title, so 7 | my dotfiles are always that same pink and my home folder always that same blue. 8 | Makes moving between projects that little bit quicker. 9 | 10 | Powered by [hashbow](https://www.npmjs.com/package/hashbow) 11 | 12 | ## Config 13 | To override the color of your dibdab, add the file path and desired color (hex or rgb) to the `override` attribute of the plugin's configuration, located in the `hyper.js` file. 14 | 15 | **For example:** Update the color of the `Development` directory to a lovely pale green. 16 | 17 | ``` javascript 18 | module.exports = { 19 | config: { 20 | 'hyperterm-dibdabs': { 21 | overrides: { 22 | '~/Development': '#c0ffee' 23 | } 24 | } 25 | } 26 | } 27 | ``` 28 | --------------------------------------------------------------------------------