/ fix of permission issue

This commit is contained in:
committer
2024-08-25 19:17:32 -05:00
parent 172062c267
commit fd5e8b170f

View File

@@ -60,6 +60,8 @@ download_repo() {
create_dir() { create_dir() {
_directory=$1 _directory=$1
# runuser -l ${system_user} -c 'mkdir -p ${_directory}'
mkdir -p ${_directory} mkdir -p ${_directory}
chown ${system_user}:${system_user} ${_directory} chown ${system_user}:${system_user} ${_directory}
} }
@@ -87,7 +89,7 @@ deploy_file() {
cp --force --recursive ${_src_path} ${_trg_path} cp --force --recursive ${_src_path} ${_trg_path}
fi fi
# only chown if _no_chown variable is empty # chown by default
if [[ ${_no_chown} != "no_chown" ]] ; then if [[ ${_no_chown} != "no_chown" ]] ; then
# if the target path ends with a slash, we have a directory # if the target path ends with a slash, we have a directory
if [[ "$_trg_path" == */ ]] if [[ "$_trg_path" == */ ]]
@@ -262,13 +264,13 @@ if [ ${operation} == "dots" ] ; then
# dunst # dunst
file_name=dunstrc file_name=dunstrc
file_path=/home/${system_user}/.config/dunst file_path=/home/${system_user}/.config/dunst
mkdir -p ${file_path} create_dir(${file_path})
deploy_file "${dots_trg}/dunst/${file_name}" "${file_path}/${file_name}" deploy_file "${dots_trg}/dunst/${file_name}" "${file_path}/${file_name}"
# lf # lf
file_name=lfrc file_name=lfrc
file_path=/home/${system_user}/.config/lf file_path=/home/${system_user}/.config/lf
mkdir -p ${file_path} create_dir(${file_path})
deploy_file "${dots_trg}/lf/${file_name}" "${file_path}/${file_name}" deploy_file "${dots_trg}/lf/${file_name}" "${file_path}/${file_name}"
# firefox # firefox
@@ -286,7 +288,7 @@ if [ ${operation} == "dots" ] ; then
file_name=userChrome.css file_name=userChrome.css
file_path=${ffpd}/chrome file_path=${ffpd}/chrome
mkdir -p ${file_path} create_dir(${file_path})
deploy_file "${dots_trg}/firefox/${file_name}" "${file_path}/${file_name}" deploy_file "${dots_trg}/firefox/${file_name}" "${file_path}/${file_name}"
fi fi
@@ -296,7 +298,7 @@ if [ ${operation} == "dots" ] ; then
# ".gtkrc-2.0" is overwritten # ".gtkrc-2.0" is overwritten
file_name=settings.ini file_name=settings.ini
file_path=/home/${system_user}/.config/gtk-3.0 file_path=/home/${system_user}/.config/gtk-3.0
mkdir -p ${file_path} create_dir(${file_path})
deploy_file "${dots_trg}/gtk/${file_name}" "${file_path}/${file_name}" deploy_file "${dots_trg}/gtk/${file_name}" "${file_path}/${file_name}"
file_name=.gtk-bookmarks file_name=.gtk-bookmarks
@@ -312,7 +314,7 @@ if [ ${operation} == "dots" ] ; then
file_name=index.theme file_name=index.theme
file_path=/home/${system_user}/.icons/default file_path=/home/${system_user}/.icons/default
mkdir -p ${file_path} create_dir(${file_path})
deploy_file "${dots_trg}/gtk/${file_name}" "${file_path}/${file_name}" deploy_file "${dots_trg}/gtk/${file_name}" "${file_path}/${file_name}"
# helix # helix
@@ -322,20 +324,20 @@ if [ ${operation} == "dots" ] ; then
# nitrogen # nitrogen
file_path=/home/${system_user}/.config/nitrogen file_path=/home/${system_user}/.config/nitrogen
mkdir -p ${file_path} create_dir(${file_path})
deploy_file "${dots_trg}/nitrogen/*" "${file_path}/" deploy_file "${dots_trg}/nitrogen/*" "${file_path}/"
# pcmanfm # pcmanfm
# bookmarks found in "dots/gtk/.gtk-bookmarks" # bookmarks found in "dots/gtk/.gtk-bookmarks"
file_name=pcmanfm.conf file_name=pcmanfm.conf
file_path=/home/${system_user}/.config/pcmanfm/default file_path=/home/${system_user}/.config/pcmanfm/default
mkdir -p ${file_path} create_dir(${file_path})
deploy_file "${dots_trg}/pcmanfm/${file_name}" "${file_path}/${file_name}" deploy_file "${dots_trg}/pcmanfm/${file_name}" "${file_path}/${file_name}"
# vscodium # vscodium
file_name=settings.json file_name=settings.json
file_path=/home/${system_user}/.config/VSCodium/User file_path=/home/${system_user}/.config/VSCodium/User
mkdir -p ${file_path} create_dir(${file_path})
deploy_file "${dots_trg}/vscodium/${file_name}" "${file_path}/${file_name}" deploy_file "${dots_trg}/vscodium/${file_name}" "${file_path}/${file_name}"
# i3wm # i3wm
@@ -344,13 +346,13 @@ if [ ${operation} == "dots" ] ; then
# i3 # i3
file_name=config file_name=config
file_path=/home/${system_user}/.config/i3 file_path=/home/${system_user}/.config/i3
mkdir -p ${file_path} create_dir(${file_path})
deploy_file "${dots_trg}/i3wm/${file_name}" "${file_path}/" deploy_file "${dots_trg}/i3wm/${file_name}" "${file_path}/"
# i3status # i3status
file_name=config file_name=config
file_path=/home/${system_user}/.config/i3status file_path=/home/${system_user}/.config/i3status
mkdir -p ${file_path} create_dir(${file_path})
deploy_file "${dots_trg}/i3status/${file_name}" "${file_path}/" deploy_file "${dots_trg}/i3status/${file_name}" "${file_path}/"
fi fi
@@ -398,21 +400,21 @@ if [ ${operation} == "dots+" ] ; then
# fonts # fonts
# ---------- # ----------
file_path=/home/${system_user}/.local/share/fonts file_path=/home/${system_user}/.local/share/fonts
mkdir -p ${file_path} create_dir(${file_path})
deploy_file "${dotsplus_trg}/fonts/install/*" "${file_path}/" deploy_file "${dotsplus_trg}/fonts/install/*" "${file_path}/"
# ---------- # ----------
# images # images
# ---------- # ----------
file_path=/home/${system_user}/.local/share/img file_path=/home/${system_user}/.local/share/img
mkdir -p ${file_path} create_dir(${file_path})
deploy_file "${dotsplus_trg}/images/*" "${file_path}/" deploy_file "${dotsplus_trg}/images/*" "${file_path}/"
# ---------- # ----------
# wallpapers # wallpapers
# ---------- # ----------
file_path=/home/${system_user}/.local/share/wp file_path=/home/${system_user}/.local/share/wp
mkdir -p ${file_path} create_dir(${file_path})
deploy_file "${dotsplus_trg}/wallpapers/install/*" "${file_path}/" deploy_file "${dotsplus_trg}/wallpapers/install/*" "${file_path}/"
# ---------- # ----------
@@ -424,7 +426,7 @@ if [ ${operation} == "dots+" ] ; then
# https://github.com/sdras/night-owl-vscode-theme/tree/main/themes # https://github.com/sdras/night-owl-vscode-theme/tree/main/themes
file_name=night-owl-vscode-theme-main.zip file_name=night-owl-vscode-theme-main.zip
file_path=/home/${system_user}/.vscode-oss/extensions file_path=/home/${system_user}/.vscode-oss/extensions
mkdir -p ${file_path} create_dir(${file_path})
deploy_file "${dotsplus_trg}/miscellaneous/${file_name}" "${file_path}/" chown recursive deploy_file "${dotsplus_trg}/miscellaneous/${file_name}" "${file_path}/" chown recursive
# sweet dark gtk theme # sweet dark gtk theme
@@ -438,7 +440,7 @@ if [ ${operation} == "dots+" ] ; then
# chowning # chowning
# ---------- # ----------
share_dir=/home/${system_user}/.local/share share_dir=/home/${system_user}/.local/share
mkdir -p ${share_dir} create_dir(${file_path})
chown ${system_user}:${system_user} ${share_dir} chown ${system_user}:${system_user} ${share_dir}
chown ${system_user}:${system_user} ${share_dir}/* chown ${system_user}:${system_user} ${share_dir}/*