Skip to content

Commit

Permalink
Fixed instalation process
Browse files Browse the repository at this point in the history
  • Loading branch information
ulises-jeremias committed Mar 19, 2023
1 parent 48eac6e commit d3b67e6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ cd ./playground/vagrant/<os>/
│ └── install-pkgs.sh # Debian specific script to install packages from the official repos and other sources
├── default-config # default config files (used by dots when installing in any OS). Check the docs https://github.com/ulises-jeremias/dotfiles/wiki/Customization for more info.
│ ├── common/ # common config files to be installed in any OS
│ ├── wm/ # window manager config files to be installed in any OS based on the intallation flag `--wms`
│ ├── wm/ # window manager config files to be installed in any OS based on user input
├── playground # testing environments
│ └── docker/ # docker setup to bootstrap the testing environments
│ └── vagrant/ # vagrant setup to bootstrap the testing environments
Expand Down
2 changes: 0 additions & 2 deletions dots
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@
## -c, --clear Will remove existing dotfiles.
## -u, --upgrade Will update dependencies anyway.
## --dry-run Will not install anything. Just will create the dotfiles dir.
## --interactive Will ask for user input before installing dotfiles.
## --nodeps Will not install dependencies.
## --nodunst Notifications will use xfce4-notifyd instead.
## --utils Will answer you to install some utilities.
## --bluetooth Will add bluetooth to the dependencies added.
##
## --os=OS_NAME Operating System. Posible values: arch-linux | debian.
## By default, the installation script will determine which is your OS.
## --wms=COMMA_SEPARATED_WMS Window managers. Posible wms: i3, openbox
## --log-file=LOG_FILE_PATH Logs file path, is /tmp/dots_install_log_$(date +'%m-%d-%y_%H:%M:%S').txt by default.
## --dotfiles-dir=OUTPUT_PATH Dotfiles output dir, is ~/dotfiles by default.
##
Expand Down
7 changes: 1 addition & 6 deletions scripts/install
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@
## -c, --clear Will remove existing dotfiles.
## -u, --upgrade Will update dependencies anyway.
## --dry-run Will not install anything. Just will create the dotfiles dir.
## --interactive Will ask for user input before installing dotfiles.
## --nodeps Will not install dependencies.
##
## --os=OS_NAME Operating System. Posible values: common | arch-linux | debian
## where common is supposed to work correctly with any linux distro.
## `common` is set as default value for this flag.
## --wms=COMMA_SEPARATED_WMS Window managers. Posible wms: i3, openbox
## --log-file=LOG_FILE_PATH Logs file path, is /tmp/dots_install_log_$(date +'%m-%d-%y_%H:%M:%S').txt by default.
## --dotfiles-dir=OUTPUT_PATH Dotfiles output dir, is ~/dotfiles by default.
## --pkgs=COMMA_SEPARATED_DEPS Dependencies to install.
Expand All @@ -40,7 +38,6 @@ os=${os:-"common"}
time_str=$(date +'%m-%d-%y_%H:%M:%S')
log_file=${log_file:-"/tmp/dots_install_log_$time_str.txt"}
dotfiles_dir=${dotfiles_dir:-"$HOME/dotfiles"}
wms=${wms:-""}

[ ! -f "${log_file}" ] && touch "${log_file}"

Expand Down Expand Up @@ -80,10 +77,8 @@ echo
"${SCRIPTS_DIR}"/install-dotfiles --log-file="${log_file}" \
--dotfiles-dir="${dotfiles_dir}" \
--os="${os}" \
--wms="${wms}" \
${dry_run_flag} \
${clear_flag} \
${interactive_flag}
${clear_flag}

#==========================================
# Give the user a summary of what has
Expand Down
25 changes: 15 additions & 10 deletions scripts/install-dotfiles
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@
## -h, --help Help.
## -c, --clear Will remove existing dotfiles before installing the new ones.
## --dry-run Will not install anything. Just will create the dotfiles dir.
## --interactive Will ask for user input before installing dotfiles.
##
## --os=OS_NAME Operating System. Posible values: common | arch-linux | debian | ...
## where common is supposed to work correctly with any linux distro.
## `common` is set as default value for this flag.
## --wms=COMMA_SEPARATED_WMS Window managers. Posible wms: i3, openbox
## --log-file=LOG_FILE_PATH Logs file path, is /tmp/dots_install_log_$(date +'%m-%d-%y_%H:%M:%S').txt by default.
## --dotfiles-dir=OUTPUT_PATH Dotfiles output dir, is ~/dotfiles by default.
##
Expand All @@ -36,7 +34,6 @@ os=${os:-""}
time_str=$(date +'%m-%d-%y_%H:%M:%S')
log_file=${log_file:-"/tmp/dots_install_log_$time_str.txt"}
dotfiles_dir=${dotfiles_dir:-"${HOME}/dotfiles"}
wms=${wms:-""}

[ ! -f "${log_file}" ] && touch "${log_file}"

Expand Down Expand Up @@ -77,12 +74,10 @@ echo
for config_path in "${ROOT}"/common/config/*; do
config=$(basename "${config_path}")

if [ -n "${interactive}" ]; then
read -p "Install ${config} dotfiles? [y/N] " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
continue
fi
read -p "Install ${config} dotfiles? [y/N] " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
continue
fi

describe "Installing ${config} dotfiles"
Expand Down Expand Up @@ -133,8 +128,18 @@ if [ ! -e "${dotfiles_dir}"/custom-config/README.md ]; then
cp -rf "${dotfiles_dir}"/default-config/README.md "${dotfiles_dir}"/custom-config
fi

for wm in xfce4 $(echo "${wms}" | tr ',' '\n'); do
available_wms=$(ls "${ROOT}"/default-config/wm)

for wm in ${available_wms}; do
[ -e "${ROOT}/default-config/wm/${wm}/install" ] || continue
# Install default config for xfce4 anyways
if [ "${wm}" != "xfce4" ]; then
read -p "Install ${wm} default config? [y/N] " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
continue
fi
fi
cp -rf "${ROOT}"/default-config/wm/"${wm}" "${dotfiles_dir}"/default-config
cp -rf "${ROOT}"/default-config/wm/"${wm}" "${dotfiles_dir}"/custom-config
chmod +x "${dotfiles_dir}"/default-config/"${wm}"/install
Expand Down

0 comments on commit d3b67e6

Please sign in to comment.