aboutsummaryrefslogtreecommitdiff
path: root/stow-all.bash
diff options
context:
space:
mode:
authorMohammad Reza Karimi <m.r.karimi.j@gmail.com>2025-12-16 13:27:11 -0500
committerMohammad Reza Karimi <m.r.karimi.j@gmail.com>2025-12-16 13:27:11 -0500
commit5a41da5881a11ba3fdc3890c342aa3b7eb53e0cf (patch)
tree92b7f7af29ed4a9dcc0eab33490c6225cce9b14a /stow-all.bash
parent856e361d56c201cbb1b1521c8b93b747163b1376 (diff)
add initial version (incomplete)
Diffstat (limited to 'stow-all.bash')
-rwxr-xr-xstow-all.bash53
1 files changed, 53 insertions, 0 deletions
diff --git a/stow-all.bash b/stow-all.bash
new file mode 100755
index 0000000..5601d99
--- /dev/null
+++ b/stow-all.bash
@@ -0,0 +1,53 @@
+#!/usr/bin/env bash
+
+ANSI_clear_line="\e[0K"
+ANSI_color_R="\e[1;31m"
+ANSI_color_G="\e[1;32m"
+ANSI_color_Y="\e[1;33m"
+ANSI_color_B="\e[1;34m"
+ANSI_color_M="\e[1;35m"
+ANSI_color_C="\e[1;36m"
+ANSI_color_W="\e[1;39m"
+ANSI_reset="\e[0m"
+
+function Log()
+{
+ printf "${ANSI_clear_line}${ANSI_color_W}%s ${ANSI_color_B}%s${ANSI_reset}\n" "$1" "$2" 1>&2
+}
+
+function ProcessStowOutput()
+{
+ while IFS= read -r line; do
+ if [[ $line =~ ^LINK:[[:space:]]+ ]]; then
+ # LINK operations in green
+ printf " - ${ANSI_clear_line}${ANSI_color_G}${line}${ANSI_reset}\n" 1>&2
+ elif [[ $line =~ ^UNLINK:[[:space:]]+ ]]; then
+ # UNLINK operations in red
+ printf " - ${ANSI_clear_line}${ANSI_color_R}${line}${ANSI_reset}\n" 1>&2
+ elif [[ $line =~ ^SKIP:[[:space:]]+ ]]; then
+ # SKIP operations in yellow
+ printf " - ${ANSI_clear_line}${ANSI_color_Y}${line}${ANSI_reset}\n" 1>&2
+ else
+ # Other lines in cyan
+ printf " - ${ANSI_clear_line}${ANSI_color_C}${line}${ANSI_reset}\n" 1>&2
+ fi
+ done
+}
+
+function Stow()
+{
+ Log "Stowing" "$1"
+ stow --dotfiles -v "$1" 2>&1 | ProcessStowOutput
+ Log "Done with" "$1"
+}
+
+Stow alacritty
+Stow bash
+Stow fonts
+Stow git
+Stow gpg
+Stow hyprland
+Stow kvantum
+Stow lf
+Stow qute
+Stow wayland-basics