add bling to waybar

This commit is contained in:
lelgenio 2020-10-10 03:35:37 -03:00
parent 39bf993bfc
commit 7df4667af8
2 changed files with 29 additions and 5 deletions

View File

@ -1,3 +1,4 @@
{%@@ set bg_rgb = hex2rgb(color.bg) @@%}
* {
font: 14px {{@@ font.interface @@}}, Font Awesome, Fira Code Nerd Font;
border-radius:0;
@ -6,10 +7,14 @@
transition-duration:0;
}
window#waybar.empty * {
color: {{@@ color.txt @@}};
}
window#waybar {
/* background-color: rgba(30,30,30,.9); */
opacity: 0.9;
background-color: {{@@ color.bg @@}};
transition-duration: .5s;
background-color: rgba({{@@ bg_rgb @@}}, .9);
{%@@ if bar_pos == "top" @@%}
border-bottom:
{%@@ else @@%}
@ -19,13 +24,15 @@ window#waybar {
}
window#waybar.solo {
opacity: 1;
background-color: {{@@ color.bg @@}};
}
window#waybar.empty {
opacity: .5;
background-color: {{@@ color.bg @@}};
{%@@ if color.type == "dark" @@%}
background-color: transparent;
{%@@ else @@%}
background-color: rgba({{@@ bg_rgb @@}}, 0.3);
{%@@ endif @@%}
border:none;
}

View File

@ -14,3 +14,20 @@ def ordered_path():
newPATH.append(i)
return ':'.join(newPATH)
def hex2rgb(e):
assert e.startswith("#")
e = e.strip("#").lower()
assert len(e) == 6
for i in e:
assert (i in "0123456789abcdef")
def h2r(i):
return str(eval('0x{}'.format(i)))
r = e[0:2]
g = e[2:4]
b = e[4:6]
return ", ".join([h2r(i) for i in (r, g, b)])