2024-09-04 00:53:14 +02:00
|
|
|
#!/usr/bin/env nix-shell
|
|
|
|
#!nix-shell -p libsixel
|
|
|
|
#!nix-shell -i bash
|
2024-08-11 03:14:02 +02:00
|
|
|
|
|
|
|
if [ "$#" != 2 ]; then
|
|
|
|
echo "Usage: $0 <name> <url>"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
name=$1
|
|
|
|
url=$2
|
|
|
|
|
|
|
|
curr=$(pwd)
|
|
|
|
|
2024-09-04 00:53:14 +02:00
|
|
|
dir_path=$SHIMMERING_ASSET_DIR/songs/$name
|
2024-08-11 03:14:02 +02:00
|
|
|
mkdir $dir_path
|
|
|
|
cd $dir_path
|
|
|
|
|
|
|
|
http GET "$url" > temp
|
|
|
|
convert ./temp ./base.jpg
|
|
|
|
convert ./base.jpg -resize 256x256 ./base_256.jpg
|
|
|
|
rm temp
|
2024-09-04 00:53:14 +02:00
|
|
|
img2sixel ./base.jpg
|
2024-08-11 03:14:02 +02:00
|
|
|
|
|
|
|
cd $curr
|