From 1da37318eb00ba4867261a7b87b56ef6ef3c72b6 Mon Sep 17 00:00:00 2001 From: threadreaper Date: Tue, 4 Aug 2020 03:30:23 -0500 Subject: [PATCH 1/3] Errors fixed. --- pywal/export.py | 6 ++++-- pywal/wallpaper.py | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pywal/export.py b/pywal/export.py index 12505288..24c0656c 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) diff --git a/pywal/wallpaper.py b/pywal/wallpaper.py index f654187e..ac5496b8 100644 --- a/pywal/wallpaper.py +++ b/pywal/wallpaper.py @@ -115,7 +115,7 @@ 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 = """ @@ -124,8 +124,9 @@ def set_desktop_wallpaper(desktop, img): d.currentConfigGroup = Array("Wallpaper", "org.kde.image", "General"); d.writeConfig("Image", "%s")}; """ - util.disown(["qdbus", "org.kde.plasmashell", "/PlasmaShell", "org.kde.PlasmaShell.evaluateScript", - string % img]) + util.disown(["qdbus", "org.kde.plasmashell", "/PlasmaShell", + "org.kde.PlasmaShell.evaluateScript", string % img]) + else: set_wm_wallpaper(img) From 477ff3a08144bcaf4f6d820cd21591b8293dd09f Mon Sep 17 00:00:00 2001 From: threadreaper Date: Tue, 4 Aug 2020 03:43:15 -0500 Subject: [PATCH 2/3] Ok, I'm new at this, last one, srsly! --- pywal/wallpaper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pywal/wallpaper.py b/pywal/wallpaper.py index ac5496b8..eb177886 100644 --- a/pywal/wallpaper.py +++ b/pywal/wallpaper.py @@ -121,8 +121,8 @@ def set_desktop_wallpaper(desktop, img): string = """ var allDesktops = desktops();for (i=0;i Date: Tue, 4 Aug 2020 13:27:57 -0500 Subject: [PATCH 3/3] Added Colors.sh for Haskell support. --- pywal/export.py | 1 + pywal/templates/Colors.hs | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 pywal/templates/Colors.hs diff --git a/pywal/export.py b/pywal/export.py index 24c0656c..3d89ae4c 100644 --- a/pywal/export.py +++ b/pywal/export.py @@ -106,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}"