diff --git a/components/ags/config.js b/components/ags/config.js index 842d757..c869132 100644 --- a/components/ags/config.js +++ b/components/ags/config.js @@ -196,7 +196,8 @@ const Media = () => Widget.Button({ const cover_path = `${player.trackCoverUrl} `.slice(7,-1); console.log(1,1,cover_path) execAsync(["cp",cover_path,`/tmp/musiccover.png`]) - .then(out => { + .then(async(out) => { + await new Promise(r => setTimeout(r, 300)); execAsync([`${themedir}/scripts/cover2bg`, `/tmp/musiccover.png`]) .then(out => console.log(out)) .catch(err => console.log(err)); diff --git a/components/ags/style.css b/components/ags/style.css index c474b29..304d2a3 100644 --- a/components/ags/style.css +++ b/components/ags/style.css @@ -15,7 +15,7 @@ label { .notification, .trayitem { background-color: @cbackground ; - box-shadow: rgba(0, 0, 0, 0.288) 2 2 5 2px; + box-shadow: alpha(@cbackground,0.2) 2 2 5 2px; border-radius: 15px; margin-right: 10px; padding: 10px; @@ -160,11 +160,12 @@ label { background-size: 400% 400%; animation: gradient_f 9s cubic-bezier(.72,.39,.21,1) infinite; text-shadow: 0 0 5px rgba(0, 0, 0, 0.377); - color: #fff ; + color: @cbackground ; padding-left: 40px; padding-right: 40px; padding-bottom: 2; padding-top: 4; + box-shadow: alpha(@cbackground,0.2) 2 2 5 2px; transition: padding 1s cubic-bezier(0,1.77,.08,1.49),background 0.2s ease-in-out,font-size 0.5s ease-out; } diff --git a/currentwall b/currentwall new file mode 100644 index 0000000..56a6051 --- /dev/null +++ b/currentwall @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/scripts/apply_wall b/scripts/apply_wall index 73329b9..0ec2b5e 100755 --- a/scripts/apply_wall +++ b/scripts/apply_wall @@ -5,7 +5,7 @@ import pywal def apply(pre=None,wallpaper=None): if not pre: - colors = pywal.colors.get(wallpaper,backend="colorz") + colors = pywal.colors.get(wallpaper,backend="wal") else: colors = pre print(wallpaper) diff --git a/scripts/cover2bg b/scripts/cover2bg index dee2afc..2ba0b35 100755 --- a/scripts/cover2bg +++ b/scripts/cover2bg @@ -13,16 +13,26 @@ if ! file "$1" | grep -qE 'image|bitmap'; then exit 1 fi - # get json from hyprctl json=$(hyprctl monitors -j) json=$(echo $json | jq '.[0]') width=$(echo $json | jq '.width') height=$(echo $json | jq '.height') +if [ -f /tmp/prev_bg.png ]; then + if cmp -s "$1" /tmp/prev_bg.png; then + echo "Image is the same" + exit 0 + fi +fi + +cp "$1" /tmp/prev_bg.png + +echo "Image is different" + cp "$1" /tmp/bg.png -magick mogrify -fuzz 20% -trim +repage -shave 7x7 -format png /tmp/bg.png +magick mogrify -fuzz 4% -trim +repage -shave 7x7 -format png /tmp/bg.png convert /tmp/bg.png -resize $((width / 2))x$((height / 2))^ -gravity center -extent $((width / 2))x$((height / 2)) /tmp/bg.png img_width=$(identify -format "%w" /tmp/bg.png)