[download]

local/bin/theme

   1 #!/bin/bash
   2 
   3 declare -A ashes_base16=( # {{{
   4     [background]='#1c2023' [foreground]='#c7ccd1'
   5         [color0]='#1c2023'     [color8]='#747c84'
   6         [color1]='#c7ae95'     [color9]='#c7ae95'
   7         [color2]='#95c7ae'    [color10]='#95c7ae'
   8         [color3]='#aec795'    [color11]='#aec795'
   9         [color4]='#ae95c7'    [color12]='#ae95c7'
  10         [color5]='#c795ae'    [color13]='#c795ae'
  11         [color6]='#95aec7'    [color14]='#95aec7'
  12         [color7]='#c7ccd1'    [color15]='#f3f4f5'
  13 ) # }}}
  14 declare -A blossom=( # {{{
  15     [background]='#2f3846' [foreground]='#dfdff2'
  16         [color0]='#3e4755'     [color8]='#5d6473'
  17         [color1]='#e28479'     [color9]='#ec8e83'
  18         [color2]='#70b791'    [color10]='#7ac19b'
  19         [color3]='#c9c76b'    [color11]='#d3d175'
  20         [color4]='#839aec'    [color12]='#8da4f6'
  21         [color5]='#d18493'    [color13]='#db8e9d'
  22         [color6]='#78b3c5'    [color14]='#82bdcf'
  23         [color7]='#d2d2d4'    [color15]='#d1d1d3'
  24 ) # }}}
  25 declare -A blossom2=( # {{{
  26     [background]='#2f3846' [foreground]='#efeff2'
  27         [color0]='#3e4755'     [color8]='#5d6473'
  28         [color1]='#e28479'     [color9]='#ec8e83'
  29         [color2]='#70b791'    [color10]='#7ac19b'
  30         [color3]='#c9c76b'    [color11]='#d3d175'
  31         [color4]='#839aec'    [color12]='#8da4f6'
  32         [color5]='#d18493'    [color13]='#db8e9d'
  33         [color6]='#78b3c5'    [color14]='#82bdcf'
  34         [color7]='#d2d2d4'    [color15]='#d1d1d3'
  35 ) # }}}
  36 declare -A ci_dark=( # {{{
  37     [background]='#24292e' [foreground]='#f6f8fa'
  38         [color0]='#24292e'     [color8]='#3a3f43'
  39         [color1]='#f97583'     [color9]='#f97583'
  40         [color2]='#85e89d'    [color10]='#85e89d'
  41         [color3]='#ffea7f'    [color11]='#ffea7f'
  42         [color4]='#79b8ff'    [color12]='#79b8ff'
  43         [color5]='#b392f0'    [color13]='#b392f0'
  44         [color6]='#73e3ff'    [color14]='#73e3ff'
  45         [color7]='#959da5'    [color15]='#f6f8fa'
  46 ) # }}}
  47 declare -A default=( # {{{
  48     [background]='#222228' [foreground]='#d8dade'
  49         [color0]='#222228'     [color8]='#4e4e56' # [color8]='#37373f'
  50         [color1]='#ff5f5f'     [color9]='#ff5f5f'
  51         [color2]='#87af5f'    [color10]='#87af5f'
  52         [color3]='#d7af87'    [color11]='#d7af87' # [color11]='#ffd75f'
  53         [color4]='#5f5fff'    [color12]='#afafd7'
  54         [color5]='#d75fff'    [color13]='#d75fff'
  55         [color6]='#87d7d7'    [color14]='#87d7d6'
  56         [color7]='#a8aaae'    [color15]='#d8dade'
  57 ) # }}}
  58 declare -A default_base16=( # {{{
  59     [background]='#181818' [foreground]='#d8d8d8'
  60         [color0]='#181818'     [color8]='#585858'
  61         [color1]='#ab4642'     [color9]='#ab4642'
  62         [color2]='#a1b56c'    [color10]='#a1b56c'
  63         [color3]='#f7ca88'    [color11]='#f7ca88'
  64         [color4]='#7cafc2'    [color12]='#7cafc2'
  65         [color5]='#ba8baf'    [color13]='#ba8baf'
  66         [color6]='#86c1b9'    [color14]='#86c1b9'
  67         [color7]='#d8d8d8'    [color15]='#f8f8f8'
  68 ) # }}}
  69 declare -A dkeg_bluetype=( # {{{
  70     [background]='#272a2a' [foreground]='#80807e'
  71     [color0]='#272a2a'         [color8]='#484c4e'
  72     [color1]='#b05f5f'         [color9]='#b05f5f'
  73     [color2]='#b05f5f'        [color10]='#b05f5f'
  74     [color3]='#88aa55'        [color11]='#88aa55'
  75     [color4]='#88aa55'        [color12]='#88aa55'
  76     [color5]='#ccb05f'        [color13]='#ccb05f'
  77     [color6]='#ccb05f'        [color14]='#ccb05f'
  78     [color7]='#f6f7f8'        [color15]='#556973'
  79 ) # }}}
  80 declare -A dkeg_prevail=( # {{{
  81     [background]='#263139' [foreground]='#dac99d'
  82         [color0]='#263139'     [color8]='#455867'
  83         [color1]='#f36f62'     [color9]='#f36f62'
  84         [color2]='#c5e19c'    [color10]='#c5e19c'
  85         [color3]='#ccb478'    [color11]='#ccb478'
  86         [color4]='#4c7e89'    [color12]='#4c7e89'
  87         [color5]='#814d61'    [color13]='#814d61'
  88         [color6]='#79a69d'    [color14]='#79a69d'
  89         [color7]='#c4c4b5'    [color15]='#dbdbd1'
  90 ) # }}}
  91 declare -A dkeg_simplicity=( # {{{
  92     [background]='#28282c' [foreground]='#a18673'
  93         [color0]='#28282c'     [color8]='#404047'
  94         [color1]='#bf5c56'     [color9]='#bf5c56'
  95         [color2]='#bf5c56'    [color10]='#bf5c56'
  96         [color3]='#97b19c'    [color11]='#97b19c'
  97         [color4]='#97b19c'    [color12]='#97b19c'
  98         [color5]='#d7bd8a'    [color13]='#d7bd8a'
  99         [color6]='#d7bd8a'    [color14]='#d7bd8a'
 100         [color7]='#f4f4f2'    [color15]='#545f72'
 101 ) # }}}
 102 declare -A dracula=( # {{{
 103     [background]='#282a36' [foreground]='#f8f8f2'
 104         [color0]='#000000'     [color8]='#4d4d4d'
 105         [color1]='#ff5555'     [color9]='#ff6e67'
 106         [color2]='#50fa7b'    [color10]='#5af78e'
 107         [color3]='#f1fa8c'    [color11]='#f4f99d'
 108         [color4]='#bd93f9'    [color12]='#caa9fa'
 109         [color5]='#ff79c6'    [color13]='#ff92d0'
 110         [color6]='#8be9fd'    [color14]='#9aedfe'
 111         [color7]='#bfbfbf'    [color15]='#e6e6e6'
 112 ) # }}}
 113 declare -A dracula_base16=( # {{{
 114     [background]='#282936' [foreground]='#e9e9f4'
 115         [color0]='#282936'     [color8]='#4d4f68'
 116         [color1]='#ea51b2'     [color9]='#ea51b2'
 117         [color2]='#00f769'    [color10]='#00f769'
 118         [color3]='#ebff87'    [color11]='#ebff87'
 119         [color4]='#62d6e8'    [color12]='#62d6e8'
 120         [color5]='#b45bcf'    [color13]='#b45bcf'
 121         [color6]='#a1efe4'    [color14]='#a1efe4'
 122         [color7]='#e9e9f4'    [color15]='#f7f7fb'
 123 ) # }}}
 124 declare -A eighties_base16=( # {{{
 125     [background]='#2d2d2d' [foreground]='#d3d0c8'
 126         [color0]='#2d2d2d'     [color8]='#747369'
 127         [color1]='#f2777a'     [color9]='#f2777a'
 128         [color2]='#99cc99'    [color10]='#99cc99'
 129         [color3]='#ffcc66'    [color11]='#ffcc66'
 130         [color4]='#6699cc'    [color12]='#6699cc'
 131         [color5]='#cc99cc'    [color13]='#cc99cc'
 132         [color6]='#66cccc'    [color14]='#66cccc'
 133         [color7]='#d3d0c8'    [color15]='#f2f0ec'
 134 ) # }}}
 135 declare -A everforest=( # {{{
 136     [background]='#323d43' [foreground]='#d8caac'
 137         [color0]='#868d80'     [color8]='#868d80'
 138         [color1]='#e68183'     [color9]='#e68183'
 139         [color2]='#a7c080'    [color10]='#a7c080'
 140         [color3]='#d9bb80'    [color11]='#d9bb80'
 141         [color4]='#89beba'    [color12]='#89beba'
 142         [color5]='#d3a0bc'    [color13]='#d3a0bc'
 143         [color6]='#87c095'    [color14]='#87c095'
 144         [color7]='#d8caac'    [color15]='#d8caac'
 145 ) # }}}
 146 declare -A flat_base16=( # {{{
 147     [background]='#2c3e50' [foreground]='#e0e0e0'
 148         [color0]='#2c3e50'     [color8]='#95a5a6'
 149         [color1]='#e74c3c'     [color9]='#e74c3c'
 150         [color2]='#2ecc71'    [color10]='#2ecc71'
 151         [color3]='#f1c40f'    [color11]='#f1c40f'
 152         [color4]='#3498db'    [color12]='#3498db'
 153         [color5]='#9b59b6'    [color13]='#9b59b6'
 154         [color6]='#1abc9c'    [color14]='#1abc9c'
 155         [color7]='#e0e0e0'    [color15]='#ecf0f1'
 156 ) # }}}
 157 declare -A gruvbox_hard_base16=( # {{{
 158     [background]='#1d2021' [foreground]='#d5c4a1'
 159         [color0]='#1d2021'     [color8]='#665c54'
 160         [color1]='#fb4934'     [color9]='#fb4934'
 161         [color2]='#b8bb26'    [color10]='#b8bb26'
 162         [color3]='#fabd2f'    [color11]='#fabd2f'
 163         [color4]='#83a598'    [color12]='#83a598'
 164         [color5]='#d3869b'    [color13]='#d3869b'
 165         [color6]='#8ec07c'    [color14]='#8ec07c'
 166         [color7]='#d5c4a1'    [color15]='#fbf1c7'
 167 ) # }}}
 168 declare -A gruvbox_medium_base16=( # {{{
 169     [background]='#282828' [foreground]='#d5c4a1'
 170         [color0]='#282828'     [color8]='#665c54'
 171         [color1]='#fb4934'     [color9]='#fb4934'
 172         [color2]='#b8bb26'    [color10]='#b8bb26'
 173         [color3]='#fabd2f'    [color11]='#fabd2f'
 174         [color4]='#83a598'    [color12]='#83a598'
 175         [color5]='#d3869b'    [color13]='#d3869b'
 176         [color6]='#8ec07c'    [color14]='#8ec07c'
 177         [color7]='#d5c4a1'    [color15]='#fbf1c7'
 178 ) # }}}
 179 declare -A gruvbox_pale_base16=( # {{{
 180     [background]='#262626' [foreground]='#dab997'
 181         [color0]='#262626'     [color8]='#8a8a8a'
 182         [color1]='#d75f5f'     [color9]='#d75f5f'
 183         [color2]='#afaf00'    [color10]='#afaf00'
 184         [color3]='#ffaf00'    [color11]='#ffaf00'
 185         [color4]='#83adad'    [color12]='#83adad'
 186         [color5]='#d485ad'    [color13]='#d485ad'
 187         [color6]='#85ad85'    [color14]='#85ad85'
 188         [color7]='#dab997'    [color15]='#ebdbb2'
 189 ) # }}}
 190 declare -A gruvbox_soft_base16=( # {{{
 191     [background]='#32302f' [foreground]='#d5c4a1'
 192         [color0]='#32302f'     [color8]='#665c54'
 193         [color1]='#fb4934'     [color9]='#fb4934'
 194         [color2]='#b8bb26'    [color10]='#b8bb26'
 195         [color3]='#fabd2f'    [color11]='#fabd2f'
 196         [color4]='#83a598'    [color12]='#83a598'
 197         [color5]='#d3869b'    [color13]='#d3869b'
 198         [color6]='#8ec07c'    [color14]='#8ec07c'
 199         [color7]='#d5c4a1'    [color15]='#fbf1c7'
 200 ) # }}}
 201 declare -A hybrid=( # {{{
 202     [background]='#1d1f21' [foreground]='#c5c8c6'
 203         [color0]='#282a2e'     [color8]='#373b41'
 204         [color1]='#cc6666'     [color9]='#cc6666'
 205         [color2]='#b5bd68'    [color10]='#b5bd68'
 206         [color3]='#f0c674'    [color11]='#f0c674'
 207         [color4]='#81a2be'    [color12]='#81a2be'
 208         [color5]='#b294bb'    [color13]='#b294bb'
 209         [color6]='#8abeb7'    [color14]='#8abeb7'
 210         [color7]='#c5c8c6'    [color15]='#c5c8c6'
 211 ) # }}}
 212 declare -A hybrid2=( # {{{
 213     [background]='#1d1f21' [foreground]='#e5e8e6'
 214         [color0]='#282a2e'     [color8]='#373b41'
 215         [color1]='#cc6666'     [color9]='#cc6666'
 216         [color2]='#b5bd68'    [color10]='#b5bd68'
 217         [color3]='#f0c674'    [color11]='#f0c674'
 218         [color4]='#81a2be'    [color12]='#81a2be'
 219         [color5]='#b294bb'    [color13]='#b294bb'
 220         [color6]='#8abeb7'    [color14]='#8abeb7'
 221         [color7]='#c5c8c6'    [color15]='#c5c8c6'
 222 ) # }}}
 223 declare -A hybrid_material=( # {{{
 224     [background]='#263238' [foreground]='#ffffff'
 225         [color0]='#263238'     [color8]='#707880'
 226         [color1]='#cc6666'     [color9]='#cc6666'
 227         [color2]='#f0c674'    [color10]='#f0c674'
 228         [color3]='#b5bd68'    [color11]='#b5bd68'
 229         [color4]='#8abeb7'    [color12]='#8abeb7'
 230         [color5]='#81a2be'    [color13]='#81a2be'
 231         [color6]='#b294bb'    [color14]='#b294bb'
 232         [color7]='#ffffff'    [color15]='#ffffff'
 233 ) # }}}
 234 declare -A materia_base16=( # {{{
 235     [background]='#263238' [foreground]='#cdd3de'
 236         [color0]='#263238'     [color8]='#707880'
 237         [color1]='#ec5f67'     [color9]='#ec5f67'
 238         [color2]='#8bd649'    [color10]='#8bd649'
 239         [color3]='#ffcc00'    [color11]='#ffcc00'
 240         [color4]='#89ddff'    [color12]='#89ddff'
 241         [color5]='#82aaff'    [color13]='#82aaff'
 242         [color6]='#80cbc4'    [color14]='#80cbc4'
 243         [color7]='#cdd3de'    [color15]='#ffffff'
 244 ) # }}}
 245 declare -A material_base16=( # {{{
 246     [background]='#263238' [foreground]='#eeffff'
 247         [color0]='#263238'     [color8]='#546e7a'
 248         [color1]='#f07178'     [color9]='#f07178'
 249         [color2]='#c3e88d'    [color10]='#c3e88d'
 250         [color3]='#ffcb6b'    [color11]='#ffcb6b'
 251         [color4]='#82aaff'    [color12]='#82aaff'
 252         [color5]='#c792ea'    [color13]='#c792ea'
 253         [color6]='#89ddff'    [color14]='#89ddff'
 254         [color7]='#eeffff'    [color15]='#ffffff'
 255 ) # }}}
 256 declare -A material_palenight_base16=( # {{{
 257     [background]='#292d3e' [foreground]='#959dcb'
 258         [color0]='#292d3e'     [color8]='#676e95'
 259         [color1]='#f07178'     [color9]='#f07178'
 260         [color2]='#c3e88d'    [color10]='#c3e88d'
 261         [color3]='#ffcb6b'    [color11]='#ffcb6b'
 262         [color4]='#82aaff'    [color12]='#82aaff'
 263         [color5]='#c792ea'    [color13]='#c792ea'
 264         [color6]='#89ddff'    [color14]='#89ddff'
 265         [color7]='#959dcb'    [color15]='#ffffff'
 266 ) # }}}
 267 declare -A materialer_base16=( # {{{
 268     [background]='#212121' [foreground]='#eeffff'
 269         [color0]='#212121'     [color8]='#4a4a4a'
 270         [color1]='#f07178'     [color9]='#f07178'
 271         [color2]='#c3e88d'    [color10]='#c3e88d'
 272         [color3]='#ffcb6b'    [color11]='#ffcb6b'
 273         [color4]='#82aaff'    [color12]='#82aaff'
 274         [color5]='#c792ea'    [color13]='#c792ea'
 275         [color6]='#89ddff'    [color14]='#89ddff'
 276         [color7]='#eeffff'    [color15]='#ffffff'
 277 ) # }}}
 278 declare -A mocha_base16=( # {{{
 279     [background]='#3b3228' [foreground]='#d0c8c6'
 280         [color0]='#3b3228'     [color8]='#7e705a'
 281         [color1]='#cb6077'     [color9]='#cb6077'
 282         [color2]='#beb55b'    [color10]='#beb55b'
 283         [color3]='#f4bc87'    [color11]='#f4bc87'
 284         [color4]='#8ab3b5'    [color12]='#8ab3b5'
 285         [color5]='#a89bb9'    [color13]='#a89bb9'
 286         [color6]='#7bbda4'    [color14]='#7bbda4'
 287         [color7]='#d0c8c6'    [color15]='#f5eeeb'
 288 ) # }}}
 289 declare -A monokai=( # {{{
 290     [background]='#272822' [foreground]='#f8f8f2'
 291         [color0]='#272822'     [color8]='#75715e'
 292         [color1]='#f92672'     [color9]='#f92672'
 293         [color2]='#a6e22e'    [color10]='#a6e22e'
 294         [color3]='#f4bf75'    [color11]='#f4bf75'
 295         [color4]='#66d9ef'    [color12]='#66d9ef'
 296         [color5]='#ae81ff'    [color13]='#ae81ff'
 297         [color6]='#a1efe4'    [color14]='#a1efe4'
 298         [color7]='#f8f8f2'    [color15]='#f8f8f2'
 299 ) # }}}
 300 declare -A muzieca_lowcontrast=( # {{{
 301     [background]='#3c3b37' [foreground]='#93a1a1'
 302         [color0]='#5f5f5f'     [color8]='#828282'
 303         [color1]='#d96468'     [color9]='#d98f93'
 304         [color2]='#b8d98f'    [color10]='#b8d98f'
 305         [color3]='#d9cf8f'    [color11]='#d9cf8f'
 306         [color4]='#8f99d9'    [color12]='#8f99d9'
 307         [color5]='#b08fd9'    [color13]='#b08fd9'
 308         [color6]='#8fd9d5'    [color14]='#8fd9d5'
 309         [color7]='#c5c5c5'    [color15]='#ffffff'
 310 ) # }}}
 311 declare -A nord=( # {{{
 312     [background]='#2e3440' [foreground]='#d8dee9'
 313         [color0]='#3b4252'     [color8]='#4c566a'
 314         [color1]='#bf616a'     [color9]='#bf616a'
 315         [color2]='#a3be8c'    [color10]='#a3be8c'
 316         [color3]='#ebcb8b'    [color11]='#ebcb8b'
 317         [color4]='#81a1c1'    [color12]='#81a1c1'
 318         [color5]='#b48ead'    [color13]='#b48ead'
 319         [color6]='#88c0d0'    [color14]='#8fbcbb'
 320         [color7]='#e5e9f0'    [color15]='#eceff4'
 321 ) # }}}
 322 declare -A nord_base16=( # {{{
 323     [background]='#2e3440' [foreground]='#e5e9f0'
 324         [color0]='#2e3440'     [color8]='#4c566a'
 325         [color1]='#88c0d0'     [color9]='#88c0d0'
 326         [color2]='#bf616a'    [color10]='#bf616a'
 327         [color3]='#5e81ac'    [color11]='#5e81ac'
 328         [color4]='#ebcb8b'    [color12]='#ebcb8b'
 329         [color5]='#a3be8c'    [color13]='#a3be8c'
 330         [color6]='#d08770'    [color14]='#d08770'
 331         [color7]='#e5e9f0'    [color15]='#8fbcbb'
 332 ) # }}}
 333 declare -A ocean_base16=( # {{{
 334     [background]='#2b303b' [foreground]='#c0c5ce'
 335         [color0]='#2b303b'     [color8]='#65737e'
 336         [color1]='#bf616a'     [color9]='#bf616a'
 337         [color2]='#a3be8c'    [color10]='#a3be8c'
 338         [color3]='#ebcb8b'    [color11]='#ebcb8b'
 339         [color4]='#8fa1b3'    [color12]='#8fa1b3'
 340         [color5]='#b48ead'    [color13]='#b48ead'
 341         [color6]='#96b5b4'    [color14]='#96b5b4'
 342         [color7]='#c0c5ce'    [color15]='#eff1f5'
 343 ) # }}}
 344 declare -A oceanicnext_base16=( # {{{
 345     [background]='#1b2b34' [foreground]='#c0c5ce'
 346         [color0]='#1b2b34'     [color8]='#65737e'
 347         [color1]='#ec5f67'     [color9]='#ec5f67'
 348         [color2]='#99c794'    [color10]='#99c794'
 349         [color3]='#fac863'    [color11]='#fac863'
 350         [color4]='#6699cc'    [color12]='#6699cc'
 351         [color5]='#c594c5'    [color13]='#c594c5'
 352         [color6]='#5fb3b3'    [color14]='#5fb3b3'
 353         [color7]='#c0c5ce'    [color15]='#d8dee9'
 354 ) # }}}
 355 declare -A porple_base16=( # {{{
 356     [background]='#292c36' [foreground]='#d8d8d8'
 357         [color0]='#292c36'     [color8]='#65568a'
 358         [color1]='#f84547'     [color9]='#f84547'
 359         [color2]='#95c76f'    [color10]='#95c76f'
 360         [color3]='#efa16b'    [color11]='#efa16b'
 361         [color4]='#8485ce'    [color12]='#8485ce'
 362         [color5]='#b74989'    [color13]='#b74989'
 363         [color6]='#64878f'    [color14]='#64878f'
 364         [color7]='#d8d8d8'    [color15]='#f8f8f8'
 365 ) # }}}
 366 declare -A rose_pine=( # {{{
 367     [background]='#191724' [foreground]='#e0def4'
 368         [color0]='#26233a'     [color8]='#6e6a86'
 369         [color1]='#eb6f92'     [color9]='#eb6f92'
 370         [color2]='#31748f'    [color10]='#31748f'
 371         [color3]='#f6c177'    [color11]='#f6c177'
 372         [color4]='#9ccfd8'    [color12]='#9ccfd8'
 373         [color5]='#c4a7e7'    [color13]='#c4a7e7'
 374         [color6]='#ebbcba'    [color14]='#ebbcba'
 375         [color7]='#e0def4'    [color15]='#e0def4'
 376 ) # }}}
 377 declare -A rose_pine_moon=( # {{{
 378     [background]='#232136' [foreground]='#e0def4'
 379         [color0]='#393552'     [color8]='#817c9c'
 380         [color1]='#eb6f92'     [color9]='#eb6f92'
 381         [color2]='#3e8fb0'    [color10]='#3e8fb0'
 382         [color3]='#f6c177'    [color11]='#f6c177'
 383         [color4]='#9ccfd8'    [color12]='#9ccfd8'
 384         [color5]='#c4a7e7'    [color13]='#c4a7e7'
 385         [color6]='#ea9a97'    [color14]='#ea9a97'
 386         [color7]='#e0def4'    [color15]='#e0def4'
 387 ) # }}}
 388 declare -A rebecca_base16=( # {{{
 389     [background]='#292a44' [foreground]='#f1eff8'
 390         [color0]='#292a44'     [color8]='#666699'
 391         [color1]='#a0a0c5'     [color9]='#a0a0c5'
 392         [color2]='#6dfedf'    [color10]='#6dfedf'
 393         [color3]='#ae81ff'    [color11]='#ae81ff'
 394         [color4]='#2de0a7'    [color12]='#2de0a7'
 395         [color5]='#7aa5ff'    [color13]='#7aa5ff'
 396         [color6]='#8eaee0'    [color14]='#8eaee0'
 397         [color7]='#f1eff8'    [color15]='#53495d'
 398 ) # }}}
 399 declare -A solarized=( # {{{
 400     [background]='#073642' [foreground]='#fdf6e3'
 401         [color0]='#073642'     [color8]='#6c7c80'
 402         [color1]='#dc322f'     [color9]='#dc322f'
 403         [color2]='#859900'    [color10]='#859900'
 404         [color3]='#b58900'    [color11]='#b58900'
 405         [color4]='#268bd2'    [color12]='#268bd2'
 406         [color5]='#d33682'    [color13]='#d33682'
 407         [color6]='#2aa198'    [color14]='#2aa198'
 408         [color7]='#eee8d5'    [color15]='#eee8d5'
 409 ) # }}}
 410 declare -A tomorrow_night_base16=( # {{{
 411     [background]='#1d1f21' [foreground]='#c5c8c6'
 412         [color0]='#1d1f21'     [color8]='#969896'
 413         [color1]='#cc6666'     [color9]='#cc6666'
 414         [color2]='#b5bd68'    [color10]='#b5bd68'
 415         [color3]='#f0c674'    [color11]='#f0c674'
 416         [color4]='#81a2be'    [color12]='#81a2be'
 417         [color5]='#b294bb'    [color13]='#b294bb'
 418         [color6]='#8abeb7'    [color14]='#8abeb7'
 419         [color7]='#c5c8c6'    [color15]='#ffffff'
 420 ) # }}}
 421 declare -A zenburn3=( # {{{
 422     [background]='#3f3f3f' [foreground]='#ffffff'
 423         [color0]='#3f3f3f'     [color8]='#828282'
 424         [color1]='#dca5a5'     [color9]='#dca5a5'
 425         [color2]='#c0e380'    [color10]='#c0e380'
 426         [color3]='#e4e49a'    [color11]='#e4e49a'
 427         [color4]='#7d9ec0'    [color12]='#7d9ec0'
 428         [color5]='#ffc66d'    [color13]='#ffc66d'
 429         [color6]='#8acccf'    [color14]='#8acccf'
 430         [color7]='#ffffff'    [color15]='#ffffff'
 431 ) # }}}
 432 
 433 return 2>&-
 434 
 435 declare -n colors=default
 436 declare -a gtk=( # {{{
 437       black1 black2
 438         red1 red2
 439       green1 green2
 440      yellow1 yellow2
 441        blue1 blue2
 442     magenta1 magenta2
 443        cyan1 cyan2
 444       white1 white2
 445 ) # }}}
 446 declare -A map=( # {{{
 447       [black1]=color0   [black2]=color8
 448         [red1]=color1     [red2]=color9
 449       [green1]=color2   [green2]=color10
 450      [yellow1]=color3  [yellow2]=color11
 451        [blue1]=color4    [blue2]=color12
 452     [magenta1]=color5 [magenta2]=color13
 453        [cyan1]=color6    [cyan2]=color14
 454       [white1]=color7   [white2]=color15
 455 ) # }}}
 456 
 457 source ~/.theme/sh 2>&- &&
 458 for i in {back,fore}ground color{0..15}; do colors[$i]=${!i}; done
 459 
 460 ################################################################################
 461 
 462 adjust(){ # {{{
 463     local r=$(printf %d 0x${1:1:2} | awk -v m=$2 '{ print int($1 * m) }')
 464     local g=$(printf %d 0x${1:3:2} | awk -v m=$2 '{ print int($1 * m) }')
 465     local b=$(printf %d 0x${1:5:2} | awk -v m=$2 '{ print int($1 * m) }')
 466 
 467     (( r < 0 )) && r=0
 468     (( g < 0 )) && g=0
 469     (( b < 0 )) && b=0
 470 
 471     (( r > 255 )) && r=255
 472     (( g > 255 )) && g=255
 473     (( b > 255 )) && b=255
 474 
 475     printf '#%02x%02x%02x\n' $r $g $b
 476 } # }}}
 477 srgba(){ # {{{
 478     local r=$(printf %d 0x${1:1:2})
 479     local g=$(printf %d 0x${1:3:2})
 480     local b=$(printf %d 0x${1:5:2})
 481     local rgb="rgba($r, $g, $b"
 482 
 483     printf '%s/%-*s' "$rgb" ${#rgb} "alpha($(adjust $2 ${3:-1})"
 484 } # }}}
 485 
 486 case $1 in
 487     -r|--reload ) reload=1;;
 488     -R|--restart) reload=1 restart=1;;
 489 
 490     -b|--background) # {{{
 491         cp "$2" ~/.theme/background 2>&-
 492         hsetroot -solid ${colors[background]} -fill ~/.theme/background
 493 
 494         exit
 495     ;; # }}}
 496     -c|--colors    ) # {{{
 497         source $0; reload=1
 498         declare -n colors=${2:-null}
 499 
 500         list(){
 501             source $0
 502             local | sed 's/declare -A //' | grep -o '^\w*'
 503             exit
 504         }
 505 
 506         [[ $2 && ${colors[@]} ]] || list
 507     ;; # }}}
 508     -w|--wal       ) # {{{
 509         [[ ! $2 ]] && wal --theme && exit 1
 510 
 511         wal -c
 512 
 513         [[ -f $2 ]] && wal -qnstei "$2" && $0 -b "$2"
 514         [[ -f $2 ]] || wal -qnste --theme "${@:2}"
 515 
 516         cp ~/.cache/wal/colors.sh ~/.theme/sh && $0 -r
 517 
 518         exit
 519     ;; # }}}
 520     -g|--gtk       ) # {{{
 521         [[ ! $2 || ! ${map[$2]} ]] && printf '%s\n' ${gtk[@]} && exit 1
 522         $0 -t $2; $0 -i $2; exit
 523     ;; # }}}
 524     -t|--theme     ) # {{{
 525         [[ ! $2 || ! ${map[$2]} ]] && printf '%s\n' ${gtk[@]} && exit 1
 526 
 527         git clone https://gitlab.com/lxg/adapta ~/.local/share/themes/Adapta-Color 2>&-
 528         cd $_ && git checkout . 2>&-
 529 
 530         color=${map[$2]}
 531         color=${colors[$color]}
 532 
 533         [[ $background != \#222228 ]] &&
 534         find * -type f ! -name \*.png -exec sed -i "
 535             s/#13191c/$background/Ig                # panel
 536 
 537             s/#222d32/$background/Ig                # menubar
 538             s/#fdfdfe/$foreground/Ig                # submenu
 539             s/#28343a/$background/Ig                # submenu darkmode
 540 
 541             s/$(srgba \#cfd8dc $foreground 0.8)/Ig  # menuitem
 542             s/#cfd8dc/$(adjust $foreground 0.9)/Ig  # menuitem:hover
 543 
 544             s/#fafbfc/$(adjust $foreground 0.97)/Ig # top
 545             s/#f7f9f9/$(adjust $foreground 0.97)/Ig # left
 546             s/#ffffff/$foreground/Ig                # main
 547 
 548             s/$(srgba \#263238 $background)/Ig      # left text
 549             s/#263238/$background/Ig                # main text
 550 
 551             s/#1de9b6/$color/Ig                     # trash msg
 552             s/#ff1744/$color1/Ig                    # root  msg
 553 
 554             s/#e5e9ec/$(adjust $foreground 0.96)/Ig # line
 555             s/#80deea/$foreground/Ig                # selection
 556             s/$(srgba \#ffffff $foreground 0.9)/Ig  # scrollbar
 557 
 558             s/$(srgba \#459c95 $color)/Ig           # button
 559             s/#459c95/$color/Ig                     # button:hover
 560 
 561             s/$(srgba \#81c4bf $color)/Ig           # button
 562             s/#81c4bf/$color/Ig                     # button:hover
 563 
 564             s/$(srgba \#222d32 $background)/Ig      # tooltip
 565             s/#d4d7db/$foreground/Ig                # tooltip
 566 
 567             s/#00bcd4/$color/Ig                     # cyan500
 568             s/$(srgba \#00bcd4 $color)/Ig           # cyan500
 569 
 570             s/#4db6ac/$color/Ig                     # teal300
 571             s/$(srgba \#4db6ac $color)/Ig           # teal300
 572 
 573             s/#009688/$green1/Ig                    # teal500
 574             s/$(srgba \#009688 $green1)/Ig          # teal500
 575 
 576             s/#ff5252/$red1/Ig                      # reda200
 577             s/$(srgba \#ff5252 $red1)/Ig            # reda200
 578         " {} +
 579 
 580         for i in xfwm4/*.png; do
 581             convert $i -fuzz 0% -fill $background -opaque \#222d32 $i
 582         done
 583 
 584         echo "$2" > color
 585 
 586         xfconf-query -c xsettings -p /Net/ThemeName | grep -q Adapta-Color &&
 587         xfconf-query -c xsettings -p /Net/ThemeName -s '' &&
 588         xfconf-query -c xsettings -p /Net/ThemeName -s Adapta-Color
 589 
 590         gsettings list-recursively | grep Adapta-Color | while read a b c; do
 591             gsettings set $a $b ''
 592             gsettings set $a $b Adapta-Color
 593         done
 594 
 595         exit
 596     ;; # }}}
 597     -i|--icons     ) # {{{
 598         [[ ! $2 || ! ${map[$2]} ]] && printf '%s\n' ${gtk[@]} && exit 1
 599 
 600         git clone --depth=1 \
 601         https://github.com/PapirusDevelopmentTeam/papirus-icon-theme \
 602         ~/.local/share/icons/Papirus.git 2>&-
 603 
 604         cd $_ && git checkout . 2>&-
 605         ln -sT ${PWD##*/}/Papirus ../Papirus-Color 2>&-
 606         cd $_
 607 
 608         color=${map[$2]}
 609         color=${colors[$color]}
 610 
 611         if [[ $background != \#222228 ]]; then
 612             sed -i "
 613                 s/#4877b1/$(adjust $color 0.7)/Ig
 614                 s/#e4e4e4/$(adjust $foreground 0.97)/Ig
 615                 s/#5294e2/$color/Ig
 616                 s/#1d344f/$(adjust $color 0.5)/Ig
 617             " */places/{folder,user}-blue*.svg &
 618 
 619             sed -i "s/#444444/$black2/Ig"     */actions/*.svg &
 620             sed -i "s/#dfdfdf/$foreground/Ig" */panel/*.svg   &
 621 
 622             sed -i "
 623                 /transform=/d; /<\/g>/d
 624                 /<svg /a<g transform=\"translate(6, 6)\">
 625                 /<\/svg>/i</g>
 626                 s/#ffffff/$(adjust $color      0.5 );opacity:0.8/Ig
 627                 s/#455a64/$(adjust $foreground 0.97);opacity:0.4/Ig
 628             " */emblems/emblem-symbolic-link.svg &
 629 
 630             wait
 631         fi
 632 
 633         echo "$2" > color
 634         sed -i "s/Name=Papirus/Name=Papirus-Color/" index.theme
 635 
 636         xfconf-query -c xsettings -p /Net/IconThemeName | grep -q Papirus-Color &&
 637         xfconf-query -c xsettings -p /Net/IconThemeName -s '' &&
 638         xfconf-query -c xsettings -p /Net/IconThemeName -s Papirus-Color
 639 
 640         gsettings list-recursively | grep Papirus-Color | while read a b c; do
 641             gsettings set $a $b ''
 642             gsettings set $a $b Papirus-Color
 643         done
 644 
 645         exit
 646     ;; # }}}
 647 
 648     -C|--rand-colors) $0 -c $($0 -c | shuf -n 1); exit;;
 649     -G|--rand-gtk   ) $0 -g $($0 -g | shuf -n 1); exit;;
 650     -T|--rand-theme ) $0 -t $($0 -t | shuf -n 1); exit;;
 651     -I|--rand-icons ) $0 -i $($0 -i | shuf -n 1); exit;;
 652     -W|--rand-wal   ) $0 -w $($0 -w | grep '^\s-' | cut -c 4- | shuf -n 1); exit;;
 653 
 654     -a|--apply) # {{{
 655         t=Adapta-Color
 656         i=Papirus-Color
 657         b=~/.theme/background
 658 
 659         ########################################################################
 660 
 661         busctl set-property org.freedesktop.Accounts \
 662         /org/freedesktop/Accounts/User$UID            \
 663         org.freedesktop.DisplayManager.AccountsService \
 664         BackgroundFile s "$b"
 665 
 666         ########################################################################
 667 
 668         hsetroot -fill "$b"
 669 
 670         xfconf-query -c xfce4-desktop -l | grep last-image |
 671         xargs -rI % xfconf-query -c xfce4-desktop -p % -s "$b"
 672 
 673         gsettings set org.mate.background             picture-filename   "$b"
 674         gsettings set org.gnome.desktop.background    picture-uri "file://$b"
 675         gsettings set org.cinnamon.desktop.background picture-uri "file://$b"
 676 
 677         ########################################################################
 678         # 3 fill  stretched
 679         # 5 cover zoom
 680 
 681         xfconf-query -c xfce4-desktop -l | grep image-style |
 682         xargs -rI % xfconf-query -c xfce4-desktop -p % -s 3
 683 
 684         gsettings set org.mate.background             picture-options stretched
 685         gsettings set org.gnome.desktop.background    picture-options stretched
 686         gsettings set org.cinnamon.desktop.background picture-options stretched
 687 
 688         ########################################################################
 689 
 690         gsettings set org.mate.Marco.general  theme $t
 691         gsettings set org.mate.interface  gtk-theme $t
 692         gsettings set org.mate.interface icon-theme $i
 693 
 694         xfconf-query -c xfwm4     -p /general/theme     -s $t
 695         xfconf-query -c xsettings -p     /Net/ThemeName -s $t
 696         xfconf-query -c xsettings -p /Net/IconThemeName -s $i
 697 
 698         gsettings set org.gnome.desktop.wm.preferences theme $t
 699         gsettings set org.gnome.desktop.interface  gtk-theme $t
 700         gsettings set org.gnome.desktop.interface icon-theme $i
 701 
 702         gsettings set org.cinnamon.theme                   name $t
 703         gsettings set org.cinnamon.desktop.wm.preferences theme $t
 704         gsettings set org.cinnamon.desktop.interface  gtk-theme $t
 705         gsettings set org.cinnamon.desktop.interface icon-theme $i
 706 
 707         exit
 708     ;; # }}}
 709 
 710     '') ;;
 711      *) exit;;
 712 esac
 713 
 714 mkdir -p ~/.theme && cd $_
 715 
 716 ################################################################################
 717 
 718 [[ ${colors[foreground]} < ${colors[color7]}  ]] && colors[foreground]=${colors[color7]}
 719 [[ ${colors[foreground]} < ${colors[color15]} ]] && colors[foreground]=${colors[color15]}
 720 
 721 opacity=$(printf '%x' $(( 256 * 97 / 100 )))
 722 colors[background_rgba]=${colors[background]}$opacity
 723 colors[background_argb]=${colors[background]/\#/\#$opacity}
 724 
 725 for i in ${!map[@]}; do
 726     color=${map[$i]}
 727     colors[$i]=${colors[$color]}
 728 done
 729 
 730 ################################################################################
 731 
 732 print(){ # {{{
 733     printf "${2:-%s}\n" "$(
 734         for i in ${!colors[@]}; do
 735             printf "$1\n" $i "${colors[$i]}"
 736         done | sort -V
 737     )"
 738 } # }}}
 739 
 740 > xres print '*%s: %s'
 741 > lua  print '%s = "%s";'
 742 > vim  print 'let %s = "%s"'
 743 > sh   print 'export %s="%s"'
 744 > h    print 'char %s[] = "%s";'
 745 > ini  print '%s = %s' '[colors]\n%s'
 746 
 747 unset colors[background_rgba]
 748 unset colors[background_argb]
 749 
 750 > gtk  print '@define-color %s %s;'
 751 > rasi print '  %s: %s;' '* {\n%s\n}'
 752 > css  print '  --%s: %s;' ':root {\n%s\n}'
 753 
 754 > xterm printf '\e]%s;%s\a' \
 755 $(for i in {0..15}; do echo "4;$i" ${colors[color$i]}; done) \
 756 10 ${colors[foreground]} 4\;256 ${colors[foreground]} \
 757 11 ${colors[background]} 4\;257 ${colors[background]} \
 758 12 ${colors[foreground]} \
 759 13 ${colors[foreground]} \
 760 17 ${colors[foreground]} \
 761 19 ${colors[background]}
 762 
 763 colors[color7]=${colors[foreground]}
 764 > linux printf '\e]P%x%s\a' $(for i in {0..7}; do echo $i ${colors[color$i]:1}; done)
 765 
 766 ################################################################################
 767 
 768 source ./sh
 769 xrdb -m xres
 770 
 771 trap 'wait; echo; colors -c' EXIT
 772 
 773 $0   -b background  &
 774 test -f background || filvice -l &
 775 test    background -ot ~/.cache/lilvice && lilvice -r &
 776 
 777 find ~/.config ~/.local -name \*.theme |
 778 while read i; do envsubst < $i > ${i%.theme}; done &
 779 
 780 sed -i '/^ /d' ~/.config/xfce4/terminal/terminalrc
 781 echo "
 782     [Configuration]
 783     ColorBackground=$background
 784     ColorForeground=$foreground
 785 
 786     ColorCursor=$foreground
 787     ColorCursorUseDefault=FALSE
 788     ColorCursorForeground=$background
 789 
 790     ColorPalette=$(for i in color{0..15}; do echo -n "${!i};"; done)
 791 " | sed '/^$/d' >> $_
 792 
 793 ################################################################################
 794 
 795 [[ $reload ]] || exit 0
 796 
 797 test -s ~/.local/share/themes/Adapta-Color/color && $0 -t $(< $_) &
 798 test -s ~/.local/share/icons/Papirus-Color/color && $0 -i $(< $_) &
 799 
 800 for i in /dev/pts/[0-9]; do cat xterm > $i; done
 801 for i in /dev/tty[0-9];  do cat linux > $i; done 2>&-
 802 
 803 cmp -s background ~/.cache/filvice.png && filvice -r &
 804 vim --serverlist | xargs -I % vim --servername % --remote-send '<Esc>:so $MYGVIMRC<Cr>'
 805 
 806 pkill       -x dunst
 807 pkill -USR1 -x sxhkd
 808 pkill -USR1 -x openbox
 809 
 810 pkill -HUP  -x awesome
 811 pkill          awesome-status && awesome-status -d
 812 
 813 pkill -HUP  -x xfwm4
 814 pkill          xfwm4-status && xfwm4-status -d
 815 
 816 [[ $restart ]] || i3 reload
 817 pidof dwm && xdotool key super+F5
 818 
 819 [[ $restart ]] || exit 0
 820 
 821 i3 restart
 822 
 823 pkill -HUP  -x dwm
 824 pkill          dwm-status && dwm-status -d