I'm using a bashBash script to retrieve the Spotify album thumbnail from whatever I'm listening at the moment to show it as an image in 'Hyprlock', forHyprlock.
For this particular case, I'm using the command 'curl'curl to retrieve the album cover image and store it in a separate directory.
...
if [ ! -f "stored_file.jpg" ]; then
curl $url -so stored_file.jpg
echo "stored_file.jpg"
...
...
if [ ! -f "stored_file.jpg" ]; then
curl $url -so stored_file.jpg
echo "stored_file.jpg"
...
The thing is, whenever this condition is met, curlcurl downloads the image, but it causes a lag spike, affecting all of the other widgets I implemented, which is not ideal.
I wanted to know if there was a way to optimize curlcurl, or use another similar command to download the image from the URL without having any performance issues, what. What I've already just managed to do is limit the use of curlcurl as much as possible to not have lag constantly. But it doesn't help that it lags everything else so frequently.