From a4a248e3e6de6d99b6e2174788f5d371355c7c74 Mon Sep 17 00:00:00 2001 From: tuxwarrior Date: Tue, 30 Apr 2024 21:01:05 -0500 Subject: [PATCH] u --- scripts/99_download.sh | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/scripts/99_download.sh b/scripts/99_download.sh index 8f3bd6d..00d611e 100644 --- a/scripts/99_download.sh +++ b/scripts/99_download.sh @@ -29,7 +29,7 @@ operation=$1 # ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ -# helper function +# helper functions download_repo() { _targz_url=$1 @@ -46,6 +46,16 @@ download_repo() { } +deploy_file() { + _src_path=$1 + _trg_path=$2 + + cp -f ${_src_path} ${_trg_path} + chown ${user}:${user} ${_trg_path} + ls -al ${_trg_path} +} + + # download all dots (dot files) from repo if [ ${operation} == "dots" ] ; then @@ -53,21 +63,14 @@ if [ ${operation} == "dots" ] ; then download_repo ${targz_dots_url} tree ${clone_trg}/lnx-arch - target_file_name=hyprland.conf - target_file_path=/home/${user}/.config/hypr/${target_file_name} - cp -f ${dots_trg}/hyprland/${target_file_name} ${target_file_path} - chown ${user}:${user} ${target_file_path} - ls -al ${target_file_path} + file_name=hyprland.conf + deploy_file ${dots_trg}/hyprland/${file_name} /home/${user}/.config/hypr/${file_name} - target_file_name=hyprpaper.conf - target_file_path=/home/${user}/.config/hypr/${target_file_name} - cp -f ${dots_trg}/hyprpaper/${target_file_name} ${target_file_path} - chown ${user}:${user} ${target_file_path} - ls -al ${target_file_path} + file_name=hyprpaper.conf + deploy_file ${dots_trg}/hyprland/${file_name} /home/${user}/.config/hypr/${file_name} fi - # download wallpapers from repo if [ ${operation} == "wp" ] ; then echo "***** ${operation} *****"