Bibata_Cursor/tweak.sh
2019-11-19 13:13:19 +05:30

38 lines
No EOL
776 B
Bash
Executable file

#!/bin/bash
animate_fix(){
cursor=$1
file=$2
path=./$cursor/bitmaps/$file.in
#sort -k 4 ./move/left_ptr_watch.in
mv -f $path $path.bak
#j for total size 24,28,32,40,48,56,64,72,80,88,96 = 11
for j in {1..11}
do
for i in {1..60}
do
line=`sed -n '1~60'p $path.bak | sed -n "$j"p`
number=`echo $i | awk '{ printf "%04i\n", $0 }'`
line=${line/${file}_0001.png/${file}_${number}.png}
echo "$line" >> $path
#echo "$line"
done
done
fixed_line=`sed 's/[0-9] [0-9]*$/25/' $path`
echo "$fixed_line" > $path
rm -rf $path.bak
}
animate_fix "$1" "left_ptr_watch"
animate_fix "$1" "watch"
#if script generate error or success
if [ $? -ne 0 ]
then
exit 1
fi