Merge branch 'master' into master

This commit is contained in:
Dylan Araps 2019-01-04 21:59:10 +02:00 committed by GitHub
commit a6780c947c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 55 additions and 4 deletions

View File

@ -31,6 +31,7 @@ def get_export_type(export_type):
"""Convert template type to the right filename.""" """Convert template type to the right filename."""
return { return {
"css": "colors.css", "css": "colors.css",
"dmenu": "colors-wal-dmenu.h",
"dwm": "colors-wal-dwm.h", "dwm": "colors-wal-dwm.h",
"st": "colors-wal-st.h", "st": "colors-wal-st.h",
"tabbed": "colors-wal-tabbed.h", "tabbed": "colors-wal-tabbed.h",
@ -45,9 +46,10 @@ def get_export_type(export_type):
"shell": "colors.sh", "shell": "colors.sh",
"sway": "colors-sway", "sway": "colors-sway",
"tty": "colors-tty.sh", "tty": "colors-tty.sh",
"xresources": "colors.Xresources",
"yaml": "colors.yml",
"waybar": "colors-waybar.css", "waybar": "colors-waybar.css",
"xresources": "colors.Xresources",
"xmonad": "colors.hs",
"yaml": "colors.yml",
}.get(export_type, export_type) }.get(export_type, export_type)

View File

@ -54,7 +54,7 @@ def create_sequences(colors):
set_special(13, colors["special"]["foreground"], "l"), set_special(13, colors["special"]["foreground"], "l"),
set_special(17, colors["special"]["foreground"], "l"), set_special(17, colors["special"]["foreground"], "l"),
set_special(19, colors["special"]["background"], "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(232, colors["special"]["background"]),
set_color(256, colors["special"]["foreground"]) set_color(256, colors["special"]["foreground"])
]) ])

View File

@ -18,7 +18,7 @@ __cache_version__ = "1.1.0"
HOME = os.getenv("HOME", os.getenv("USERPROFILE")) 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__) MODULE_DIR = os.path.dirname(__file__)
CONF_DIR = os.path.join(HOME, ".config", "wal") CONF_DIR = os.path.join(HOME, ".config", "wal")
OS = platform.uname()[0] OS = platform.uname()[0]

View File

@ -0,0 +1,6 @@
static const char *colors[SchemeLast][2] = {{
/* fg bg */
[SchemeNorm] = {{ "{color15}", "{color0}" }},
[SchemeSel] = {{ "{color15}", "{color1}" }},
[SchemeOut] = {{ "{color15}", "{color14}" }},
}};

37
pywal/templates/colors.hs Normal file
View File

@ -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}"

View File

@ -29,6 +29,12 @@ class Color:
"""Convert a hex color to xrdb rgba.""" """Convert a hex color to xrdb rgba."""
return hex_to_xrgba(self.hex_color) 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 @property
def alpha(self): def alpha(self):
"""Add URxvt alpha value to color.""" """Add URxvt alpha value to color."""