├── .github └── FUNDING.yml ├── index.js ├── package.json └── readme.md /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: dneustadt 4 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const color_indexes = { 3 | 0: 'black', 4 | 1: 'red', 5 | 2: 'green', 6 | 3: 'yellow', 7 | 4: 'blue', 8 | 5: 'magenta', 9 | 6: 'cyan', 10 | 7: 'white', 11 | 8: 'lightBlack', 12 | 9: 'lightRed', 13 | 10: 'lightGreen', 14 | 11: 'lightYellow', 15 | 12: 'lightBlue', 16 | 13: 'lightMagenta', 17 | 14: 'lightCyan', 18 | 15: 'lightWhite' 19 | }; 20 | const setColor = function(data, count, colors) { 21 | colors[color_indexes[count]] = data; 22 | }; 23 | const getWalColorConfig = function(input, setColor, config) { 24 | var lines = input.toString().split('\n'), 25 | colors = config.colors; 26 | for (var i = 0; i < lines.length; i++) { 27 | setColor(lines[i], i, colors); 28 | } 29 | 30 | var backgroundColor = colors.black, 31 | foregroundColor = colors.lightWhite, 32 | cursorColor = foregroundColor, 33 | borderColor = backgroundColor; 34 | 35 | return Object.assign({}, config, { 36 | foregroundColor, // foreground color 37 | backgroundColor, // background color 38 | borderColor, // border color 39 | cursorColor, // cursor color 40 | colors, 41 | css: ` 42 | ${config.css || ''} 43 | body, .shape_1oxq, .tab_1nfg, .active_fqd { 44 | color: ${foregroundColor}; 45 | } 46 | .closeWindow_ohv:hover { 47 | color: ${colors.red}; 48 | } 49 | .tabs_list { 50 | background-color: rgba(0, 0, 0, 0.1)!important; 51 | } 52 | .tab_tab { 53 | border-left: 1px solid rgba(0, 0, 0, 0.1)!important; 54 | border-top: 1px solid rgba(0, 0, 0, 0.1)!important; 55 | border-right: 1px solid rgba(255, 255, 255, 0.1)!important; 56 | border-bottom: 1px solid rgba(255, 255, 255, 0.1)!important; 57 | } 58 | .tab_tab.tab_active { 59 | background-color: rgba(255, 255, 255, 0.1)!important; 60 | border-left: 1px solid rgba(255, 255, 255, 0.1)!important; 61 | border-top: 1px solid rgba(255, 255, 255, 0.1)!important; 62 | border-right: 1px solid rgba(0, 0, 0, 0.1)!important; 63 | border-bottom: 1px solid rgba(0, 0, 0, 0.1)!important; 64 | } 65 | ` 66 | }) 67 | }; 68 | const file_path = require('os').homedir() + '/.cache/wal/colors'; 69 | const input = fs.existsSync(file_path) ? fs.readFileSync(file_path) : null; 70 | 71 | exports.decorateConfig = config => { 72 | if (input) { 73 | return getWalColorConfig(input, setColor, config); 74 | } else { 75 | console.log('Couldn\'t find wal cached colors. Run wal first.'); 76 | return Object.assign({}, config, {}); 77 | } 78 | }; 79 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hyper-wal", 3 | "version": "1.0.2", 4 | "keywords": [ 5 | "hyper", 6 | "hyper.app" 7 | ], 8 | "repository": { 9 | "type": "git", 10 | "url": "git+https://github.com/dneustadt/hyper-wal.git" 11 | }, 12 | "description": "Extension for using colorschemes generated by wal in Hyper" 13 | } 14 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | 2 | # hyper-wal 3 | 4 | Extension for using colorschemes generated by wal in [Hyper](https://hyper.is). 5 | 6 | ![hyper-wal](https://cloud.githubusercontent.com/assets/9033214/26025727/3602df56-37ee-11e7-8baa-82f5c37ff443.png) 7 | 8 | ## How to use 9 | 10 | * Get [wal](https://github.com/dylanaraps/wal) 11 | * Generate a colorscheme based on a wallpaper 12 | * Install [Hyper](https://hyper.is) and add `hyper-wal` 13 | to `plugins` in `~/.hyper.js`. 14 | 15 | ## How it works 16 | 17 | The plugin will look for a plain text file at `~/.cache/wal/colors` which should 18 | have been generated by wal. 19 | 20 | ## License 21 | 22 | MIT 23 | --------------------------------------------------------------------------------