mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-02-27 07:31:13 +01:00
export: Add wallpaper to export files,
This commit is contained in:
parent
dd95c26b40
commit
07fd6fa661
@ -35,7 +35,9 @@ def export_all_templates(colors, template_dir=None, output_dir=CACHE_DIR):
|
|||||||
|
|
||||||
# Merge all colors (specials and normals) into one dict so we can access
|
# Merge all colors (specials and normals) into one dict so we can access
|
||||||
# their values simpler.
|
# their values simpler.
|
||||||
all_colors = {**colors["special"], **colors["colors"]}
|
all_colors = {"wallpaper": colors["wallpaper"],
|
||||||
|
**colors["special"],
|
||||||
|
**colors["colors"]}
|
||||||
|
|
||||||
# Turn all those colors into util.Color instances for accessing the
|
# Turn all those colors into util.Color instances for accessing the
|
||||||
# .hex and .rgb formats
|
# .hex and .rgb formats
|
||||||
|
@ -75,7 +75,7 @@ def get_colors(img, quiet):
|
|||||||
|
|
||||||
# Generate the colors.
|
# Generate the colors.
|
||||||
colors = gen_colors(img)
|
colors = gen_colors(img)
|
||||||
colors = sort_colors(colors)
|
colors = sort_colors(img, colors)
|
||||||
|
|
||||||
# Cache the colorscheme.
|
# Cache the colorscheme.
|
||||||
util.save_file_json(colors, cache_file)
|
util.save_file_json(colors, cache_file)
|
||||||
@ -87,27 +87,29 @@ def get_colors(img, quiet):
|
|||||||
return colors
|
return colors
|
||||||
|
|
||||||
|
|
||||||
def sort_colors(colors):
|
def sort_colors(img, colors):
|
||||||
"""Sort the generated colors and store them in a dict that
|
"""Sort the generated colors and store them in a dict that
|
||||||
we will later save in json format."""
|
we will later save in json format."""
|
||||||
raw_colors = colors[:1] + colors[9:] + colors[8:]
|
raw_colors = colors[:1] + colors[9:] + colors[8:]
|
||||||
|
|
||||||
|
# Wallpaper.
|
||||||
|
colors = {"wallpaper": img}
|
||||||
|
|
||||||
# Special colors.
|
# Special colors.
|
||||||
colors_special = {}
|
colors_special = {}
|
||||||
colors_special.update({"background": raw_colors[0]})
|
colors_special.update({"background": raw_colors[0]})
|
||||||
colors_special.update({"foreground": raw_colors[15]})
|
colors_special.update({"foreground": raw_colors[15]})
|
||||||
colors_special.update({"cursor": raw_colors[15]})
|
colors_special.update({"cursor": raw_colors[15]})
|
||||||
|
|
||||||
# Colors 0-15
|
# Colors 0-15.
|
||||||
colors_hex = {}
|
colors_hex = {}
|
||||||
[colors_hex.update({f"color{index}": color}) # pylint: disable=W0106
|
[colors_hex.update({f"color{index}": color}) # pylint: disable=W0106
|
||||||
for index, color in enumerate(raw_colors)]
|
for index, color in enumerate(raw_colors)]
|
||||||
|
|
||||||
# Color 8
|
# Color 8.
|
||||||
colors_hex["color8"] = util.set_grey(raw_colors)
|
colors_hex["color8"] = util.set_grey(raw_colors)
|
||||||
|
|
||||||
# Add the colors to a dict.
|
# Add the colors to a dict.
|
||||||
colors = {}
|
|
||||||
colors["special"] = colors_special
|
colors["special"] = colors_special
|
||||||
colors["colors"] = colors_hex
|
colors["colors"] = colors_hex
|
||||||
|
|
||||||
|
@ -1,9 +1,14 @@
|
|||||||
/* CSS variables
|
/* CSS variables
|
||||||
Generated by 'wal' */
|
Generated by 'wal' */
|
||||||
:root {{
|
:root {{
|
||||||
|
--wallpaper: "{wallpaper}";
|
||||||
|
|
||||||
|
/* Special */
|
||||||
--background: {background};
|
--background: {background};
|
||||||
--foreground: {foreground};
|
--foreground: {foreground};
|
||||||
--cursor: {cursor};
|
--cursor: {cursor};
|
||||||
|
|
||||||
|
/* Colors */
|
||||||
--color0: {color0};
|
--color0: {color0};
|
||||||
--color1: {color1};
|
--color1: {color1};
|
||||||
--color2: {color2};
|
--color2: {color2};
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
{{
|
{{
|
||||||
|
"wallpaper": "{wallpaper}",
|
||||||
|
|
||||||
"special": {{
|
"special": {{
|
||||||
"background": "{background}",
|
"background": "{background}",
|
||||||
"foreground": "{foreground}",
|
"foreground": "{foreground}",
|
||||||
|
@ -1,8 +1,13 @@
|
|||||||
// SCSS Variables
|
// SCSS Variables
|
||||||
// Generated by 'wal'
|
// Generated by 'wal'
|
||||||
|
$wallpaper: "{wallpaper}";
|
||||||
|
|
||||||
|
// Special
|
||||||
$background: {background};
|
$background: {background};
|
||||||
$foreground: {foreground};
|
$foreground: {foreground};
|
||||||
$cursor: {cursor};
|
$cursor: {cursor};
|
||||||
|
|
||||||
|
// Colors
|
||||||
$color0: {color0};
|
$color0: {color0};
|
||||||
$color1: {color1};
|
$color1: {color1};
|
||||||
$color2: {color2};
|
$color2: {color2};
|
||||||
|
@ -1,8 +1,13 @@
|
|||||||
# Shell variables
|
# Shell variables
|
||||||
# Generated by 'wal'
|
# Generated by 'wal'
|
||||||
|
wallpaper='{wallpaper}'
|
||||||
|
|
||||||
|
# Special
|
||||||
background='{background}'
|
background='{background}'
|
||||||
foreground='{foreground}'
|
foreground='{foreground}'
|
||||||
cursor='{cursor}'
|
cursor='{cursor}'
|
||||||
|
|
||||||
|
# Colors
|
||||||
color0='{color0}'
|
color0='{color0}'
|
||||||
color1='{color1}'
|
color1='{color1}'
|
||||||
color2='{color2}'
|
color2='{color2}'
|
||||||
|
Loading…
Reference in New Issue
Block a user