woa plenty colors

This commit is contained in:
flick0
2023-10-13 19:11:31 +00:00
parent 7e5cbc2255
commit 3c43e8359a
10 changed files with 178 additions and 44 deletions

38
colors
View File

@@ -1,19 +1,19 @@
0: #45475A
1: #F38BA8
2: #A6E3A1
3: #F9E2AF
4: #89B4FA
5: #F5C2E7
6: #94E2D5
7: #BAC2DE
8: #585B70
9: #F38BA8
10: #A6E3A1
11: #F9E2AF
12: #89B4FA
13: #F5C2E7
14: #94E2D5
15: #A6ADC8
foreground: #CDD6F4
background: #1E1E2E
cursor: #F5E0DC
0: #1b3c46
1: #9DBAD8
2: #DABAC8
3: #B2C2DE
4: #B4C6E3
5: #D5C7DA
6: #E6C9D5
7: #dedde8
8: #9b9aa2
9: #9DBAD8
10: #DABAC8
11: #B2C2DE
12: #B4C6E3
13: #D5C7DA
14: #E6C9D5
15: #dedde8
background: #1b3c46
foreground: #dedde8
cursor: #dedde8

View File

@@ -1,19 +1,19 @@
@define-color c0 #45475A;
@define-color c1 #F38BA8;
@define-color c2 #A6E3A1;
@define-color c3 #F9E2AF;
@define-color c4 #89B4FA;
@define-color c5 #F5C2E7;
@define-color c6 #94E2D5;
@define-color c7 #BAC2DE;
@define-color c8 #585B70;
@define-color c9 #F38BA8;
@define-color c10 #A6E3A1;
@define-color c11 #F9E2AF;
@define-color c12 #89B4FA;
@define-color c13 #F5C2E7;
@define-color c14 #94E2D5;
@define-color c15 #A6ADC8;
@define-color cforeground #CDD6F4;
@define-color cbackground #1E1E1E;
@define-color ccursor #F5E0DC;
@define-color c0 #211a19;
@define-color c1 #aa837f;
@define-color c2 #b69890;
@define-color c3 #c7b0a2;
@define-color c4 #493baa;
@define-color c5 #a57498;
@define-color c6 #aa7278;
@define-color c7 #c7c5c5;
@define-color c8 #585352;
@define-color c9 #aa837f;
@define-color c10 #b69890;
@define-color c11 #c7b0a2;
@define-color c12 #493baa;
@define-color c13 #a57498;
@define-color c14 #aa7278;
@define-color c15 #c7c5c5;
@define-color cbackground #211a19;
@define-color cforeground #c7c5c5;
@define-color ccursor #c7c5c5;

View File

@@ -16,7 +16,9 @@ import nowplaying from './service/nowplaying.js';
//get home dir
const home = `/home/${exec('whoami')}`
console.log(home)
const themedir = App.configDir.split('/').slice(0,-2).join('/')
console.log("homedir:: "+ home)
console.log("themedir:: " + themedir)
function get_color(){
return readFileAsync(home + '/.config/hypr/themes/colors')
@@ -26,6 +28,9 @@ function get_color(){
let lines = content.split('\n');
for (let i = 0; i < lines.length; i++) {
let [key, value] = lines[i].split(':');
if (key == undefined || value == undefined){
continue;
}
//strip
key = key.trim();
value = value.trim();
@@ -55,11 +60,13 @@ subprocess([
}
writeFile(content, colors_path)
.then(file => print('colors.css updated'))
.then(file => {
print('colors.css updated');
App.resetCss();
App.applyCss(App.configDir +`/style.css`);
})
.catch(err => print(err));
})
App.resetCss();
App.applyCss(App.configDir +`/style.css`);
});
@@ -176,8 +183,19 @@ const Media = () => Widget.Button({
]
}),
connections: [
[Mpris, self => {
[Mpris,async (self) => {
is_it_playing(self)
//cover art
const player = Mpris.getPlayer('');
if (player){
const cover_path = `${player.trackCoverUrl} `.slice(7,-1);
execAsync(["python", `${themedir}/scripts/cover2bg.py`, cover_path])
.then(out => console.log(out))
.catch(err => console.log(err));
}
}],
]
});

View File

