diff --git a/bootstrap.sh b/bootstrap.sh index 5128cdd..0ca2512 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -151,8 +151,13 @@ create_user() { create_directories() { #shellcheck disable=SC2016 _loop_wrapper "$1" \ - 'Creating directory ${x}' \ - "mkdir -p $user_home/\${x}" + 'Creating directory $(echo $x | cut -d"," -f1)' \ + ' + dir=$(echo $x | cut -d"," -f1) + mod=$(echo $x | cut -d"," -f2) + sudo -u "$username" mkdir -p "${user_home}/${dir}" + chmod "${mod}" "${user_home}/${dir}" + ' info "Done!" } diff --git a/directories.txt b/directories.txt index 0fbc620..f6485f2 100644 --- a/directories.txt +++ b/directories.txt @@ -1,13 +1,16 @@ -.cache -.config/zsh/configs -.config/X11/xsession.d -.local/state -.local/log -.local/share/applications -.local/share/gnupg -.local/bin/cron -Desktop -Documents -Downloads -Pictures/Screenshots -Videos +.cache,755 +.config/zsh/configs,755 +.config/X11/xsession.d,755 +.config/gnupg,700 +.local/state,755 +.local/log,755 +.local/share/applications,755 +.local/bin/cron,755 +.ssh,700 +Desktop,755 +Documents,755 +Downloads,755 +Pictures,755 +Pictures/Screenshots,755 +Videos,755 +test,700 diff --git a/packages.txt b/packages.txt index 4b9ce1d..29b0642 100644 --- a/packages.txt +++ b/packages.txt @@ -81,3 +81,4 @@ system-config-printer odt2txt lowdown mpv +zk