From 90e83971e52add3464e459f532df766247baaf93 Mon Sep 17 00:00:00 2001 From: "Fred T. Hamster" Date: Tue, 19 Mar 2013 21:38:23 -0400 Subject: [PATCH] moved the recustomize alias into being a function, which allows it to support parameters. now using that fact to allow other users to have customizations besides fred; their base name just needs to be provided when calling the recustomize function, e.g.: recustomize simba --- scripts/core/common.alias | 2 -- scripts/core/functions.sh | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/scripts/core/common.alias b/scripts/core/common.alias index 44cf303c..77dee20a 100644 --- a/scripts/core/common.alias +++ b/scripts/core/common.alias @@ -89,8 +89,6 @@ alias play='bash $FEISTY_MEOW_SCRIPTS/multimedia/sound_play.sh' # says goodbye when leaving a shell. alias bye='. $FEISTY_MEOW_SCRIPTS/users/goodbye.sh' alias cputemp='acpi -t' -# redoes fred's set of custom scripts. -alias recustomize='regenerate >/dev/null; echo "copying custom overrides for fred..."; cpdiff $FEISTY_MEOW_DIR/customizing/fred $FEISTY_MEOW_GENERATED/custom; regenerate' # makes root user's home directory's permissions right. alias reroot='chown -R root:root /root' # yes, these are really helpful... diff --git a/scripts/core/functions.sh b/scripts/core/functions.sh index aa9c512a..ae3fd1c1 100644 --- a/scripts/core/functions.sh +++ b/scripts/core/functions.sh @@ -264,6 +264,27 @@ if [ -z "$skip_all" ]; then echo } + # copies a set of custom scripts into the proper location for feisty meow + # to merge their functions and aliases with the standard set. + function recustomize() + { + user="$1"; shift + if [ -z "$user" ]; then + # use our default example user if there was no name provided. + user=fred + fi + if [ ! -d "$FEISTY_MEOW_DIR/customizing/$user" ]; then + echo "The customization folder provided for $user should be:" + echo " '$FEISTY_MEOW_DIR/customizing/$user'" + echo "but that folder does not exist. Skipping customization." + return 1 + fi + regenerate >/dev/null + echo "copying custom overrides for $user" + perl "$FEISTY_MEOW_SCRIPTS/text/cpdiff.pl" "$FEISTY_MEOW_DIR/customizing/$user" "$FEISTY_MEOW_GENERATED/custom" + regenerate + } + function function_sentinel() { return 0; } if [ ! -z "$SHELL_DEBUG" ]; then echo function definitions end....; fi -- 2.34.1