mirror of
https://github.com/Ahwxorg/nixos-config.git
synced 2025-12-04 15:00:13 +01:00
feat: adds new hyprlock config which is more betterer!!!
This commit is contained in:
parent
171d98fb72
commit
d2b5c9bf4f
2 changed files with 140 additions and 87 deletions
|
|
@ -43,5 +43,27 @@
|
|||
echo "$battery_percentage% $battery_icon"
|
||||
'';
|
||||
};
|
||||
"/home/${username}/.local/bin/hyprlock-art.sh" = {
|
||||
executable = true;
|
||||
text = ''
|
||||
#!/usr/bin/env bash
|
||||
url=$(playerctl metadata mpris:artUrl)
|
||||
artist=$(playerctl metadata xesam:artist)
|
||||
album=$(playerctl metadata xesam:album)
|
||||
metadata=$(printf "$artist - $album")
|
||||
|
||||
if [ "$url" == "No player found" ]; then
|
||||
exit
|
||||
elif [ -f "/home/${username}/.cache/albumart/$metadata.png" ]; then
|
||||
echo "/home/${username}/.cache/albumart/$metadata.png"
|
||||
else
|
||||
mkdir -p "/home/${username}/.cache/albumart"
|
||||
curl -s "$url" -o "/home/${username}/.cache/albumart/$metadata"
|
||||
magick "/home/${username}/.cache/albumart/$metadata" "/home/${username}/.cache/albumart/$metadata.png"
|
||||
rm "/home/${username}/.cache/albumart/$metadata"
|
||||
echo "/home/${username}/.cache/albumart/$metadata.png"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue