diff --git a/pywal/export.py b/pywal/export.py index 12505288..3d89ae4c 100644 --- a/pywal/export.py +++ b/pywal/export.py @@ -58,14 +58,16 @@ def template(colors, input_file, output_file=None): # If the color was changed, replace with a unique identifier. if new_color is not colors[cname]: new_color = str(new_color) - new_color_clean = new_color.replace('[', '_').replace(']', '_').replace('.', '_') + new_color_clean = new_color.replace( + '[', '_').replace(']', '_').replace('.', '_') template_data[i] = l.replace(replace_str, "color" + new_color_clean) colors["color" + new_color_clean] = new_color try: template_data = "".join(template_data).format(**colors) except (ValueError, KeyError, AttributeError) as exc: - logging.error("Syntax error in template file '%s': %r.", input_file, exc) + logging.error("Syntax error in template file '%s': %r.", + input_file, exc) return util.save_file(template_data, output_file) @@ -104,6 +106,7 @@ def get_export_type(export_type): "vscode": "colors-vscode.json", "waybar": "colors-waybar.css", "xresources": "colors.Xresources", + "haskell": "Colors.hs", "xmonad": "colors.hs", "yaml": "colors.yml", }.get(export_type, export_type) diff --git a/pywal/templates/Colors.hs b/pywal/templates/Colors.hs new file mode 100644 index 00000000..6ffa1a6d --- /dev/null +++ b/pywal/templates/Colors.hs @@ -0,0 +1,37 @@ +--Place this file in your .xmonad/lib directory and import module Colors into .xmonad/xmonad.hs config +--The easy way is to create a soft link from this file to the file in .xmonad/lib using ln -s +--Then recompile and restart xmonad. + +module Colors + ( wallpaper + , background, foreground, cursor + , color0, color1, color2, color3, color4, color5, color6, color7 + , color8, color9, color10, color11, color12, color13, color14, color15 + ) where + +-- Shell variables +-- Generated by 'wal' +wallpaper="{wallpaper}" + +-- Special +background="{background}" +foreground="{foreground}" +cursor="{cursor}" + +-- Colors +color0="{color0}" +color1="{color1}" +color2="{color2}" +color3="{color3}" +color4="{color4}" +color5="{color5}" +color6="{color6}" +color7="{color7}" +color8="{color8}" +color9="{color9}" +color10="{color10}" +color11="{color11}" +color12="{color12}" +color13="{color13}" +color14="{color14}" +color15="{color15}" diff --git a/pywal/wallpaper.py b/pywal/wallpaper.py index 7d6ae5f1..eb177886 100644 --- a/pywal/wallpaper.py +++ b/pywal/wallpaper.py @@ -115,17 +115,18 @@ def set_desktop_wallpaper(desktop, img): elif "awesome" in desktop: util.disown(["awesome-client", "require('gears').wallpaper.maximized('{img}')" - .format(**locals())]) + .format(**locals())]) elif "kde" in desktop: string = """ var allDesktops = desktops();for (i=0;i