aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-09-28 09:04:21 +0500
committerEgor Tensin <egor@tensin.name>2026-09-28 09:13:59 +0500
commit07d966b02a0d5f35efd64b0d0a07e0cddb139d7b (patch)
tree2ba6be5ba590cb1eded6383beb8a7f6041e7343d
parentremove annoying trailing period from repo URLs (diff)
downloadlinux-home-07d966b02a0d5f35efd64b0d0a07e0cddb139d7b.tar.gz
linux-home-07d966b02a0d5f35efd64b0d0a07e0cddb139d7b.zip
bash: add some Arch-specific shortcuts
-rw-r--r--%HOME%/.bash_utils/arch.sh34
-rw-r--r--%HOME%/.bashrc2
2 files changed, 35 insertions, 1 deletions
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 <egor@tensin.name>
+# 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
}