make the music wallpaper fx more reliable

This commit is contained in:
flick0
2023-10-15 10:58:01 +00:00
parent 08cd590c49
commit 935d274f8e
5 changed files with 19 additions and 6 deletions

View File

@@ -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));

View File

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

1
currentwall Normal file
View File

@@ -0,0 +1 @@
1

View File

@@ -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)

View File

@@ -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)