3 # emerge-status.sh by Hellf[i]re
5 # This script will report the current status of portage.
8 # .conkyrc: ${execi [time] /path/to/script/emerge-current.sh}
11 # ${execi 30 /home/youruser/scripts/emerge-current.sh}
14 # 1) If there are two emerges running at once, when the first one finishes
15 # running, the script will report the current status as "Completed".
16 # 2) If there is a emerge running and you run a search, the script will
17 # report the current status as "Completed", until the running emerge
18 # moves to the next package, or itself completes.
19 # The reasons for this are twofold - one, it's a feature ;) and two, there
20 # would be far too much parsing required to find out the current status of
21 # every command which is run in parallel.
23 STATUS=`tail -n 15 /var/log/emerge.log |\
24 grep -iE "Compiling|Cleaning|AUTOCLEAN|completed|search|terminating|rsync" |\
26 grep -Ev 'Finished\.|Cleaning up\.\.\.' |\
31 if [ "`echo "$STATUS" | grep -i compiling`" != "" ]; then echo Compiling
32 elif [ "`echo "$STATUS" | grep -i cleaning`" != "" ]; then echo Cleaning
33 elif [ "`echo "$STATUS" | grep -i autoclean`" != "" ]; then echo Autoclean
34 elif [ "`echo "$STATUS" | grep -i sync`" != "" ]; then echo Syncing
35 elif [ "`echo "$STATUS" | grep -i search`" != "" ]; then echo Searching
36 elif [ "`echo "$STATUS" | grep -i completed`" != "" ]; then echo Completed
37 elif [ "`echo "$STATUS" | grep -i terminating`" != "" ]; then echo Completed
38 else echo Script Error!