From 07d966b02a0d5f35efd64b0d0a07e0cddb139d7b Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 28 Sep 2026 09:04:21 +0500 Subject: bash: add some Arch-specific shortcuts --- %HOME%/.bash_utils/arch.sh | 34 ++++++++++++++++++++++++++++++++++ %HOME%/.bashrc | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 %HOME%/.bash_utils/arch.sh diff --git a/%HOME%/.bash_utils/arch.sh b/%HOME%/.bash_utils/arch.sh new file mode 100644 index 0000000..6b2fc2f --- /dev/null +++ b/%HOME%/.bash_utils/arch.sh @@ -0,0 +1,34 @@ +# Copyright (c) 2026 Egor Tensin +# This file is part of the "linux-home" project. +# For details, see https://github.com/egor-tensin/linux-home +# Distributed under the MIT License. + +arch_upgrade() ( + _bash_func_prelude + + echo ====================================================================== + sudo pacman -Syu --noconfirm + echo ====================================================================== + yay -Syua --noconfirm --needed --cleanafter + echo ====================================================================== + + local reboot_timeout=10 + echo "Rebooting in $reboot_timeout seconds..." + sleep "$reboot_timeout" + reboot +) + +arch_cleanup() ( + _bash_func_prelude + + echo ====================================================================== + pacman -Qqdt | sudo pacman -Rcsn --noconfirm - + echo ====================================================================== + yay -Sca --noconfirm + echo ====================================================================== +) + +arch_yay_install() ( + _bash_func_prelude + yay -Sy --noconfirm --needed --cleanafter "$@" +) diff --git a/%HOME%/.bashrc b/%HOME%/.bashrc index 2b598f1..5d12571 100644 --- a/%HOME%/.bashrc +++ b/%HOME%/.bashrc @@ -35,7 +35,7 @@ _bash_func_prelude() { _bash_includes() { local file - for file in file text cxx distr git net path; do + for file in file text arch cxx distr git net path; do [ -r "$HOME/.bash_utils/$file.sh" ] && source "$HOME/.bash_utils/$file.sh" done } -- cgit v1.3