diff --git a/pywal/export.py b/pywal/export.py index 6a28249..2c02239 100644 --- a/pywal/export.py +++ b/pywal/export.py @@ -31,6 +31,7 @@ def get_export_type(export_type): """Convert template type to the right filename.""" return { "css": "colors.css", + "dmenu": "colors-wal-dmenu.h", "dwm": "colors-wal-dwm.h", "st": "colors-wal-st.h", "tabbed": "colors-wal-tabbed.h", @@ -45,9 +46,10 @@ def get_export_type(export_type): "shell": "colors.sh", "sway": "colors-sway", "tty": "colors-tty.sh", - "xresources": "colors.Xresources", - "yaml": "colors.yml", "waybar": "colors-waybar.css", + "xresources": "colors.Xresources", + "xmonad": "colors.hs", + "yaml": "colors.yml", }.get(export_type, export_type) diff --git a/pywal/sequences.py b/pywal/sequences.py index 8d92252..18aa6eb 100644 --- a/pywal/sequences.py +++ b/pywal/sequences.py @@ -54,7 +54,7 @@ def create_sequences(colors): set_special(13, colors["special"]["foreground"], "l"), set_special(17, colors["special"]["foreground"], "l"), set_special(19, colors["special"]["background"], "l"), - set_special(708, colors["special"]["background"], "l"), + set_special(708, colors["special"]["background"], "l", alpha), set_color(232, colors["special"]["background"]), set_color(256, colors["special"]["foreground"]) ]) diff --git a/pywal/settings.py b/pywal/settings.py index 18c6dd6..2a862bf 100644 --- a/pywal/settings.py +++ b/pywal/settings.py @@ -18,7 +18,7 @@ __cache_version__ = "1.1.0" HOME = os.getenv("HOME", os.getenv("USERPROFILE")) -CACHE_DIR = os.path.join(HOME, ".cache", "wal") +CACHE_DIR = os.getenv("PYWAL_CACHE_DIR", os.path.join(HOME, ".cache", "wal")) MODULE_DIR = os.path.dirname(__file__) CONF_DIR = os.path.join(HOME, ".config", "wal") OS = platform.uname()[0] diff --git a/pywal/templates/colors-wal-dmenu.h b/pywal/templates/colors-wal-dmenu.h new file mode 100644 index 0000000..aeab7a5 --- /dev/null +++ b/pywal/templates/colors-wal-dmenu.h @@ -0,0 +1,6 @@ +static const char *colors[SchemeLast][2] = {{ + /* fg bg */ + [SchemeNorm] = {{ "{color15}", "{color0}" }}, + [SchemeSel] = {{ "{color15}", "{color1}" }}, + [SchemeOut] = {{ "{color15}", "{color14}" }}, +}}; diff --git a/pywal/templates/colors.hs b/pywal/templates/colors.hs new file mode 100644 index 0000000..6ffa1a6 --- /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/util.py b/pywal/util.py index 0557cc4..de8eb09 100644 --- a/pywal/util.py +++ b/pywal/util.py @@ -29,6 +29,12 @@ class Color: """Convert a hex color to xrdb rgba.""" return hex_to_xrgba(self.hex_color) + @property + def rgba(self): + """Convert a hex color to rgba.""" + return "rgba(%s,%s,%s,%s)" % (*hex_to_rgb(self.hex_color), + int(self.alpha_num)/100) + @property def alpha(self): """Add URxvt alpha value to color."""