From 5a41da5881a11ba3fdc3890c342aa3b7eb53e0cf Mon Sep 17 00:00:00 2001 From: Mohammad Reza Karimi Date: Tue, 16 Dec 2025 13:27:11 -0500 Subject: add initial version (incomplete) --- stow-all.bash | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100755 stow-all.bash (limited to 'stow-all.bash') 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 -- cgit v1.2.3-71-gdd5e