Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 26 lines (23 sloc) 817 Bytes
#!/bin/bash
# display progress of unisync synchronization and summary results with zenity
# Copyright (C) 2012 Vyacheslav Levit
# License: GPLv3 or later. See COPYING or <http://www.gnu.org/licenses/>.
unisync "$@" 2>&1 | (while read -r line
do
sub=":: profiles to sync:"
if [[ "$line" == "$sub"* ]] ; then
prof_count=$(echo "${line#$sub}" | wc -w)
let i=0
let percent=0
continue
fi
[[ "$line" == ":: location:"* ]] && continue
if [[ "$line" == ":: "*:* ]] ; then
echo $percent
let i+=1
let percent=$i*100/$prof_count
fi
done ; echo $percent) | zenity --progress --no-cancel --auto-close \
--title unisync --text synchronizing...
zenity --info --timeout 7 --title=unisync \
--text "<tt>$(cat /tmp/unisync_summary)</tt>"