@@ -60,6 +60,7 @@ label {
color: #fff;
/* transition: padding 0.5s cubic-bezier(.55,-0.68,.48,1.68),background 0.3s ease-in-out; */
}
.notification.critical{
padding-right: 20px;
padding-left: 20px;
@@ -249,6 +250,7 @@ label {
.clock {
background: @cforeground;
color: @cbackground;
text-shadow: 0 0 5px rgba(255, 255, 255, 0.777);
background: linear-gradient(118deg, @cforeground 5%, @c1 5%, @c1 20%, @cforeground 20%, @cforeground 40%, @c1 40%, @c1 60%, @cforeground 60%, @cforeground 80%, @c1 80%, @c1 95%, @cforeground 95%);
background-size: 200% 300%;

View File

@@ -1,14 +1,17 @@
#!/usr/bin/env fish
set -Ux STARSHIP_CONFIG $argv[1]/starship.toml
set -Ux HYPRLAND_THEME $argv[1]
set color ~/.config/hypr/scripts/color
pkill dunst &
pkill -USR2 fish &
swww init &
#TODO: add a check for asusctl
asusctl led-mode static -c "$($color cursor -n)" &
swww init &
python $argv[1]/scripts/pywal_set.py 1 &
ags -c ~/rice/themes/aurora/components/ags/config.js &

63
scripts/cover2bg.py Executable file
View File

@@ -0,0 +1,63 @@
from PIL import Image, ImageFilter, ImageOps
import argparse
import subprocess
import os
import pywal
def apply(wallpaper):
colors = pywal.colors.get(wallpaper,backend="colorz")
print(wallpaper)
cmd = f"swww img '{wallpaper}' --transition-type simple --transition-step 15"
subprocess.run(cmd,shell=True)
with open(os.path.expanduser("~/.config/hypr/themes/colors"),"w") as f:
for color,value in colors["colors"].items():
f.write(f"{color[5:]}: {value}\n")
for color,value in colors["special"].items():
f.write(f"{color}: {value}\n")
subprocess.run("touch ~/.config/hypr/themes/colors",shell=True)
subprocess.run("pkill -USR2 fish",shell=True)
gradient = ""
for color,value in colors["colors"].items():
gradient += f"rgba({value[1:]}ff) "
gradient += " 45deg"
cmd = f"hyprctl keyword general:col.active_border '{gradient}'"
print(cmd)
subprocess.run(cmd,shell=True)
gradient = ""
for color,value in colors["colors"].items():
gradient += f"rgba({value[1:]}44) "
gradient += " 0deg"
cmd = f"hyprctl keyword general:col.inactive_border '{gradient}'"
print(cmd)
subprocess.run(cmd,shell=True)
def main():
parser = argparse.ArgumentParser()
parser.add_argument("image", help="image path")
args = parser.parse_args()
image = args.image
# open image
image = Image.open(image)
image = image.filter(ImageFilter.GaussianBlur(radius=5))
#image.show()
# save image
image.save("/tmp/bg.png")
apply("/tmp/bg.png")
if __name__ == "__main__":
main()

45
scripts/pywal_set.py Normal file
View File

@@ -0,0 +1,45 @@
#/usr/bin/env python
import pywal
import argparse
import os
import subprocess
THEME_DIR = os.environ.get("HYPRLAND_THEME")
print(THEME_DIR)
def apply(wallpaper):
colors = pywal.colors.get(wallpaper,backend="colorz")
print(wallpaper)
cmd = f"swww img '{wallpaper}' --transition-type simple --transition-step 15"
subprocess.run(cmd,shell=True)
with open(os.path.expanduser("~/.config/hypr/themes/colors"),"w") as f:
for color,value in colors["colors"].items():
f.write(f"{color[5:]}: {value}\n")
for color,value in colors["special"].items():
f.write(f"{color}: {value}\n")
subprocess.run("touch ~/.config/hypr/themes/colors",shell=True)
subprocess.run("pkill -USR2 fish",shell=True)
def main():
parser = argparse.ArgumentParser()
parser.add_argument("i", help="wallpaper index")
# parser.add_argument("cycle", help="cycle wall", required=False)
args = parser.parse_args()
if args.i.isdigit():
index = int(args.i)
wallpaper = os.listdir(os.path.join(THEME_DIR, "wallpapers"))[index-1]
wallpaper = os.path.join(os.path.join(THEME_DIR, "wallpapers"),wallpaper)
else:
wallpaper = os.path.expanduser(args.i)
apply(wallpaper)
if __name__ == "__main__":
main()

View File

@@ -15,14 +15,17 @@ general {
col.inactive_border=0xff45475a
col.group_border=0xff89dceb
col.group_border_active=0xfff9e2af
border_size=3
}
animations {
enabled=1
# bezier=overshot,0.05,0.9,0.1,1.1
bezier=overshot,0.13,0.99,0.29,1.1
bezier = linear, 0.0, 0.0, 1.0, 1.0
animation=windows,1,4,overshot,slide
animation=border,1,10,default
animation=fade,1,10,default
animation=workspaces,1,6,overshot,slidevert
animation = borderangle, 1, 100, linear, loop
}

BIN
wallpapers/piano.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 846 KiB

BIN
wallpapers/sky.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 MiB