]> Freerunner's - dotfiles.git/commitdiff
flavours: add an opensuse-ish colorscheme
authorAndre Ramnitz <tux.rising@gmail.com>
Wed, 27 Nov 2024 16:17:43 +0000 (17:17 +0100)
committerAndre Ramnitz <tux.rising@gmail.com>
Wed, 27 Nov 2024 19:43:59 +0000 (20:43 +0100)
flavours: add template for gnu dircolors

dot-config/flavours/config.toml
dot-config/flavours/schemes/misc/suse.yaml [new file with mode: 0644]
dot-config/flavours/sources/templates/list.yaml
dot-config/flavours/templates/dircolors/.gitignore [new file with mode: 0644]
dot-config/flavours/templates/dircolors/LICENSE [new file with mode: 0644]
dot-config/flavours/templates/dircolors/README.md [new file with mode: 0644]
dot-config/flavours/templates/dircolors/base16-gnu-dircolors.png [new file with mode: 0644]
dot-config/flavours/templates/dircolors/templates/config.yaml [new file with mode: 0644]
dot-config/flavours/templates/dircolors/templates/default.mustache [new file with mode: 0644]
dot-config/flavours/templates/dircolors/templates/dircolors.256dark [new file with mode: 0644]

index c4e8758f38ea41cb61b056fac237eef72d9c968a..9957bde31cf1161ef16b02237b37a48c4f72cac2 100644 (file)
@@ -79,3 +79,11 @@ template = "stylesheets"
 subtemplate = "css-variables"
 file = "/home/andy/.mozilla/firefox/bqritlod.default-release/chrome/base16.css"
 rewrite = true
+
+[[item]]
+template = "dircolors"
+file = "~/.config/flavours/templates/dircolors/scripts/gen_dircolors.py"
+hook = "python3 ~/.config/flavours/templates/dircolors/scripts/gen_dircolors.py > ~/.dircolors && eval 'dircolors ~/.dircolors'"
+# hook = "chmod 755 ~/.config/flavours/templates/dircolors/scripts/gen_dircolors.py && eval 'dircolors <(python3 ~/.config/flavours/templates/dircolors/scripts/gen_dircolors.py)'"
+rewrite = true
+
diff --git a/dot-config/flavours/schemes/misc/suse.yaml b/dot-config/flavours/schemes/misc/suse.yaml
new file mode 100644 (file)
index 0000000..dcb5bef
--- /dev/null
@@ -0,0 +1,19 @@
+scheme: "Opensuse"
+author: "freerunner"
+base00: "1D1D1D" # ---- dark
+base01: "3e3e3e" # ---
+base02: "525252" # --
+base03: "6f6f6f" # -
+base04: "999999" # +
+base05: "bababa" # ++
+base06: "dcdbdc" # +++
+base07: "efefef" # ++++ light
+base08: "BD3314" # red
+base09: "F9CABF" #
+base0A: "FCB244" # yellow
+base0B: "a1ef8b" # green
+base0C: "00BDA7" # cyan
+base0D: "7dc6e2" # blue
+base0E: "5d4f99" # violet
+base0F: "E8C1F7" #
+
index afd378a8bc78c7cb11dc9513e41da240f3d89e4e..dd363c9a6e086860a3dd2d08b2ff60c66c3f303f 100644 (file)
@@ -9,6 +9,7 @@ aerc: https://git.sr.ht/~h4n1/base16-aerc
 # console2: https://github.com/AFulgens/base16-console2
 # consolez: https://github.com/AFulgens/base16-consolez
 # crosh: https://github.com/philj56/base16-crosh
+dircolors: https://github.com/MaienM/base16-gnu-dircolors
 # dwm: https://github.com/dgmulf/base16-dwm
 # dunst: https://github.com/khamer/base16-dunst
 # emacs: https://github.com/belak/base16-emacs
