I'm using a Bash script to retrieve the Spotify album thumbnail from whatever I'm listening at the moment to show it as an image in Hyprlock
.
For this particular case, I'm using the command 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"
...
The thing is, whenever this condition is met, curl
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 curl
, or use another similar command to download the image from the URL without having any performance issues. What I've already just managed to do is limit the use of curl
as much as possible to not have lag constantly. But it doesn't help that it lags everything else so frequently.
--limit-rate