感谢Cherrot MaskRay MissU和 神。
代码: 全选
#!/bin/bash
# zenity -list --editable $slider $level
slider=$(zenity --scale --title="Low -> High" --text "Slide right to get higher compression rate" --min-value=0 --max-value=9 --value=1)
# level=$( zenity --list \
# --title="Compression Level" \
# --column="Par" --column="Level" --column="Time Use" \
# o0 Minimal "Minimal"\
# o4 + "Long"\
# o7 ++ "Longer"
#);
if [ $? = 1 ];
then zenity --warning --title="" --text="Exiting" --timeout 1;
exit
fi
location=$(zenity --file-selection --multiple \
--separator=$'\n' --file-filter="*.png" \
--title="File(s) which?");
optipng -o"$slider" "$location";
# optipng -$level $location;
dir=$(dirname "$location")
if
zenity --question \
--text="Open Directory?" --timeout 3
then xdg-open $dir;
else zenity --info --text="Silence." --timeout 1
fi