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-19 02:54:12 +02:00
|
|
|
dir_path=$SHIMMERING_ASSET_DIR/songs/raw/$name
|
|
|
|
mkdir -p $dir_path
|
2024-08-11 03:14:02 +02:00
|
|
|
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
|