make.py (36727B)
1 #!/usr/bin/env python3 2 # chamesle glass: window frames, buttons and panels for every desktop 3 # make.py SHARE writes SHARE/themes, SHARE/aurorae, SHARE/plasma, SHARE/color-schemes 4 import os, sys, math 5 from PIL import Image, ImageDraw 6 7 NAME = 'Chamesle-Glass' 8 TINT = (60, 145, 215) 9 TH = 30 # title height, top border included 10 B = 6 # side and bottom borders 11 R = 7 # corner radius 12 BH = 20 # caption buttons hang this far down 13 BW = {'hide': 28, 'maximize': 27, 'close': 48} 14 ORDER = ['hide', 'maximize', 'close'] 15 MW = {'hide': 30, 'maximize': 30, 'close': 30} # metacity has one width for all 16 17 # one row of glass: tint under a shine that stops sharp at the middle 18 def glass(y, h, a, x=0): 19 t = y / max(1, h - 1) 20 w = .46 - .30 * t / .5 if t < .5 else .10 * (t - .5) / .5 21 if (x + y * .47) % 120 < 18: 22 w += .07 23 al = w + a * (1 - w) 24 c = [int((255 * w + TINT[i] * a * (1 - w)) / max(al, .001)) for i in range(3)] 25 return (*c, int(255 * al)) 26 27 def mix(p, q, k): 28 return tuple(int(p[i] * (1 - k) + q[i] * k) for i in range(4)) 29 30 # the whole frame at size w x h, cut into pieces later 31 def frame(w, h, active): 32 a = .60 if active else .33 33 im = Image.new('RGBA', (w, h)) 34 px = im.load() 35 for y in range(h): 36 for x in range(w): 37 px[x, y] = glass(min(y, TH - 1), TH, a, x) 38 mb = Image.new('L', (w, h), 0) 39 ImageDraw.Draw(mb).rounded_rectangle((0, 0, w - 1, h - 1), R, fill=255) 40 k = Image.composite(im, Image.new('RGBA', (w, h)), mb) 41 d = ImageDraw.Draw(k) 42 d.rounded_rectangle((0, 0, w - 1, h - 1), R, outline=(0, 0, 0, 150)) 43 d.rounded_rectangle((1, 1, w - 2, h - 2), R - 1, outline=(255, 255, 255, 115 if active else 70)) 44 # the window sits in a hole; a thin dark line and a white one around it 45 d.rectangle((B - 1, TH - 1, w - B, h - B), outline=(255, 255, 255, 90)) 46 d.rectangle((B, TH, w - B - 1, h - B - 1), fill=(0, 0, 0, 0), outline=(0, 0, 0, 120)) 47 return k 48 49 def glyph(d, kind, x, y, w, h, s=1): 50 cx, cy = x + w / 2, y + h / 2 51 dk, wh = (20, 30, 45, 230), (255, 255, 255, 255) 52 def box(x0, y0, x1, y1, c, wd=0, f=None): 53 d.rectangle((cx + x0 * s, cy + y0 * s, cx + x1 * s, cy + y1 * s), fill=f, outline=c, width=int(wd * s)) 54 if kind == 'hide': 55 box(-5.5, 1.5, 5.5, 5.5, None, 0, dk); box(-4.5, 2.5, 4.5, 4.5, None, 0, wh) 56 elif kind == 'maximize': 57 box(-6.5, -5.5, 6.5, 5.5, dk, 4); box(-5.5, -4.5, 5.5, 4.5, wh, 2) 58 elif kind == 'restore': 59 for ox, oy in ((2, -3), (-2, 1)): 60 box(-4.5 + ox, -3.5 + oy, 4.5 + ox, 3.5 + oy, dk, 3); box(-3.5 + ox, -2.5 + oy, 3.5 + ox, 2.5 + oy, wh, 1.2) 61 elif kind == 'close': 62 xs = [((cx - 5 * s, cy - 4 * s), (cx + 5 * s, cy + 4 * s)), ((cx - 5 * s, cy + 4 * s), (cx + 5 * s, cy - 4 * s))] 63 for p in xs: 64 d.line(p, fill=dk, width=int(5 * s)) 65 for p in xs: 66 d.line(p, fill=wh, width=int(2.6 * s)) 67 68 def fill(state, red, active): 69 if red: 70 top, bot = {'prelight': ((255, 190, 170), (232, 72, 40)), 'pressed': ((190, 110, 90), (150, 35, 20))}.get(state, ((238, 160, 140), (200, 60, 40))) 71 al = 240 if active or state != 'normal' else 130 72 else: 73 top, bot = {'prelight': ((225, 245, 255), (90, 175, 240)), 'pressed': ((150, 190, 225), (60, 110, 165))}.get(state, ((235, 245, 252), (150, 185, 215))) 74 al = 255 if state != 'normal' else (150 if active else 90) 75 return top, bot, al 76 77 # the three buttons are drawn as one strip and cut apart, so they join 78 def button(kind, state, active, w=None, widths=None): 79 base = 'maximize' if kind == 'restore' else kind 80 ws = dict(widths or BW) 81 if w: 82 ws[base] = w 83 tw = sum(ws[k] for k in ORDER) 84 im = Image.new('RGBA', (tw, BH)) 85 px = im.load() 86 x0 = 0 87 for k in ORDER: 88 top, bot, al = fill(state if k == base else 'normal', k == 'close', active) 89 for y in range(BH): 90 t = y / (BH - 1) 91 c = [int(top[i] + (bot[i] - top[i]) * t) for i in range(3)] 92 if t < .5: 93 c = [int(v + (255 - v) * .45) for v in c] 94 for x in range(x0, x0 + ws[k]): 95 px[x, y] = (*c, al) 96 x0 += ws[k] 97 m = Image.new('L', (tw, BH), 0) 98 ImageDraw.Draw(m).rounded_rectangle((0, -8, tw - 1, BH - 1), 6, fill=255) 99 im = Image.composite(im, Image.new('RGBA', (tw, BH)), m) 100 d = ImageDraw.Draw(im) 101 d.rounded_rectangle((0, -8, tw - 1, BH - 1), 6, outline=(0, 0, 0, 170)) 102 d.rounded_rectangle((1, -8, tw - 2, BH - 2), 5, outline=(255, 255, 255, 120)) 103 x0 = 0 104 for k in ORDER: 105 if k == base: 106 break 107 x0 += ws[k] 108 if x0: 109 d.line((x0, 0, x0, BH - 2), fill=(0, 0, 0, 150)) 110 d.line((x0 + 1, 1, x0 + 1, BH - 3), fill=(255, 255, 255, 90)) 111 if base != ORDER[-1]: 112 e = x0 + ws[base] 113 d.line((e, 0, e, BH - 2), fill=(0, 0, 0, 150)) 114 # symbols at 4x, scaled down so they come out smooth 115 S = 4 116 g = Image.new('RGBA', (ws[base] * S, BH * S)) 117 glyph(ImageDraw.Draw(g), kind, 0, 0, ws[base] * S, BH * S, S) 118 im.alpha_composite(g.resize((ws[base], BH), Image.LANCZOS), (x0, 0)) 119 return im.crop((x0, 0, x0 + ws[base], BH)) 120 121 # window managers without alpha in frames: glass over a sky colour, edges cut sharp 122 def flat(im): 123 w, h = im.size 124 back = Image.new('RGBA', (w, h)) 125 px = back.load() 126 for y in range(h): 127 t = min(y, TH) / TH 128 c = tuple(int(a + (b - a) * t) for a, b in zip((150, 188, 222), (104, 150, 196))) 129 for x in range(w): 130 px[x, y] = (*c, 255) 131 back.alpha_composite(im) 132 m = im.getchannel('A').point(lambda v: 255 if v > 40 else 0) 133 back.putalpha(m) 134 return back 135 136 def save(im, *p): 137 f = os.path.join(*p) 138 os.makedirs(os.path.dirname(f), exist_ok=True) 139 im.save(f) 140 141 # a button on its piece of title, for window managers that don't blend them 142 def on_title(btn, active, x0, h=TH): 143 a = .60 if active else .33 144 im = Image.new('RGBA', (btn.width, h)) 145 px = im.load() 146 for y in range(h): 147 for x in range(btn.width): 148 px[x, y] = glass(y, TH, a, x0 + x) 149 ImageDraw.Draw(im).line((0, 0, btn.width, 0), fill=(0, 0, 0, 150)) 150 ImageDraw.Draw(im).line((0, 1, btn.width, 1), fill=(255, 255, 255, 115 if active else 70)) 151 im.alpha_composite(btn, (0, 1)) 152 return im 153 154 STATES = {'normal': 'active', 'prelight': 'prelight', 'pressed': 'pressed'} 155 156 def xfwm4(out): 157 d = os.path.join(out, 'themes', NAME, 'xfwm4') 158 W, H = 240, 120 159 for act in (True, False): 160 f = flat(frame(W, H, act)) 161 s = 'active' if act else 'inactive' 162 save(f.crop((0, 0, R + 1, TH)), d, 'top-left-%s.png' % s) 163 save(f.crop((W - R - 1, 0, W, TH)), d, 'top-right-%s.png' % s) 164 for i in range(1, 6): 165 save(f.crop((R + 1, 0, R + 1 + 120, TH)), d, 'title-%d-%s.png' % (i, s)) 166 save(f.crop((0, TH, B, TH + 20)), d, 'left-%s.png' % s) 167 save(f.crop((W - B, TH, W, TH + 20)), d, 'right-%s.png' % s) 168 save(f.crop((0, H - B, R + 1, H)), d, 'bottom-left-%s.png' % s) 169 save(f.crop((W - R - 1, H - B, W, H)), d, 'bottom-right-%s.png' % s) 170 save(f.crop((R + 1, H - B, R + 21, H)), d, 'bottom-%s.png' % s) 171 x = 0 172 for k in ORDER + ['maximize-toggled']: 173 kind = 'restore' if k == 'maximize-toggled' else k 174 for st, name in STATES.items(): 175 if not act and st != 'normal': 176 continue 177 b = flat(on_title(button(kind, st, act), act, x)) 178 save(b, d, '%s-%s.png' % (k, name if act else 'inactive')) 179 if k != 'maximize-toggled': 180 x += BW[k] 181 open(os.path.join(d, 'themerc'), 'w').write('''button_offset=0 182 button_spacing=0 183 full_width_title=true 184 title_alignment=left 185 title_horizontal_offset=6 186 title_vertical_offset_active=1 187 title_vertical_offset_inactive=1 188 title_shadow_active=false 189 title_shadow_inactive=false 190 active_text_color=#0f2030 191 inactive_text_color=#3a4b5c 192 maximized_offset=0 193 shadow_delta_height=2 194 shadow_delta_width=0 195 shadow_delta_x=0 196 shadow_delta_y=-4 197 shadow_opacity=45 198 ''') 199 200 # marco and muffin read the same metacity theme 201 def metacity(out): 202 d = os.path.join(out, 'themes', NAME, 'metacity-1') 203 W, H = 240, 120 204 for act in (True, False): 205 f = flat(frame(W, H, act)) 206 s = 'active' if act else 'inactive' 207 for n, box in {'tl': (0, 0, R + 1, TH), 'title': (R + 1, 0, R + 121, TH), 'tr': (W - R - 1, 0, W, TH), 208 'l': (0, TH, B, TH + 20), 'r': (W - B, TH, W, TH + 20), 209 'bl': (0, H - B, R + 1, H), 'b': (R + 1, H - B, R + 21, H), 'br': (W - R - 1, H - B, W, H)}.items(): 210 save(f.crop(box), d, '%s-%s.png' % (n, s)) 211 for k in ORDER + ['restore']: 212 for st in ('normal', 'prelight', 'pressed'): 213 save(flat(on_title(button(k, st, act, widths=MW), act, 0, BH + 1)), d, '%s-%s-%s.png' % (k, st, s)) 214 def img(f, x, y, w, h, fill='tile'): 215 return '<image filename="%s" x="%s" y="%s" width="%s" height="%s" fill_type="%s"/>' % (f, x, y, w, h, fill) 216 def ops(s): 217 return ''.join([ 218 img('tl-%s.png' % s, 0, 0, R + 1, TH), 219 img('title-%s.png' % s, R + 1, 0, 'width-%d' % (2 * R + 2), TH), 220 img('tr-%s.png' % s, 'width-%d' % (R + 1), 0, R + 1, TH), 221 img('l-%s.png' % s, 0, TH, B, 'height-%d' % (TH + B)), 222 img('r-%s.png' % s, 'width-%d' % B, TH, B, 'height-%d' % (TH + B)), 223 img('bl-%s.png' % s, 0, 'height-%d' % B, R + 1, B), 224 img('b-%s.png' % s, R + 1, 'height-%d' % B, 'width-%d' % (2 * R + 2), B), 225 img('br-%s.png' % s, 'width-%d' % (R + 1), 'height-%d' % B, R + 1, B)]) 226 def btn(fn, k): 227 o = [] 228 for st in ('normal', 'prelight', 'pressed'): 229 o.append('<button function="%s" state="%s"><draw_ops>%s</draw_ops></button>' % (fn, st, 230 img('%s-%s-active.png' % (k, st), 0, 0, 'width', 'height', 'scale'))) 231 return ''.join(o) 232 def btn_in(fn, k): 233 return ''.join('<button function="%s" state="%s"><draw_ops>%s</draw_ops></button>' % (fn, st, 234 img('%s-normal-inactive.png' % k, 0, 0, 'width', 'height', 'scale')) for st in ('normal', 'prelight', 'pressed')) 235 none = ''.join('<button function="%s" state="%s"><draw_ops></draw_ops></button>' % (f, s) 236 for f in ('menu', 'shade', 'unshade', 'above', 'unabove', 'stick', 'unstick', 237 'left_left_background', 'left_middle_background', 'left_right_background', 238 'right_left_background', 'right_middle_background', 'right_right_background') for s in ('normal', 'prelight', 'pressed')) 239 xml = '''<?xml version="1.0"?> 240 <metacity_theme> 241 <info><name>%s</name><author>Chamesle</author><copyright>GPL-3.0-or-later</copyright><date>2026</date><description>Chamesle Glass</description></info> 242 <frame_geometry name="normal" title_scale="medium" rounded_top_left="%d" rounded_top_right="%d" rounded_bottom_left="%d" rounded_bottom_right="%d"> 243 <distance name="left_width" value="%d"/><distance name="right_width" value="%d"/><distance name="bottom_height" value="%d"/> 244 <distance name="left_titlebar_edge" value="8"/><distance name="right_titlebar_edge" value="8"/> 245 <distance name="title_vertical_pad" value="4"/> 246 <border name="title_border" left="2" right="2" top="1" bottom="0"/> 247 <border name="button_border" left="0" right="0" top="0" bottom="0"/> 248 <distance name="button_width" value="30"/><distance name="button_height" value="%d"/> 249 </frame_geometry> 250 <frame_geometry name="max" parent="normal" rounded_top_left="false" rounded_top_right="false" rounded_bottom_left="false" rounded_bottom_right="false"> 251 <distance name="left_width" value="0"/><distance name="right_width" value="0"/><distance name="bottom_height" value="0"/> 252 </frame_geometry> 253 <draw_ops name="title_active"><title x="2" y="(height - title_height) / 2" color="#0f2030"/></draw_ops> 254 <draw_ops name="title_inactive"><title x="2" y="(height - title_height) / 2" color="#3a4b5c"/></draw_ops> 255 <draw_ops name="frame_active">%s</draw_ops> 256 <draw_ops name="frame_inactive">%s</draw_ops> 257 <frame_style name="active" geometry="normal"> 258 <piece position="entire_background" draw_ops="frame_active"/><piece position="title" draw_ops="title_active"/> 259 %s%s%s%s 260 </frame_style> 261 <frame_style name="inactive" geometry="normal"> 262 <piece position="entire_background" draw_ops="frame_inactive"/><piece position="title" draw_ops="title_inactive"/> 263 %s%s%s%s 264 </frame_style> 265 <frame_style name="max_active" geometry="max" parent="active"/> 266 <frame_style name="max_inactive" geometry="max" parent="inactive"/> 267 <frame_style_set name="normal"> 268 <frame focus="yes" state="normal" resize="both" style="active"/><frame focus="no" state="normal" resize="both" style="inactive"/> 269 <frame focus="yes" state="maximized" style="max_active"/><frame focus="no" state="maximized" style="max_inactive"/> 270 <frame focus="yes" state="shaded" style="active"/><frame focus="no" state="shaded" style="inactive"/> 271 <frame focus="yes" state="maximized_and_shaded" style="max_active"/><frame focus="no" state="maximized_and_shaded" style="max_inactive"/> 272 </frame_style_set> 273 <window type="normal" style_set="normal"/><window type="dialog" style_set="normal"/><window type="modal_dialog" style_set="normal"/> 274 <window type="menu" style_set="normal"/><window type="utility" style_set="normal"/><window type="border" style_set="normal"/> 275 </metacity_theme> 276 ''' % (NAME, R, R, 0, 0, B, B, B, BH, ops('active'), ops('inactive'), 277 btn('close', 'close'), btn('maximize', 'maximize'), btn('minimize', 'hide'), none, 278 btn_in('close', 'close'), btn_in('maximize', 'maximize'), btn_in('minimize', 'hide'), none) 279 # restore uses its own glyph 280 xml = xml.replace('<frame_style name="max_active" geometry="max" parent="active"/>', 281 '<frame_style name="max_active" geometry="max" parent="active">%s</frame_style>' % btn('maximize', 'restore')) 282 xml = xml.replace('<frame_style name="max_inactive" geometry="max" parent="inactive"/>', 283 '<frame_style name="max_inactive" geometry="max" parent="inactive">%s</frame_style>' % btn_in('maximize', 'restore')) 284 for v in ('2', '3'): 285 open(os.path.join(d, 'metacity-theme-%s.xml' % v), 'w').write(xml) 286 287 GTK = '''@import url("resource:///org/gtk/libgtk/theme/Adwaita/gtk-contained.css"); 288 /* chamesle glass: adwaita underneath, 2007 on top */ 289 @define-color theme_selected_bg_color #3d8ee0; 290 @define-color accent #3d8ee0; 291 @define-color glass rgba(60, 145, 215, .6); 292 293 button, .button { 294 border: 1px solid #7a8a99; 295 border-radius: 3px; 296 background-image: linear-gradient(to bottom, #fbfcfd 0%, #eef1f4 48%, #dde3e9 50%, #cfd6dd 100%); 297 box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7); 298 text-shadow: none; 299 } 300 button:hover { 301 border-color: #3c7fb1; 302 background-image: linear-gradient(to bottom, #eaf6fd 0%, #d9f0fc 48%, #bee6fd 50%, #a7d9f5 100%); 303 } 304 button:active, button:checked { 305 border-color: #2c628b; 306 background-image: linear-gradient(to bottom, #c2e4f6 0%, #a9d9f2 48%, #90cbeb 50%, #6fb8e0 100%); 307 box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25); 308 } 309 button.suggested-action { 310 border-color: #2c628b; color: #fff; 311 background-image: linear-gradient(to bottom, #8fd0f7 0%, #4ea6e6 48%, #2f87d0 50%, #3b98dc 100%); 312 } 313 button.destructive-action { 314 border-color: #8b2c1d; color: #fff; 315 background-image: linear-gradient(to bottom, #f5a48c 0%, #e0583e 48%, #c2341b 50%, #db4d30 100%); 316 } 317 button.flat, button.titlebutton, .sidebar button, headerbar button.image-button:not(:hover) { background-image: none; border-color: transparent; box-shadow: none; } 318 319 entry { 320 border: 1px solid #abadb3; border-top-color: #707070; border-radius: 2px; 321 background-color: #fff; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12); 322 } 323 entry:focus { border-color: #3d8ee0; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12), 0 0 0 1px rgba(61, 142, 224, .35); } 324 325 headerbar, .titlebar:not(headerbar) { 326 border-bottom: 1px solid rgba(0, 0, 0, .45); 327 background-image: linear-gradient(to bottom, rgba(255,255,255,.46) 0%, rgba(255,255,255,.16) 46%, rgba(255,255,255,0) 50%, rgba(255,255,255,.1) 100%); 328 background-color: #5aa3dc; 329 box-shadow: inset 0 1px rgba(255, 255, 255, .45); 330 color: #0f2030; 331 } 332 headerbar:backdrop { background-color: #a9c6dc; } 333 headerbar .title { font-weight: normal; } 334 335 menu, .menu, .context-menu, popover.menu > contents { 336 border: 1px solid #979797; border-radius: 0; 337 background-color: #f0f0f0; 338 background-image: linear-gradient(to right, transparent 28px, #e2e3e3 28px, #e2e3e3 29px, #fff 29px, #fff 30px, transparent 30px); 339 padding: 2px; 340 } 341 menu menuitem:hover, .menu menuitem:hover, popover.menu modelbutton:hover { 342 border: 1px solid #a8d8eb; border-radius: 3px; color: #000; 343 background-image: linear-gradient(to bottom, #f1f8fb, #d6ecf6); 344 } 345 346 progressbar trough { border: 1px solid #8a8a8a; border-radius: 3px; background-image: linear-gradient(to bottom, #f3f3f3, #dcdcdc 50%, #cfcfcf 50%, #e6e6e6); min-height: 14px; } 347 progressbar progress { 348 border: 1px solid #1d8a1d; border-radius: 2px; min-height: 12px; 349 background-image: radial-gradient(circle at 20% 50%, rgba(255,255,255,.7) 1px, transparent 2px), 350 radial-gradient(circle at 60% 30%, rgba(255,255,255,.6) 1px, transparent 2px), 351 linear-gradient(to bottom, #a8f0a0 0%, #3fd23a 48%, #1fb31a 50%, #39cc33 100%); 352 background-size: 24px 12px, 34px 12px, auto; 353 } 354 355 scale trough { border: 1px solid #a0a0a0; border-radius: 3px; background-image: linear-gradient(to bottom, #e7eaea, #fff); min-height: 4px; } 356 scale highlight { border-radius: 3px; background-image: linear-gradient(to bottom, #8fd0f7, #3b98dc); } 357 scale slider { border: 1px solid #3c7fb1; border-radius: 50%%; background-image: radial-gradient(circle at 50%% 30%%, #fff, #bfe6ff 55%%, #4ea6e6); min-width: 16px; min-height: 16px; } 358 359 check, radio { border: 1px solid #8e8f8f; background-image: linear-gradient(to bottom, #f4f4f4, #dedede); } 360 check:checked, radio:checked { border-color: #3c7fb1; background-color: #3d8ee0; } 361 362 notebook > header tab { border: 1px solid #898c95; border-bottom: none; border-radius: 3px 3px 0 0; margin: 0 1px; background-image: linear-gradient(to bottom, #f2f2f2, #ebebeb 50%, #dddddd 50%, #cfcfcf); } 363 notebook > header tab:checked { background-image: none; background-color: #fff; } 364 365 selection, *:selected, row:selected, treeview.view:selected, iconview:selected, flowboxchild:selected { 366 color: #000; 367 background-color: #cce8ff; 368 background-image: linear-gradient(to bottom, #dcebfc, #c1dcfc); 369 } 370 row:hover:not(:selected) { background-image: linear-gradient(to bottom, #fafbfd, #ebf3fd); } 371 .sidebar, placessidebar list { background-color: #f1f5fb; } 372 373 tooltip.background { border: 1px solid #767676; border-radius: 2px; background-image: linear-gradient(to bottom, #fff, #e4e5f0); color: #3a3a3a; } 374 tooltip * { color: #3a3a3a; } 375 376 /* caption buttons hang from the top edge, joined, close in red */ 377 window headerbar button.titlebutton.titlebutton, window .titlebar button.titlebutton.titlebutton { 378 margin: -6px 0 0 0; padding: 0 6px; min-height: 18px; min-width: 16px; 379 border: 1px solid rgba(0, 0, 0, .6); border-top: none; border-radius: 0; 380 background-image: linear-gradient(to bottom, #f3f8fc 0%, #dfe9f2 50%, #b5cadd 50%, #96b9d7 100%); 381 box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45); 382 color: #fff; -gtk-icon-shadow: 0 0 2px #141e2d, 0 0 1px #141e2d; 383 } 384 window headerbar button.titlebutton.titlebutton:hover, window .titlebar button.titlebutton.titlebutton:hover { background-image: linear-gradient(to bottom, #e1f5ff 0%, #b8e1fa 50%, #6fbaf0 50%, #5aaee8 100%); } 385 window headerbar button.titlebutton.titlebutton.minimize, window .titlebar button.titlebutton.titlebutton.minimize { border-radius: 0 0 0 5px; } 386 window headerbar button.titlebutton.titlebutton.close, window .titlebar button.titlebutton.titlebutton.close { 387 min-width: 30px; border-radius: 0 0 5px 0; 388 background-image: linear-gradient(to bottom, #f5c1b2 0%, #e8907a 50%, #d0442a 50%, #c8432b 100%); 389 } 390 window headerbar button.titlebutton.titlebutton.close:hover, window .titlebar button.titlebutton.titlebutton.close:hover { background-image: linear-gradient(to bottom, #ffd3c6 0%, #f8a088 50%, #e8481f 50%, #e05a3a 100%); } 391 window headerbar button.titlebutton.titlebutton + button.titlebutton, window .titlebar button.titlebutton.titlebutton + button.titlebutton { border-left: none; } 392 393 /* panels: dark glass */ 394 .xfce4-panel.background, PanelToplevel, .mate-panel-menu-bar, #PanelApplet, panel-toplevel, .mate-panel { 395 background-color: rgba(25, 50, 75, .62); 396 background-image: linear-gradient(to bottom, rgba(255,255,255,.32) 0%, rgba(255,255,255,.08) 48%, rgba(255,255,255,0) 50%, rgba(255,255,255,.06) 100%); 397 border-top: 1px solid rgba(0, 0, 0, .55); 398 box-shadow: inset 0 1px rgba(255, 255, 255, .35); 399 color: #fff; 400 } 401 .xfce4-panel button, .mate-panel-menu-bar button, PanelToplevel button { background-image: none; border-color: transparent; box-shadow: none; color: #fff; } 402 .xfce4-panel button:hover, PanelToplevel button:hover { 403 border-color: rgba(255, 255, 255, .45); 404 background-image: linear-gradient(to bottom, rgba(255,255,255,.3), rgba(255,255,255,.08) 50%, rgba(255,255,255,0) 50%, rgba(255,255,255,.12)); 405 } 406 .xfce4-panel button:checked, PanelToplevel button:checked { 407 border-color: rgba(255, 255, 255, .55); 408 background-image: radial-gradient(ellipse at 50% 120%, rgba(60,145,215,1) 0%, rgba(60,145,215,.35) 55%, rgba(255,255,255,.12) 100%); 409 } 410 .xfce4-panel label, PanelToplevel label, .mate-panel label { color: #fff; text-shadow: 0 0 4px rgba(0, 0, 0, .8); } 411 '''.replace('%%', '%') 412 413 def gtk(out): 414 d = os.path.join(out, 'themes', NAME) 415 os.makedirs(os.path.join(d, 'gtk-3.0'), exist_ok=True) 416 open(os.path.join(d, 'gtk-3.0', 'gtk.css'), 'w').write(GTK) 417 open(os.path.join(d, 'index.theme'), 'w').write('''[Desktop Entry] 418 Type=X-GNOME-Metatheme 419 Name=%s 420 Comment=Glass frames and glossy buttons, like 2007 421 422 [X-GNOME-Metatheme] 423 GtkTheme=%s 424 MetacityTheme=%s 425 IconTheme=Chamesle-Glass 426 ''' % (NAME, NAME, NAME)) 427 428 CINNAMON = '''@import url("file:///usr/share/cinnamon/theme/cinnamon.css"); 429 /* chamesle glass for the cinnamon panel and menus */ 430 #panel, .panel-bottom, .panel-top, .panel-left, .panel-right { 431 background-gradient-direction: vertical; 432 background-gradient-start: rgba(90, 140, 185, .62); 433 background-gradient-end: rgba(15, 35, 55, .78); 434 border-top: 1px solid rgba(0, 0, 0, .6); 435 box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); 436 color: #fff; 437 } 438 .window-list-item-box, .grouped-window-list-item-box { border-radius: 3px; border: 1px solid transparent; } 439 .window-list-item-box:hover, .grouped-window-list-item-box:hover { border-color: rgba(255, 255, 255, .45); background-color: rgba(255, 255, 255, .15); } 440 .window-list-item-box:focus, .window-list-item-box:active, .grouped-window-list-item-box:focus, .grouped-window-list-item-box:active { 441 border-color: rgba(255, 255, 255, .55); 442 background-gradient-direction: vertical; 443 background-gradient-start: rgba(255, 255, 255, .25); 444 background-gradient-end: rgba(60, 145, 215, .85); 445 } 446 .menu, .popup-menu-boxpointer, .applet-box .popup-menu { 447 -arrow-background-color: rgba(25, 50, 75, .9); 448 -arrow-border-color: rgba(0, 0, 0, .6); 449 -arrow-border-width: 1px; 450 -arrow-border-radius: 6px; 451 color: #fff; 452 } 453 .popup-menu-item:active, .popup-menu-item:hover { background-color: rgba(255, 255, 255, .2); border-radius: 3px; } 454 .menu-applications-outer-box, .menu-favorites-box, .menu-places-box { color: #fff; } 455 ''' 456 457 def cinnamon(out): 458 d = os.path.join(out, 'themes', NAME, 'cinnamon') 459 os.makedirs(d, exist_ok=True) 460 open(os.path.join(d, 'cinnamon.css'), 'w').write(CINNAMON) 461 462 # svg frames for plasma and aurorae: nine pieces, each a plain shape with an id 463 # (qt's svg renderer skips nested svgs and rgba(), so fills are hex plus an opacity) 464 def paint(c): 465 return 'fill="#%02x%02x%02x" fill-opacity="%.2f"' % (c[0], c[1], c[2], c[3]) 466 467 def svgframe(prefix, w, h, t, sd, bt, r, rb, base, edge, hi, gloss=None): 468 p = prefix + '-' if prefix else '' 469 gid = 'g' + (prefix or 'f').replace('-', '') 470 defs = '' 471 if gloss == 'top': 472 defs = ('<linearGradient id="%s" gradientUnits="userSpaceOnUse" x1="0" y1="0" x2="0" y2="%d">' 473 '<stop offset="0" stop-color="#fff" stop-opacity=".46"/><stop offset=".46" stop-color="#fff" stop-opacity=".16"/>' 474 '<stop offset=".5" stop-color="#fff" stop-opacity="0"/><stop offset="1" stop-color="#fff" stop-opacity=".1"/></linearGradient>' % (gid, t)) 475 elif gloss == 'center': 476 defs = ('<linearGradient id="%s" x1="0" y1="0" x2="0" y2="1">' 477 '<stop offset="0" stop-color="#fff" stop-opacity=".32"/><stop offset=".48" stop-color="#fff" stop-opacity=".08"/>' 478 '<stop offset=".5" stop-color="#fff" stop-opacity="0"/><stop offset="1" stop-color="#fff" stop-opacity=".06"/></linearGradient>' % gid) 479 def corner(i, cw, ch, rr, mx, my): 480 X = lambda x: w - x if mx else x 481 Y = lambda y: h - y if my else y 482 if rr > i: 483 sw = 1 if mx == my else 0 484 return 'M%g %gL%g %gA%g %g 0 0 %d %g %gL%g %gL%g %gZ' % (X(i), Y(ch), X(i), Y(rr), rr - i, rr - i, sw, X(rr), Y(i), X(cw), Y(i), X(cw), Y(ch)) 485 return 'M%g %gL%g %gL%g %gL%g %gZ' % (X(i), Y(ch), X(i), Y(i), X(cw), Y(i), X(cw), Y(ch)) 486 def band(path_of, fillc): 487 return '<path fill-rule="evenodd" d="%s %s" %s/>' % (path_of(0), path_of(1), paint(fillc)) 488 o = [] 489 for n, cw, ch, rr, mx, my in (('topleft', sd, t, r, 0, 0), ('topright', sd, t, r, 1, 0), ('bottomleft', sd, bt, rb, 0, 1), ('bottomright', sd, bt, rb, 1, 1)): 490 f = lambda i, cw=cw, ch=ch, rr=rr, mx=mx, my=my: corner(i, cw, ch, rr, mx, my) 491 g = '<path d="%s" %s/>' % (f(0), paint(base)) 492 if gloss == 'top' and n.startswith('top'): 493 g += '<path d="%s" fill="url(#%s)"/>' % (f(0), gid) 494 g += band(f, edge) + band(lambda i, f=f: f(i + 1), hi) 495 o.append('<g id="%s%s">%s</g>' % (p, n, g)) 496 def rect(x, y, rw, rh, c): 497 return '<rect x="%g" y="%g" width="%g" height="%g" %s/>' % (x, y, rw, rh, paint(c)) 498 mid = h - t - bt 499 gl = lambda x, y, rw, rh: '<rect x="%g" y="%g" width="%g" height="%g" fill="url(#%s)"/>' % (x, y, rw, rh, gid) 500 top = rect(sd, 0, w - 2 * sd, t, base) + (gl(sd, 0, w - 2 * sd, t) if gloss == 'top' else '') + rect(sd, 0, w - 2 * sd, 1, edge) + rect(sd, 1, w - 2 * sd, 1, hi) 501 bot = rect(sd, h - bt, w - 2 * sd, bt, base) + rect(sd, h - 1, w - 2 * sd, 1, edge) + rect(sd, h - 2, w - 2 * sd, 1, hi) 502 cg = gloss == 'center' 503 left = rect(0, t, sd, mid, base) + (gl(0, t, sd, mid) if cg else '') + rect(0, t, 1, mid, edge) + rect(1, t, 1, mid, hi) 504 right = rect(w - sd, t, sd, mid, base) + (gl(w - sd, t, sd, mid) if cg else '') + rect(w - 1, t, 1, mid, edge) + rect(w - 2, t, 1, mid, hi) 505 center = rect(sd, t, w - 2 * sd, mid, base) + (gl(sd, t, w - 2 * sd, mid) if cg else '') 506 for n, g in (('top', top), ('bottom', bot), ('left', left), ('right', right), ('center', center)): 507 o.append('<g id="%s%s">%s</g>' % (p, n, g)) 508 return defs, o 509 510 def svgdoc(w, h, defs, els): 511 return '<?xml version="1.0"?>\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="%d" height="%d"><defs>%s</defs>%s</svg>\n' % (w, h, defs, ''.join(els)) 512 513 def mask(prefix, w, h, t, sd, bt, r, rb): 514 k = (0, 0, 0, 1) 515 _, o = svgframe(prefix, w, h, t, sd, bt, r, rb, k, k, k) 516 return o 517 518 PLASMA_COLORS = '''[Colors:Window] 519 BackgroundNormal=24,52,76 520 ForegroundNormal=255,255,255 521 ForegroundInactive=200,215,228 522 DecorationFocus=110,190,255 523 DecorationHover=150,210,255 524 525 [Colors:View] 526 BackgroundNormal=24,52,76 527 ForegroundNormal=255,255,255 528 ForegroundInactive=200,215,228 529 DecorationFocus=110,190,255 530 DecorationHover=150,210,255 531 532 [Colors:Button] 533 BackgroundNormal=60,145,215 534 ForegroundNormal=255,255,255 535 DecorationFocus=110,190,255 536 DecorationHover=150,210,255 537 538 [Colors:Selection] 539 BackgroundNormal=60,145,215 540 ForegroundNormal=255,255,255 541 542 [Colors:Tooltip] 543 BackgroundNormal=24,52,76 544 ForegroundNormal=255,255,255 545 546 [Colors:Complementary] 547 BackgroundNormal=24,52,76 548 ForegroundNormal=255,255,255 549 ''' 550 551 def plasma(out): 552 d = os.path.join(out, 'plasma', 'desktoptheme', 'chamesle-glass') 553 dark, edge, hi = (15, 36, 54, .62), (0, 0, 0, .6), (255, 255, 255, .35) 554 for sub in ('', 'translucent/'): 555 # the panel: dark glass, shine to the middle 556 defs, els = '', [] 557 for side, r in (('', 3), ('south', 0), ('north', 0), ('east', 0), ('west', 0)): 558 df, o = svgframe(side, 96, 48, 3, 3, 3, r, r, dark, edge, hi, 'center') 559 defs += df; els += o 560 els += mask('mask-' + side if side else 'mask', 96, 48, 3, 3, 3, r, r) 561 save_text(svgdoc(96, 48, defs, els), d, sub + 'widgets/panel-background.svg') 562 # menus, popups, the start menu 563 defs, o = svgframe('', 96, 96, 8, 8, 8, 7, 7, (20, 48, 72, .74), edge, (255, 255, 255, .4), 'top') 564 els = o + mask('mask', 96, 96, 8, 8, 8, 7, 7) 565 els.append('<rect id="hint-top-margin" x="0" y="0" width="1" height="8" fill="none"/>') 566 save_text(svgdoc(96, 96, defs, els), d, sub + 'dialogs/background.svg') 567 defs, o = svgframe('', 64, 64, 5, 5, 5, 4, 4, (20, 48, 72, .85), edge, hi) 568 save_text(svgdoc(64, 64, defs, o + mask('mask', 64, 64, 5, 5, 5, 4, 4)), d, sub + 'widgets/tooltip.svg') 569 defs, o = svgframe('', 96, 96, 8, 8, 8, 7, 7, (60, 145, 215, .45), (0, 0, 0, .5), (255, 255, 255, .4), 'top') 570 save_text(svgdoc(96, 96, defs, o + mask('mask', 96, 96, 8, 8, 8, 7, 7)), d, sub + 'widgets/background.svg') 571 # open windows on the taskbar; the active one glows 572 defs, els = '', [] 573 for pre, fill, ed, h2, gl in (('focus', (60, 145, 215, .85), (0, 0, 0, .45), (255, 255, 255, .55), 'center'), 574 ('hover', (255, 255, 255, .16), (0, 0, 0, .4), (255, 255, 255, .45), 'center'), 575 ('normal', (255, 255, 255, .06), (0, 0, 0, .3), (255, 255, 255, .2), None), 576 ('attention', (255, 160, 40, .55), (0, 0, 0, .4), (255, 220, 160, .7), 'center'), 577 ('minimized', (255, 255, 255, 0), (0, 0, 0, 0), (255, 255, 255, 0), None)): 578 df, o = svgframe(pre, 48, 48, 4, 4, 4, 3, 3, fill, ed, h2, gl) 579 defs += df; els += o 580 save_text(svgdoc(48, 48, defs, els), d, 'widgets/tasks.svg') 581 save_text('''{ 582 "KPlugin": { 583 "Authors": [{"Name": "Chamesle"}], 584 "Description": "Glass panels and menus with the wallpaper showing through", 585 "Id": "chamesle-glass", 586 "License": "GPL-3.0-or-later", 587 "Name": "Chamesle Glass", 588 "Version": "0.7" 589 }, 590 "X-Plasma-API": "5.0" 591 } 592 ''', d, 'metadata.json') 593 save_text(PLASMA_COLORS, d, 'colors') 594 595 def save_text(text, *p): 596 f = os.path.join(*p) 597 os.makedirs(os.path.dirname(f), exist_ok=True) 598 open(f, 'w').write(text) 599 600 def aurorae(out): 601 d = os.path.join(out, 'aurorae', 'themes', 'ChamesleGlass') 602 W, H = 120, 120 603 def piece(prefix, a, shine): 604 return svgframe(prefix, W, H, TH, B, B, R, 0, (*TINT, a), (0, 0, 0, .6), (255, 255, 255, .45 if shine else .28), 'top') 605 defs1, a = piece('decoration', .45, True) 606 defs2, b = piece('decoration-inactive', .22, False) 607 defs3, c = piece('decoration-maximized', .45, True) 608 defs4, e = piece('decoration-maximized-inactive', .22, False) 609 m = mask('mask', W, H, TH, B, B, R, 0) 610 save_text(svgdoc(W, H, defs1 + defs2 + defs3 + defs4, a + b + c + e + m), d, 'decoration.svg') 611 # buttons: each svg has active, hover, pressed, inactive, deactivated 612 # buttons in vectors: kwin skips images inside svgs 613 def bsvg(kind, w): 614 base = 'maximize' if kind == 'restore' else kind 615 h, cx, cy = BH, w / 2, BH / 2 616 r = 6 617 if base == ORDER[0]: 618 shape = 'M0 0H%g V%g H%g A%g %g 0 0 1 0 %g Z' % (w, h, r, r, r, h - r) 619 edge = 'M0.5 0V%g A%g %g 0 0 0 %g %g H%g' % (h - r, r - .5, r - .5, r, h - .5, w) 620 elif base == ORDER[-1]: 621 shape = 'M0 0H%g V%g A%g %g 0 0 1 %g %g H0 Z' % (w, h - r, r, r, w - r, h) 622 edge = 'M0 %gH%g A%g %g 0 0 0 %g %g V0' % (h - .5, w - r, r - .5, r - .5, w - .5, h - r) 623 else: 624 shape = 'M0 0H%g V%g H0 Z' % (w, h) 625 edge = 'M0 %gH%g' % (h - .5, w) 626 dk, wh = '#141e2d', '#ffffff' 627 if kind == 'hide': 628 gl = '<rect x="%g" y="%g" width="11" height="4" fill="%s" stroke="%s" stroke-width="1"/>' % (cx - 5.5, cy + 1.5, wh, dk) 629 elif kind == 'maximize': 630 gl = ''.join('<rect x="%g" y="%g" width="12" height="10" fill="none" stroke="%s" stroke-width="%g"/>' % (cx - 6, cy - 5, c, sw) for c, sw in ((dk, 4), (wh, 2))) 631 elif kind == 'restore': 632 gl = ''.join('<rect x="%g" y="%g" width="8" height="6" fill="none" stroke="%s" stroke-width="%g"/>' % (cx - 4 + ox, cy - 3 + oy, c, sw) 633 for ox, oy in ((2, -3), (-2, 1)) for c, sw in ((dk, 3), (wh, 1.4))) 634 else: 635 ln = 'M%g %gL%g %gM%g %gL%g %g' % (cx - 5, cy - 4, cx + 5, cy + 4, cx - 5, cy + 4, cx + 5, cy - 4) 636 gl = ''.join('<path d="%s" fill="none" stroke="%s" stroke-width="%g" stroke-linecap="round"/>' % (ln, c, sw) for c, sw in ((dk, 5), (wh, 2.6))) 637 els, defs = [], [] 638 for st, pst, act in (('active', 'normal', True), ('hover', 'prelight', True), ('pressed', 'pressed', True), 639 ('inactive', 'normal', False), ('deactivated', 'normal', False)): 640 top, bot, al = fill(pst, base == 'close', act) 641 mid = [(top[i] + bot[i]) // 2 for i in range(3)] 642 lift = lambda c: '#%02x%02x%02x' % tuple(int(v + (255 - v) * .45) for v in c) 643 hexc = lambda c: '#%02x%02x%02x' % tuple(c) 644 gid = 'b' + st 645 defs.append('<linearGradient id="%s" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="%s"/><stop offset=".5" stop-color="%s"/>' 646 '<stop offset=".5" stop-color="%s"/><stop offset="1" stop-color="%s"/></linearGradient>' % (gid, lift(top), lift(mid), hexc(mid), hexc(bot))) 647 sep = '<rect x="0" y="0" width="1" height="%g" fill="#000" fill-opacity=".55"/>' % (h - 1) if base != ORDER[0] else '' 648 els.append('<g id="%s-center" opacity="%.2f"><path d="%s" fill="url(#%s)"/><path d="%s" fill="none" stroke="#000" stroke-opacity=".65"/>%s%s</g>' 649 % (st, al / 255, shape, gid, edge, sep, gl)) 650 return svgdoc(w, h, ''.join(defs), els) 651 save_text(bsvg('close', BW['close']), d, 'close.svg') 652 save_text(bsvg('maximize', BW['maximize']), d, 'maximize.svg') 653 save_text(bsvg('restore', BW['maximize']), d, 'restore.svg') 654 save_text(bsvg('hide', BW['hide']), d, 'minimize.svg') 655 save_text('''[General] 656 ActiveTextColor=15,32,48 657 InactiveTextColor=58,75,92 658 UseTextShadow=true 659 ActiveTextShadowColor=255,255,255,190 660 InactiveTextShadowColor=255,255,255,90 661 TextShadowOffsetX=0 662 TextShadowOffsetY=0 663 HaloActive=true 664 HaloInactive=false 665 TitleAlignment=Left 666 TitleVerticalAlignment=Center 667 Animation=150 668 Shadow=true 669 670 [Layout] 671 BorderLeft=%d 672 BorderRight=%d 673 BorderBottom=%d 674 BorderTop=0 675 TitleEdgeTop=1 676 TitleEdgeBottom=4 677 TitleEdgeLeft=8 678 TitleEdgeRight=8 679 TitleEdgeTopMaximized=0 680 TitleEdgeBottomMaximized=2 681 TitleEdgeLeftMaximized=6 682 TitleEdgeRightMaximized=0 683 TitleBorderLeft=4 684 TitleBorderRight=8 685 TitleHeight=%d 686 ButtonWidth=%d 687 ButtonWidthMinimize=%d 688 ButtonWidthMaximizeRestore=%d 689 ButtonWidthClose=%d 690 ButtonHeight=%d 691 ButtonSpacing=0 692 ButtonMarginTop=0 693 ButtonMarginTopMaximized=0 694 ExplicitButtonSpacer=10 695 PaddingTop=0 696 PaddingBottom=0 697 PaddingLeft=0 698 PaddingRight=0 699 ''' % (B, B, B, TH - 5, BW['hide'], BW['hide'], BW['maximize'], BW['close'], BH), d, 'ChamesleGlassrc') 700 save_text('''[Desktop Entry] 701 Name=Chamesle Glass 702 Comment=Glass window frames with buttons hanging from the top edge 703 X-KDE-PluginInfo-Author=Chamesle 704 X-KDE-PluginInfo-Name=ChamesleGlass 705 X-KDE-PluginInfo-Version=0.7 706 X-KDE-PluginInfo-License=GPL-3.0-or-later 707 ''', d, 'metadata.desktop') 708 709 def colors(out): 710 save_text('''[General] 711 ColorScheme=ChamesleGlass 712 Name=Chamesle Glass 713 714 [ColorEffects:Disabled] 715 Color=56,56,56 716 ColorAmount=0 717 ColorEffect=0 718 ContrastAmount=0.65 719 ContrastEffect=1 720 IntensityAmount=0.1 721 IntensityEffect=2 722 723 [ColorEffects:Inactive] 724 ChangeSelectionColor=true 725 Enable=false 726 727 [Colors:Button] 728 BackgroundAlternate=221,227,233 729 BackgroundNormal=238,241,244 730 DecorationFocus=61,142,224 731 DecorationHover=60,127,177 732 ForegroundActive=61,142,224 733 ForegroundInactive=110,118,126 734 ForegroundLink=0,102,204 735 ForegroundNegative=200,50,30 736 ForegroundNeutral=200,120,0 737 ForegroundNormal=16,22,30 738 ForegroundPositive=30,140,30 739 ForegroundVisited=102,51,153 740 741 [Colors:Selection] 742 BackgroundAlternate=193,220,252 743 BackgroundNormal=204,232,255 744 DecorationFocus=61,142,224 745 DecorationHover=60,127,177 746 ForegroundActive=0,0,0 747 ForegroundInactive=58,75,92 748 ForegroundLink=0,80,160 749 ForegroundNegative=180,40,20 750 ForegroundNeutral=160,100,0 751 ForegroundNormal=0,0,0 752 ForegroundPositive=20,110,20 753 ForegroundVisited=90,40,140 754 755 [Colors:Tooltip] 756 BackgroundAlternate=228,229,240 757 BackgroundNormal=250,250,252 758 DecorationFocus=61,142,224 759 DecorationHover=60,127,177 760 ForegroundNormal=58,58,58 761 ForegroundInactive=110,118,126 762 763 [Colors:View] 764 BackgroundAlternate=245,248,252 765 BackgroundNormal=255,255,255 766 DecorationFocus=61,142,224 767 DecorationHover=60,127,177 768 ForegroundActive=61,142,224 769 ForegroundInactive=110,118,126 770 ForegroundLink=0,102,204 771 ForegroundNegative=200,50,30 772 ForegroundNeutral=200,120,0 773 ForegroundNormal=16,22,30 774 ForegroundPositive=30,140,30 775 ForegroundVisited=102,51,153 776 777 [Colors:Window] 778 BackgroundAlternate=233,238,244 779 BackgroundNormal=240,243,247 780 DecorationFocus=61,142,224 781 DecorationHover=60,127,177 782 ForegroundActive=61,142,224 783 ForegroundInactive=110,118,126 784 ForegroundLink=0,102,204 785 ForegroundNegative=200,50,30 786 ForegroundNeutral=200,120,0 787 ForegroundNormal=16,22,30 788 ForegroundPositive=30,140,30 789 ForegroundVisited=102,51,153 790 791 [Colors:Complementary] 792 BackgroundNormal=24,52,76 793 ForegroundNormal=255,255,255 794 DecorationFocus=110,190,255 795 DecorationHover=150,210,255 796 797 [Colors:Header] 798 BackgroundNormal=226,236,246 799 ForegroundNormal=16,22,30 800 DecorationFocus=61,142,224 801 DecorationHover=60,127,177 802 803 [WM] 804 activeBackground=90,163,220 805 activeForeground=15,32,48 806 inactiveBackground=169,198,220 807 inactiveForeground=58,75,92 808 ''', out, 'color-schemes', 'ChamesleGlass.colors') 809 810 if __name__ == '__main__': 811 out = sys.argv[1] if len(sys.argv) > 1 else 'share' 812 gtk(out); xfwm4(out); metacity(out); cinnamon(out); plasma(out); aurorae(out); colors(out) 813 print('chamesle glass written to', out)