add orphan package reporting
This commit is contained in:
		
							parent
							
								
									20d4cd4d1f
								
							
						
					
					
						commit
						ac38a9302e
					
				
							
								
								
									
										31
									
								
								bashrc
								
								
								
								
							
							
						
						
									
										31
									
								
								bashrc
								
								
								
								
							| 
						 | 
					@ -142,14 +142,35 @@ if [ ${_mem_available%.*} -lt 5 ] ; then
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ $_updates_available -gt 0 ] ; then
 | 
					if [ $_updates_available -gt 0 ] ; then
 | 
				
			||||||
	echo -ne "Updates available: \033[1;37m"
 | 
					    update_color="\033[1;37m" # default white
 | 
				
			||||||
	[ $_updates_available -gt 15 ] && echo -ne "\033[0;33m"
 | 
					    if [ $_updates_available -gt 29 ] ; then
 | 
				
			||||||
	[ $_updates_available -gt 29 ] && echo -ne "\033[0;31m"
 | 
					        update_color="\033[0;31m" # red
 | 
				
			||||||
	echo -ne "$_updates_available\033[0m"
 | 
					    elif [ $_updates_available -gt 15 ] ; then
 | 
				
			||||||
	echo -ne " [ update with: \033[1;31mupdate\033[0m ]"
 | 
					        update_color="\033[0;33m" # yellow
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    echo -ne "Updates available: ${update_color}${_updates_available}\033[0m"
 | 
				
			||||||
 | 
					    echo -ne " [ update with: ${update_color}update\033[0m ]"
 | 
				
			||||||
    echo ""
 | 
					    echo ""
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					_orphans_available="$(pacman -Qdtq 2>/dev/null | wc -l)"
 | 
				
			||||||
 | 
					if [ $_orphans_available -gt 0 ] ; then
 | 
				
			||||||
 | 
					    echo -ne "Orphaned packages: \033[1;37m"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    orphan_color="\033[1;37m"
 | 
				
			||||||
 | 
					    if [ $_orphans_available -gt 9 ] ; then
 | 
				
			||||||
 | 
					        orphan_color="\033[0;31m"
 | 
				
			||||||
 | 
					    elif [ $_orphans_available -gt 4 ] ; then
 | 
				
			||||||
 | 
					        orphan_color="\033[0;33m"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    echo -ne "${orphan_color}${_orphans_available}\033[0m"
 | 
				
			||||||
 | 
					    echo -ne " [ remove with: ${orphan_color}sudo pacman -Rns \$(pacman -Qdtq)\033[0m ]"
 | 
				
			||||||
 | 
					    echo ""
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo ""
 | 
					echo ""
 | 
				
			||||||
echo -e "Remember \"\033[1;34mTODO.md\033[0m\" and \"\033[1;34mautonote.md\033[0m\" files have content automatically displayed."
 | 
					echo -e "Remember \"\033[1;34mTODO.md\033[0m\" and \"\033[1;34mautonote.md\033[0m\" files have content automatically displayed."
 | 
				
			||||||
echo -e "Edit these with \033[1;34met\033[0m and \033[1;34mea\033[0m"
 | 
					echo -e "Edit these with \033[1;34met\033[0m and \033[1;34mea\033[0m"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue