mirror of
https://github.com/tuxdotrs/tuxOS.git
synced 2025-07-06 17:56:35 +05:30
added packages
This commit is contained in:
36
packages/tuxos-bspwm/bspwm/scripts/Updates
Normal file
36
packages/tuxos-bspwm/bspwm/scripts/Updates
Normal file
@ -0,0 +1,36 @@
|
||||
get_total_updates() {
|
||||
local total_updates=$(($(checkupdates 2> /dev/null | wc -l || echo 0) + $(paru -Qua 2> /dev/null | wc -l || echo 0)))
|
||||
echo "${total_updates:-0}"
|
||||
}
|
||||
|
||||
get_list_updates() {
|
||||
echo -e "\033[1m\033[34mRegular updates:\033[0m"
|
||||
checkupdates | sed 's/->/\x1b[32;1m\x1b[0m/g'
|
||||
}
|
||||
|
||||
print_updates() {
|
||||
local print_updates=$(get_total_updates)
|
||||
|
||||
if [[ "$print_updates" -gt 0 ]]; then
|
||||
echo -e "\033[1m\033[33mThere are $print_updates updates available:\033[0m\n"
|
||||
get_list_updates
|
||||
else
|
||||
echo -e "\033[1m\033[32mYour system is already updated!\033[0m"
|
||||
fi
|
||||
}
|
||||
|
||||
update_system() {
|
||||
paru -Syu --nocombinedupgrade
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
--get-updates)get_total_updates;;
|
||||
--print-updates)print_updates;;
|
||||
--update-system)update_system;;
|
||||
--help|*)echo -e "Updates [options]
|
||||
|
||||
Options:
|
||||
--get-updates Get the numer of updates available.
|
||||
--print-updates Print the available package to updates.
|
||||
--update-system Update your system including AUR.\n"
|
||||
esac
|
Reference in New Issue
Block a user