diff --git a/dot-config/flavours/templates/dircolors/.gitignore b/dot-config/flavours/templates/dircolors/.gitignore
new file mode 100644 (file)
index 0000000..7bbc71c
--- /dev/null
@@ -0,0 +1,101 @@
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+env/
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+*.egg-info/
+.installed.cfg
+*.egg
+
+# PyInstaller
+#  Usually these files are written by a python script from a template
+#  before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*.cover
+.hypothesis/
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+local_settings.py
+
+# Flask stuff:
+instance/
+.webassets-cache
+
+# Scrapy stuff:
+.scrapy
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+target/
+
+# Jupyter Notebook
+.ipynb_checkpoints
+
+# pyenv
+.python-version
+
+# celery beat schedule file
+celerybeat-schedule
+
+# SageMath parsed files
+*.sage.py
+
+# dotenv
+.env
+
+# virtualenv
+.venv
+venv/
+ENV/
+
+# Spyder project settings
+.spyderproject
+.spyproject
+
+# Rope project settings
+.ropeproject
+
+# mkdocs documentation
+/site
+
+# mypy
+.mypy_cache/
diff --git a/dot-config/flavours/templates/dircolors/LICENSE b/dot-config/flavours/templates/dircolors/LICENSE
new file mode 100644 (file)
index 0000000..ab60297
--- /dev/null
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2018 
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/dot-config/flavours/templates/dircolors/README.md b/dot-config/flavours/templates/dircolors/README.md
new file mode 100644 (file)
index 0000000..3174cf8
--- /dev/null
@@ -0,0 +1,146 @@
+# Base16 GNU ls dircolors
+
+A python script to generate `$LS_COLORS` shell environment variable.
+
+The program ls uses the environment variable LS_COLORS to determine the colors
+in which the filenames and filetypes (like directories and symlinks) are displayed.
+This environment variable is usually set by a command like:
+
+``` bash
+eval 'dircolors some_path/dir_colors'
+```
+
+The GNU version of ls allows more suffisticated color definitions.
+
+## Preview
+
+![Base16 GNU dircolors](https://github.com/embayer/base16-gnu-dircolors/raw/master/base16-gnu-dircolors.png)
+
+Scheme: [Zenburn](https://github.com/elnawe/base16-zenburn-scheme)
+
+## Installation
+
+For the base16 workflow see:
+[base16](https://github.com/chriskempson/base16)
+
+## Usage
+
+Either method A or B.
+
+### A: Stored
+
+Store the output of the generated python script:
+
+``` bash
+python /path/to/gen_dircolors.py > ~/.dircolors.256dark
+```
+
+And use it:
+
+``` bash
+eval 'dircolors ~/.dircolors.256dark'
+```
+
+For persistence across shell sessions you want to
+write this line in your shell rc file (.bash_profile, .zshrc...).
+
+### B: Computed
+
+Use the script output directly:
+
+``` bash
+eval 'dircolors <(python /path/to/gen_dircolors.py)'
+```
+
+(You could also skip the base16 workflow and define
+colors in `default.mustache` and use it as python script.)
+
+# dircolors documentation
+
+Below are the color init strings for the basic file types. A color init
+string consists of one or more of the following numeric codes:
+
+## Attribute codes:
+
+Code | Style
+---- | -----
+00 | none
+01 | bold
+04 | underscore
+05 | blink
+07 | reverse
+08 | concealed
+
+## Text color codes:
+
+Code | Style
+---- | -----
+30 | black
+31 | red
+32 | green
+33 | yellow
+34 | blue
+35 | magenta
+36 | cyan
+37 | white
+
+## Background color codes:
+
+Code | Style
+---- | -----
+40 | black
+41 | red
+42 | green
+43 | yellow
+44 | blue
+45 | magenta
+46 | cyan
+47 | white
+
+256 color support see:
+[256 color support](http://www.mail-archive.com/bug-coreutils@gnu.org/msg11030.html)
+
+## Ansi escape codes
+
+Text 256 color coding:
+`38;5;COLOR_NUMBER`
+
+Background 256 color coding:
+`48;5;COLOR_NUMBER`
+
+Further reading
+[linux die](https://linux.die.net/man/5/dir_colors)
+[ANSI escape code colors](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors)
+
+## Conventions
+
+File | Style
+---- | -----
+Dev related files | bold
+Directories | bold and reversed
+Executable files | system red and bold
+Special files (links, pipes...) | white on an colorful background
+
+# Troubleshooting
+
+The dircolors.256dark template has to live relative to
+the generated script gen_dircolors.py.
+
+``` bash
+├── README.md
+├── colortrans.py
+├── scripts
+│   └── gen_dircolors.py
+└── templates
+    ├── config.yaml
+    ├── default.mustache
+    └── dircolors.256dark
+```
+
+If this is not the case in your workflow, you have
+to manually set it in `default.mustache`:
+
+``` python
+template = os.path.join(os.path.dirname(__file__),
+                        '../templates/dircolors.256dark')
+```
diff --git a/dot-config/flavours/templates/dircolors/base16-gnu-dircolors.png b/dot-config/flavours/templates/dircolors/base16-gnu-dircolors.png
new file mode 100644 (file)
index 0000000..d703ed5
Binary files /dev/null and b/dot-config/flavours/templates/dircolors/base16-gnu-dircolors.png differ
diff --git a/dot-config/flavours/templates/dircolors/templates/config.yaml b/dot-config/flavours/templates/dircolors/templates/config.yaml
new file mode 100644 (file)
index 0000000..bae9b16
--- /dev/null
@@ -0,0 +1,3 @@
+default:
+    extension: .py
+    output: scripts
\ No newline at end of file
diff --git a/dot-config/flavours/templates/dircolors/templates/default.mustache b/dot-config/flavours/templates/dircolors/templates/default.mustache
new file mode 100644 (file)
index 0000000..3d498b7
--- /dev/null
@@ -0,0 +1,386 @@
+#!/usr/bin/env python
+# base16-gnu-dircolors (https://github.com/embayer/base16-gnu-dircolors)
+# Base16 GNU dircolors template by Markus Bayer
+# hex to ansi escape code stolen from Micah Elliott (http://MicahElliott.com)
+# {{scheme-name}} scheme by {{scheme-author}}
+import re
+import os.path
+
+
+hex_colors = {
+    'color01': '{{base00-hex}}',
+    'color02': '{{base01-hex}}',
+    'color03': '{{base02-hex}}',
+    'color04': '{{base03-hex}}',
+    'color05': '{{base04-hex}}',
+    'color06': '{{base05-hex}}',
+    'color07': '{{base06-hex}}',
+    'color08': '{{base07-hex}}',
+    'color09': '{{base08-hex}}',
+    'color10': '{{base09-hex}}',
+    'color11': '{{base0A-hex}}',
+    'color12': '{{base0B-hex}}',
+    'color13': '{{base0C-hex}}',
+    'color14': '{{base0D-hex}}',
+    'color15': '{{base0E-hex}}',
+    'color16': '{{base0F-hex}}'
+}
+
+CLUT = [  # color look-up table
+    # 8-bit, RGB hex
+
+    # Primary 3-bit (8 colors). Unique representation!
+    ('00',  '000000'),
+    ('01',  '800000'),
+    ('02',  '008000'),
+    ('03',  '808000'),
+    ('04',  '000080'),
+    ('05',  '800080'),
+    ('06',  '008080'),
+    ('07',  'c0c0c0'),
+
+    # Equivalent "bright" versions of original 8 colors.
+    ('08',  '808080'),
+    ('09',  'ff0000'),
+    ('10',  '00ff00'),
+    ('11',  'ffff00'),
+    ('12',  '0000ff'),
+    ('13',  'ff00ff'),
+    ('14',  '00ffff'),
+    ('15',  'ffffff'),
+
+    # Strictly ascending.
+    ('16',  '000000'),
+    ('17',  '00005f'),
+    ('18',  '000087'),
+    ('19',  '0000af'),
+    ('20',  '0000d7'),
+    ('21',  '0000ff'),
+    ('22',  '005f00'),
+    ('23',  '005f5f'),
+    ('24',  '005f87'),
+    ('25',  '005faf'),
+    ('26',  '005fd7'),
+    ('27',  '005fff'),
+    ('28',  '008700'),
+    ('29',  '00875f'),
+    ('30',  '008787'),
+    ('31',  '0087af'),
+    ('32',  '0087d7'),
+    ('33',  '0087ff'),
+    ('34',  '00af00'),
+    ('35',  '00af5f'),
+    ('36',  '00af87'),
+    ('37',  '00afaf'),
+    ('38',  '00afd7'),
+    ('39',  '00afff'),
+    ('40',  '00d700'),
+    ('41',  '00d75f'),
+    ('42',  '00d787'),
+    ('43',  '00d7af'),
+    ('44',  '00d7d7'),
+    ('45',  '00d7ff'),
+    ('46',  '00ff00'),
+    ('47',  '00ff5f'),
+    ('48',  '00ff87'),
+    ('49',  '00ffaf'),
+    ('50',  '00ffd7'),
+    ('51',  '00ffff'),
+    ('52',  '5f0000'),
+    ('53',  '5f005f'),
+    ('54',  '5f0087'),
+    ('55',  '5f00af'),
+    ('56',  '5f00d7'),
+    ('57',  '5f00ff'),
+    ('58',  '5f5f00'),
+    ('59',  '5f5f5f'),
+    ('60',  '5f5f87'),
+    ('61',  '5f5faf'),
+    ('62',  '5f5fd7'),
+    ('63',  '5f5fff'),
+    ('64',  '5f8700'),
+    ('65',  '5f875f'),
+    ('66',  '5f8787'),
+    ('67',  '5f87af'),
+    ('68',  '5f87d7'),
+    ('69',  '5f87ff'),
+    ('70',  '5faf00'),
+    ('71',  '5faf5f'),
+    ('72',  '5faf87'),
+    ('73',  '5fafaf'),
+    ('74',  '5fafd7'),
+    ('75',  '5fafff'),
+    ('76',  '5fd700'),
+    ('77',  '5fd75f'),
+    ('78',  '5fd787'),
+    ('79',  '5fd7af'),
+    ('80',  '5fd7d7'),
+    ('81',  '5fd7ff'),
+    ('82',  '5fff00'),
+    ('83',  '5fff5f'),
+    ('84',  '5fff87'),
+    ('85',  '5fffaf'),
+    ('86',  '5fffd7'),
+    ('87',  '5fffff'),
+    ('88',  '870000'),
+    ('89',  '87005f'),
+    ('90',  '870087'),
+    ('91',  '8700af'),
+    ('92',  '8700d7'),
+    ('93',  '8700ff'),
+    ('94',  '875f00'),
+    ('95',  '875f5f'),
+    ('96',  '875f87'),
+    ('97',  '875faf'),
+    ('98',  '875fd7'),
+    ('99',  '875fff'),
+    ('100', '878700'),
+    ('101', '87875f'),
+    ('102', '878787'),
+    ('103', '8787af'),
+    ('104', '8787d7'),
+    ('105', '8787ff'),
+    ('106', '87af00'),
+    ('107', '87af5f'),
+    ('108', '87af87'),
+    ('109', '87afaf'),
+    ('110', '87afd7'),
+    ('111', '87afff'),
+    ('112', '87d700'),
+    ('113', '87d75f'),
+    ('114', '87d787'),
+    ('115', '87d7af'),
+    ('116', '87d7d7'),
+    ('117', '87d7ff'),
+    ('118', '87ff00'),
+    ('119', '87ff5f'),
+    ('120', '87ff87'),
+    ('121', '87ffaf'),
+    ('122', '87ffd7'),
+    ('123', '87ffff'),
+    ('124', 'af0000'),
+    ('125', 'af005f'),
+    ('126', 'af0087'),
+    ('127', 'af00af'),
+    ('128', 'af00d7'),
+    ('129', 'af00ff'),
+    ('130', 'af5f00'),
+    ('131', 'af5f5f'),
+    ('132', 'af5f87'),
+    ('133', 'af5faf'),
+    ('134', 'af5fd7'),
+    ('135', 'af5fff'),
+    ('136', 'af8700'),
+    ('137', 'af875f'),
+    ('138', 'af8787'),
+    ('139', 'af87af'),
+    ('140', 'af87d7'),
+    ('141', 'af87ff'),
+    ('142', 'afaf00'),
+    ('143', 'afaf5f'),
+    ('144', 'afaf87'),
+    ('145', 'afafaf'),
+    ('146', 'afafd7'),
+    ('147', 'afafff'),
+    ('148', 'afd700'),
+    ('149', 'afd75f'),
+    ('150', 'afd787'),
+    ('151', 'afd7af'),
+    ('152', 'afd7d7'),
+    ('153', 'afd7ff'),
+    ('154', 'afff00'),
+    ('155', 'afff5f'),
+    ('156', 'afff87'),
+    ('157', 'afffaf'),
+    ('158', 'afffd7'),
+    ('159', 'afffff'),
+    ('160', 'd70000'),
+    ('161', 'd7005f'),
+    ('162', 'd70087'),
+    ('163', 'd700af'),
+    ('164', 'd700d7'),
+    ('165', 'd700ff'),
+    ('166', 'd75f00'),
+    ('167', 'd75f5f'),
+    ('168', 'd75f87'),
+    ('169', 'd75faf'),
+    ('170', 'd75fd7'),
+    ('171', 'd75fff'),
+    ('172', 'd78700'),
+    ('173', 'd7875f'),
+    ('174', 'd78787'),
+    ('175', 'd787af'),
+    ('176', 'd787d7'),
+    ('177', 'd787ff'),
+    ('178', 'd7af00'),
+    ('179', 'd7af5f'),
+    ('180', 'd7af87'),
+    ('181', 'd7afaf'),
+    ('182', 'd7afd7'),
+    ('183', 'd7afff'),
+    ('184', 'd7d700'),
+    ('185', 'd7d75f'),
+    ('186', 'd7d787'),
+    ('187', 'd7d7af'),
+    ('188', 'd7d7d7'),
+    ('189', 'd7d7ff'),
+    ('190', 'd7ff00'),
+    ('191', 'd7ff5f'),
+    ('192', 'd7ff87'),
+    ('193', 'd7ffaf'),
+    ('194', 'd7ffd7'),
+    ('195', 'd7ffff'),
+    ('196', 'ff0000'),
+    ('197', 'ff005f'),
+    ('198', 'ff0087'),
+    ('199', 'ff00af'),
+    ('200', 'ff00d7'),
+    ('201', 'ff00ff'),
+    ('202', 'ff5f00'),
+    ('203', 'ff5f5f'),
+    ('204', 'ff5f87'),
+    ('205', 'ff5faf'),
+    ('206', 'ff5fd7'),
+    ('207', 'ff5fff'),
+    ('208', 'ff8700'),
+    ('209', 'ff875f'),
+    ('210', 'ff8787'),
+    ('211', 'ff87af'),
+    ('212', 'ff87d7'),
+    ('213', 'ff87ff'),
+    ('214', 'ffaf00'),
+    ('215', 'ffaf5f'),
+    ('216', 'ffaf87'),
+    ('217', 'ffafaf'),
+    ('218', 'ffafd7'),
+    ('219', 'ffafff'),
+    ('220', 'ffd700'),
+    ('221', 'ffd75f'),
+    ('222', 'ffd787'),
+    ('223', 'ffd7af'),
+    ('224', 'ffd7d7'),
+    ('225', 'ffd7ff'),
+    ('226', 'ffff00'),
+    ('227', 'ffff5f'),
+    ('228', 'ffff87'),
+    ('229', 'ffffaf'),
+    ('230', 'ffffd7'),
+    ('231', 'ffffff'),
+
+    # Gray-scale range.
+    ('232', '080808'),
+    ('233', '121212'),
+    ('234', '1c1c1c'),
+    ('235', '262626'),
+    ('236', '303030'),
+    ('237', '3a3a3a'),
+    ('238', '444444'),
+    ('239', '4e4e4e'),
+    ('240', '585858'),
+    ('241', '626262'),
+    ('242', '6c6c6c'),
+    ('243', '767676'),
+    ('244', '808080'),
+    ('245', '8a8a8a'),
+    ('246', '949494'),
+    ('247', '9e9e9e'),
+    ('248', 'a8a8a8'),
+    ('249', 'b2b2b2'),
+    ('250', 'bcbcbc'),
+    ('251', 'c6c6c6'),
+    ('252', 'd0d0d0'),
+    ('253', 'dadada'),
+    ('254', 'e4e4e4'),
+    ('255', 'eeeeee'),
+]
+
+
+def _str2hex(hexstr):
+    return int(hexstr, 16)
+
+
+def _strip_hash(rgb):
+    """ Strip leading `#` if exists.
+    """ 
+    if rgb.startswith('#'):
+        rgb = rgb.lstrip('#')
+    return rgb
+
+
+def _create_dicts():
+    short2rgb_dict = dict(CLUT)
+    hex2aec_dict = {}
+    for k, v in short2rgb_dict.items():
+        hex2aec_dict[v] = k
+    return hex2aec_dict, short2rgb_dict
+
+
+def hex2aec(rgb):
+    """ Find the closest xterm-256 approximation (ansi escape code) to the given
+    hex value.
+    @param rgb: Hex code representing an RGB value, eg, 'abcdef'
+    @returns: String between 0 and 255, compatible with xterm.
+    >>> hex2aec('123456')
+    ('23', '005f5f')
+    >>> hex2aec('ffffff')
+    ('231', 'ffffff')
+    >>> hex2aec('0DADD6') # vimeo logo
+    ('38', '00afd7')
+    """
+    rgb = _strip_hash(rgb)
+    incs = (0x00, 0x5f, 0x87, 0xaf, 0xd7, 0xff)
+    # Break 6-char RGB code into 3 integer vals.
+    parts = [int(h, 16) for h in re.split(r'(..)(..)(..)', rgb)[1:4]]
+    res = []
+    for part in parts:
+        i = 0
+        while i < len(incs) - 1:
+            s, b = incs[i], incs[i+1]  # smaller, bigger
+            if s <= part <= b:
+                s1 = abs(s - part)
+                b1 = abs(b - part)
+                if s1 < b1:
+                    closest = s
+                else:
+                    closest = b
+                res.append(closest)
+                break
+            i += 1
+    res = ''.join([('%02.x' % i) for i in res])
+    return HEX2AEC_DICT[res]
+
+
+def inject_color(dircolors, template):
+    """ inject the color variables into the template
+    """
+    with open(template, 'r') as t:
+        for line in t:
+            print(line.format(**dircolors))
+
+
+if __name__ == '__main__':
+    HEX2AEC_DICT, SHORT2RGB_DICT = _create_dicts()
+    colors = {}
+    for k, v in hex_colors.items():
+        colors[k] = hex2aec(v)
+
+    # map basecolors to dircolor variables
+    dircolors = {
+        'document_color': colors['color05'],
+        'archive_color': colors['color06'],
+        'image_color': colors['color07'],
+        'audio_color': colors['color08'],
+        'video_color': colors['color09'],
+        'sourcecode_color': colors['color10'],
+        'dev_color': colors['color11'],
+        'data_color': colors['color12'],
+        'markup_color': colors['color13'],
+        'unimportant_color': colors['color14'],
+        'text_color': colors['color15'],
+        'office_color': colors['color16']
+    }
+
+    # TODO let template passed in or embedd
+    template = os.path.join(os.path.dirname(__file__),
+                            '../templates/dircolors.256dark')
+    inject_color(dircolors, template)
diff --git a/dot-config/flavours/templates/dircolors/templates/dircolors.256dark b/dot-config/flavours/templates/dircolors/templates/dircolors.256dark
new file mode 100644 (file)
index 0000000..63a1182
--- /dev/null
@@ -0,0 +1,408 @@
+# Term Section
+TERM Eterm
+TERM ansi
+TERM color-xterm
+TERM con132x25
+TERM con132x30
+TERM con132x43
+TERM con132x60
+TERM con80x25
+TERM con80x28
+TERM con80x30
+TERM con80x43
+TERM con80x50
+TERM con80x60
+TERM cons25
+TERM console
+TERM cygwin
+TERM dtterm
+TERM eterm-color
+TERM fbterm
+TERM gnome
+TERM gnome-256color
+TERM jfbterm
+TERM konsole
+TERM konsole-256color
+TERM kterm
+TERM linux
+TERM linux-c
+TERM mach-color
+TERM mlterm
+TERM putty
+TERM putty-256color
+TERM rxvt
+TERM rxvt-256color
+TERM rxvt-cygwin
+TERM rxvt-cygwin-native
+TERM rxvt-unicode
+TERM rxvt-unicode256
+TERM rxvt-unicode-256color
+TERM screen
+TERM screen-256color
+TERM screen-256color-bce
+TERM screen-256color-s
+TERM screen-256color-bce-s
+TERM screen-bce
+TERM screen-w
+TERM screen.linux
+TERM st
+TERM st-meta
+TERM st-256color
+TERM st-meta-256color
+TERM vt100
+TERM xterm
+TERM xterm-16color
+TERM xterm-256color
+TERM xterm-88color
+TERM xterm-color
+TERM xterm-debian
+TERM xterm-termite
+
+# Special files
+
+NORMAL 00
+# reset to "normal" color
+RESET 0
+
+# regular file
+# No color at all
+FILE 00
+
+# files with executable flag
+# system red in bold and underlined
+EXEC 04;01;31
+
+# directory
+# white on dark blue background
+# DIR 48;5;4;38;5;15;
+# bold and reversed
+DIR 30;47;01
+
+# symbolic link. (If you set this to 'target' instead of a
+# numerical value, the color is as for the file pointed to.)
+# white on light green background
+LINK 48;5;2;38;5;15;
+
+# symlink to nonexistent file, or non-stat'able file
+# white on red background
+ORPHAN 48;5;160;38;5;15;
+
+# ORPHAN 48;5;160;38;5;15;01 # <-bold
+# ORPHAN 48;5;235;38;5;160 # red on gray
+
+# regular file with more than one link
+# No color at all
+MULTIHARDLINK 00
+
+# named pipe
+# white on dark green background
+FIFO 48;5;8;38;5;15
+
+# socket
+# white on light blue background
+SOCK 48;5;12;38;5;15;
+
+# block device driver
+# white on brown background
+BLK 48;5;1;38;5;15
+
+# door
+# white on orange background
+DOOR 48;5;9;38;5;15
+
+# character device driver
+# white on pink background
+CHR 48;5;5;38;5;15
+
+# file that is setuid (u+s)
+# white on cyan background
+SETUID 48;5;14;38;5;15
+
+# file that is setgid (g+s)
+# white on gray background
+SETGID 48;5;0;38;5;15
+
+# file with capability
+# white on yellow background
+CAPABILITY 48;5;226;38;5;15
+
+# dir that is sticky and other-writable (+t,o+w)
+# white on purple background
+STICKY_OTHER_WRITABLE 48;5;55;38;5;15
+
+# dir that is other-writable (o+w) and not sticky
+# white on violet background
+OTHER_WRITABLE 48;5;93;38;5;15
+
+# dir with the sticky bit set (+t) and not other-writable
+# white on pink background
+STICKY 48;5;129;38;5;15
+
+# Filetypes
+
+# archives
+.7z 00;38;5;{archive_color}
+.Z 00;38;5;{archive_color}
+.ace 00;38;5;{archive_color}
+.apk 00;38;5;{archive_color}
+.apk 00;38;5;{archive_color}
+.arj 00;38;5;{archive_color}
+.bz 00;38;5;{archive_color}
+.bz2 00;38;5;{archive_color}
+.cpio 00;38;5;{archive_color}
+.deb 00;38;5;{archive_color}
+.dz 00;38;5;{archive_color}
+.egg 00;38;5;{archive_color}
+.gem 00;38;5;{archive_color}
+.gz 00;38;5;{archive_color}
+.jad 00;38;5;{archive_color}
+.jar 00;38;5;{archive_color}
+.lz 00;38;5;{archive_color}
+.lzh 00;38;5;{archive_color}
+.lzma 00;38;5;{archive_color}
+.rar 00;38;5;{archive_color}
+.rpm 00;38;5;{archive_color}
+.rpm 00;38;5;{archive_color}
+.rz 00;38;5;{archive_color}
+.tar 00;38;5;{archive_color}
+.taz 00;38;5;{archive_color}
+.tbz 00;38;5;{archive_color}
+.tbz2 00;38;5;{archive_color}
+.tgz 00;38;5;{archive_color}
+.tlz 00;38;5;{archive_color}
+.txz 00;38;5;{archive_color}
+.tz 00;38;5;{archive_color}
+.xz 00;38;5;{archive_color}
+.z 00;38;5;{archive_color}
+.zip 00;38;5;{archive_color}
+.zoo 00;38;5;{archive_color}
+
+# images
+.CR2 00;38;5;{image_color}
+.JPEG 00;38;5;{image_color}
+.JPG 00;38;5;{image_color}
+.bmp 00;38;5;{image_color}
+.cgm 00;38;5;{image_color}
+.dl 00;38;5;{image_color}
+.emf 00;38;5;{image_color}
+.eps 00;38;5;{image_color}
+.gif 00;38;5;{image_color}
+.ico 00;38;5;{image_color}
+.jpeg 00;38;5;{image_color}
+.jpg 00;38;5;{image_color}
+.mng 00;38;5;{image_color}
+.pbm 00;38;5;{image_color}
+.pcx 00;38;5;{image_color}
+.pgm 00;38;5;{image_color}
+.png 00;38;5;{image_color}
+.ppm 00;38;5;{image_color}
+.svg 00;38;5;{image_color}
+.svgz 00;38;5;{image_color}
+.tga 00;38;5;{image_color}
+.tif 00;38;5;{image_color}
+.tiff 00;38;5;{image_color}
+.xbm 00;38;5;{image_color}
+.xbm 00;38;5;{image_color}
+.xcf 00;38;5;{image_color}
+.xpm 00;38;5;{image_color}
+.xwd 00;38;5;{image_color}
+.yuv 00;38;5;{image_color}
+.xpm 00;38;5;{image_color}
+
+# audio
+.aac 00;38;5;{audio_color}
+.au 00;38;5;{audio_color}
+.au 00;38;5;{audio_color}
+.axa 00;38;5;{audio_color}
+.flac 00;38;5;{audio_color}
+.flac 00;38;5;{audio_color}
+.m4a 00;38;5;{audio_color}
+.mid 00;38;5;{audio_color}
+.mid 00;38;5;{audio_color}
+.midi 00;38;5;{audio_color}
+.midi 00;38;5;{audio_color}
+.mka 00;38;5;{audio_color}
+.mka 00;38;5;{audio_color}
+.mp3 00;38;5;{audio_color}
+.mp3 00;38;5;{audio_color}
+.mpc 00;38;5;{audio_color}
+.mpc 00;38;5;{audio_color}
+.oga 00;38;5;{audio_color}
+.ogg 00;38;5;{audio_color}
+.ogg 00;38;5;{audio_color}
+.ra 00;38;5;{audio_color}
+.ra 00;38;5;{audio_color}
+.spx 00;38;5;{audio_color}
+.wav 00;38;5;{audio_color}
+.wav 00;38;5;{audio_color}
+.xspf 00;38;5;{audio_color}
+
+# video
+.anx 00;38;5;{video_color}
+.asf 00;38;5;{video_color}
+.avi 00;38;5;{video_color}
+.axv 00;38;5;{video_color}
+.divx 00;38;5;{video_color}
+.flc 00;38;5;{video_color}
+.fli 00;38;5;{video_color}
+.flv 00;38;5;{video_color}
+.gl 00;38;5;{video_color}
+.m2ts 00;38;5;{video_color}
+.m2v 00;38;5;{video_color}
+.m4v 00;38;5;{video_color}
+.mkv 00;38;5;{video_color}
+.mov 00;38;5;{video_color}
+.mp4 00;38;5;{video_color}
+.mp4v 00;38;5;{video_color}
+.mpeg 00;38;5;{video_color}
+.mpg 00;38;5;{video_color}
+.nuv 00;38;5;{video_color}
+.ogm 00;38;5;{video_color}
+.ogv 00;38;5;{video_color}
+.ogx 00;38;5;{video_color}
+.qt 00;38;5;{video_color}
+.qt 00;38;5;{video_color}
+.rm 00;38;5;{video_color}
+.rmvb 00;38;5;{video_color}
+.vob 00;38;5;{video_color}
+.webm 00;38;5;{video_color}
+.wmv 00;38;5;{video_color}
+
+# sourcecode
+*1 01;38;5;{sourcecode_color}
+*rc 01;38;5;{sourcecode_color}
+.awk 01;38;5;{sourcecode_color}
+.bash 01;38;5;{sourcecode_color}
+.bat 01;38;5;{sourcecode_color}
+.c 01;38;5;{sourcecode_color}
+.cc 01;38;5;{sourcecode_color}
+.coffee 01;38;5;{sourcecode_color}
+.cpp 01;38;5;{sourcecode_color}
+.cs 01;38;5;{sourcecode_color}
+.el 01;38;5;{sourcecode_color}
+.go 01;38;5;{sourcecode_color}
+.h 01;38;5;{sourcecode_color}
+.hs 01;38;5;{sourcecode_color}
+.java 01;38;5;{sourcecode_color}
+.js 01;38;5;{sourcecode_color}
+.lisp 01;38;5;{sourcecode_color}
+.lua 01;38;5;{sourcecode_color}
+.php 01;38;5;{sourcecode_color}
+.pl 01;38;5;{sourcecode_color}
+.py 01;38;5;{sourcecode_color}
+.rb 01;38;5;{sourcecode_color}
+.s 01;38;5;{sourcecode_color}
+.scala 01;38;5;{sourcecode_color}
+.scm 01;38;5;{sourcecode_color}
+.sed 01;38;5;{sourcecode_color}
+.sh 01;38;5;{sourcecode_color}
+.swift 01;38;5;{sourcecode_color}
+.vim 01;38;5;{sourcecode_color}
+.vue 01;38;5;{sourcecode_color}
+.zsh 01;38;5;{sourcecode_color}
+.zsh-theme 01;38;5;{sourcecode_color}
+
+# other dev files
+*AUTHORS 01;38;5;{dev_color}
+*CMakeLists.txt 01;38;5;{dev_color}
+*Dockerfile 01;38;5;{dev_color}
+*LICENSE 01;38;5;{dev_color}
+*Makefile 01;38;5;{dev_color}
+*README 01;38;5;{dev_color}
+*Rakefile 01;38;5;{dev_color}
+*Vagrantfile 01;38;5;{dev_color}
+*build.xml 01;38;5;{dev_color}
+*license 01;38;5;{dev_color}
+.256dark 01;38;5;{dev_color}
+.cabal 01;38;5;{dev_color}
+.cfg 01;38;5;{dev_color}
+.conf 01;38;5;{dev_color}
+.config 01;38;5;{dev_color}
+.svn 01;38;5;{dev_color}
+.gitignore 01;38;5;{dev_color}
+.gitmodules 01;38;5;{dev_color}
+.gpg 01;38;5;{dev_color}
+.ini 01;38;5;{dev_color}
+.log 01;38;5;{dev_color}
+.make 01;38;5;{dev_color}
+.min 01;38;5;{dev_color}
+.mk 01;38;5;{dev_color}
+.sql 01;38;5;{dev_color}
+
+# data
+.csv 01;38;5;{data_color}
+.dat 01;38;5;{data_color}
+.json 01;38;5;{data_color}
+.sqlite3 01;38;5;{data_color}
+.xml 01;38;5;{data_color}
+.yaml 01;38;5;{data_color}
+.yml 01;38;5;{data_color}
+
+# markup & style
+.css 01;38;5;{markup_color}
+.htm 01;38;5;{markup_color}
+.html 01;38;5;{markup_color}
+.less 01;38;5;{markup_color}
+.mustache 01;38;5;{markup_color}
+.sass 01;38;5;{markup_color}
+.scss 01;38;5;{markup_color}
+.theme 01;38;5;{markup_color}
+.xhtml 01;38;5;{markup_color}
+.xml 01;38;5;{markup_color}
+
+# unimportant files
+*# 00;38;5;{unimportant_color}
+*~ 00;38;5;{unimportant_color}
+.DS_Store 00;38;5;{unimportant_color}
+.aux 00;38;5;{unimportant_color}
+.bak 00;38;5;{unimportant_color}
+.bbl 00;38;5;{unimportant_color}
+.blg 00;38;5;{unimportant_color}
+.bu 00;38;5;{unimportant_color}
+.cache 00;38;5;{unimportant_color}
+.class 00;38;5;{unimportant_color}
+.elc 00;38;5;{unimportant_color}
+.incomplete 00;38;5;{unimportant_color}
+.lof 00;38;5;{unimportant_color}
+.lol 00;38;5;{unimportant_color}
+.lot 00;38;5;{unimportant_color}
+.old 00;38;5;{unimportant_color}
+.out 00;38;5;{unimportant_color}
+.part 00;38;5;{unimportant_color}
+.project 00;38;5;{unimportant_color}
+.pyc 00;38;5;{unimportant_color}
+.swp 00;38;5;{unimportant_color}
+.temp 00;38;5;{unimportant_color}
+.tmp 00;38;5;{unimportant_color}
+.toc 00;38;5;{unimportant_color}
+
+# text
+.markdown 00;38;5;{text_color}
+.md 00;38;5;{text_color}
+.mkd 00;38;5;{text_color}
+.nfo 00;38;5;{text_color}
+.org 00;38;5;{text_color}
+.pandoc 00;38;5;{text_color}
+.rst 00;38;5;{text_color}
+.tex 00;38;5;{text_color}
+.txt 00;38;5;{text_color}
+
+# office
+.doc 00;38;5;{office_color}
+.docx 00;38;5;{office_color}
+.ics 00;38;5;{office_color}
+.odp 00;38;5;{office_color}
+.ods 00;38;5;{office_color}
+.odt 00;38;5;{office_color}
+.odt 00;38;5;{office_color}
+.ppt 00;38;5;{office_color}
+.pptx 00;38;5;{office_color}
+.rtf 00;38;5;{office_color}
+.xls 00;38;5;{office_color}
+.xlsx 00;38;5;{office_color}
+
+# documents
+.epub 00;38;5;{document_color}
+.mobi 00;38;5;{document_color}
+.pdc 00;38;5;{document_color}
+.pdf 00;38;5;{document_color}
\ No newline at end of file