"action": {
"default_popup": "index.html",
"default_icon": "icons/icon-32.png"
},
"commands": {
"_execute_action": {
"suggested_key": {
"default": "Ctrl+Comma",
"mac": "Command+Comma"
}
}
}
for i in "${args[@]}"; do
file_path=$(find -name "$1*" -type f);
if [ $file_path ]; then
echo $file_path;
echo "file_size before: $(du -sh $file_path)";
$(jpegoptim --strip-all --all-progressive -ptm 80 $file_path);
echo "file_size after: $(du -sh $file_path)";
fi
done
~/Downloads ⌚ 10:53:43
$ jpegoptim --strip-all --all-progressive -ptm 80 home.jpg
home.jpg 1920x720 24bit N JFIF [OK] 671034 --> 133789 bytes (80.06%), optimized.
Average compression (1 files): 80.06% (525k)
~/Downloads ⌚ 10:54:09
$ jpg_optim.sh home.jpg
./home.jpg
file_size before: 132K ./home.jpg
/home/serii/xubuntu/bin/jpg_optim.sh: line 14: ./home.jpg: Permission denied
file_size after: 132K ./home.jpg
~/Downloads ⌚ 10:54:21
$ ll
Permissions Size User Date Modified Name
.rw-rw-r-- 133k serii 7 Aug 10:53 home.jpg