usr

Modulate your userpace into POSIX-compliant shell scripts!
git clone git://clone.theohenson.com/usr.git
Log | Files | Refs | README

commit faa653111747f22d2a95447779d8d306ab84284a
parent a55c3aa0c1eae7fc5a4641727cc2e58f1b5935bc
Author: Theo Henson <[email protected]>
Date:   Sun, 15 Nov 2020 15:18:41 -0500

Fix theo_dotfiles module

Diffstat:
Mmodules/theo_dotfiles.mod.sh | 20++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/modules/theo_dotfiles.mod.sh b/modules/theo_dotfiles.mod.sh @@ -7,25 +7,25 @@ DATA_DIR="${XDG_DATA_HOME#$HOME/}" CONFIG_DIR="${XDG_CONFIG_HOME#$HOME/}" theo_dotfiles_add() { - while read -r FILE ; do + for FILE in $(theo_dotfiles_files) ; do [ -f "$HOME/$FILE" ] && mv "$HOME/$FILE" "$HOME/$FILE".orig && \ - printf "theo_dotfiles: moving %s/%s to %s/%s.orig" "$HOME" "$FILE" "$HOME" "$FILE" + printf "theo_dotfiles: moving %s/%s to %s/%s.orig\n" "$HOME" "$FILE" "$HOME" "$FILE" ln -sf "$USR_DIR/home/$FILE" "$HOME/$FILE" && \ - printf "theo_dotfiles: linking %s/home/%s to %s/%s" "$USR_DIR" "$FILE" "$HOME" "$FILE" - done <$(theo_dotfiles_files) + printf "theo_dotfiles: linking %s/home/%s to %s/%s\n" "$USR_DIR" "$FILE" "$HOME" "$FILE" + done } theo_dotfiles_remove() { - while read -r FILE ; do + for FILE in $(theo_dotfiles_files) ; do rm "$HOME/$FILE" && \ - printf "theo_dotfiles: removing %s/%s" "$HOME" "$FILE" + printf "theo_dotfiles: removing %s/%s\n" "$HOME" "$FILE" [ -f "$HOME/$FILE".orig ] && mv "$HOME/$FILE".orig "$HOME/$FILE" && \ - printf "theo_dotfiles: moving %s/%s.orig to %s/%s" "$HOME" "$FILE" "$HOME" "$FILE" - done <$(theo_dotfiles_files) + printf "theo_dotfiles: moving %s/%s.orig to %s/%s\n" "$HOME" "$FILE" "$HOME" "$FILE" + done } theo_dotfiles_info() { - printf "This module contains my (theo's) dotfiles." + printf "This module contains my (theo's) dotfiles.\n" } theo_dotfiles_dirs() { @@ -33,7 +33,7 @@ theo_dotfiles_dirs() { $CONFIG_DIR/spotify-tui $CONFIG_DIR/newsboat $CONFIG_DIR/gtk-3.0 $CONFIG_DIR/gtk-2.0 $CONFIG_DIR/python $CONFIG_DIR/picom $CONFIG_DIR/sxhkd $CONFIG_DIR/dunst $CONFIG_DIR/nvim $CONFIG_DIR/rco $CONFIG_DIR/git - $CONFIG_DIR/mpv $CONFIG_DIR/npm $CONFIG_DIR/X11 $HOME/.vim" + $CONFIG_DIR/mpv $CONFIG_DIR/npm $CONFIG_DIR/X11 .vim" } theo_dotfiles_files() {