u
This commit is contained in:
@@ -8,6 +8,6 @@ OPTIONS_LOADED=true # used to check if options have been loaded
|
|||||||
|
|
||||||
CLONE_TARGET_DIR=/tmp # directory to clone dots repository to
|
CLONE_TARGET_DIR=/tmp # directory to clone dots repository to
|
||||||
|
|
||||||
USER=poq # system user
|
#USER=poq # system user
|
||||||
|
|
||||||
I3WM=true # {true, false} installs i3 packages
|
I3WM=true # {true, false} installs i3 packages
|
||||||
|
|||||||
@@ -16,8 +16,11 @@ if [ $# -lt 1 ]; then
|
|||||||
fi
|
fi
|
||||||
operation=$1
|
operation=$1
|
||||||
|
|
||||||
user=${USER}
|
clone_trg=${CLONE_TARGET_DIR} # value found in options.sh file, sourced above
|
||||||
clone_trg=${CLONE_TARGET_DIR}
|
if [[ -z "${clone_trg}" ]] ; then
|
||||||
|
echo "error: CLONE_TARGET_DIR is empty"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
options_url=https://git.mz.fo/fro/lnx-arch/raw/branch/master/dots/archinstall/${HOSTNAME}/options.sh
|
options_url=https://git.mz.fo/fro/lnx-arch/raw/branch/master/dots/archinstall/${HOSTNAME}/options.sh
|
||||||
options_trg=/tmp/options.sh
|
options_trg=/tmp/options.sh
|
||||||
@@ -30,7 +33,7 @@ if [ -z "${OPTIONS_LOADED}" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
secrets_cred_path=/home/${user}/syncDir/secrets/toBeSources/cred.sh
|
secrets_cred_path=/home/${USER}/syncDir/secrets/toBeSources/cred.sh
|
||||||
source ${secrets_cred_path}
|
source ${secrets_cred_path}
|
||||||
|
|
||||||
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
# ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||||
@@ -56,7 +59,7 @@ create_dir() {
|
|||||||
_directory=$1
|
_directory=$1
|
||||||
|
|
||||||
mkdir -p ${_directory}
|
mkdir -p ${_directory}
|
||||||
chown ${user}:${user} ${_directory}
|
chown ${USER}:${USER} ${_directory}
|
||||||
}
|
}
|
||||||
|
|
||||||
deploy_file() {
|
deploy_file() {
|
||||||
@@ -91,14 +94,14 @@ deploy_file() {
|
|||||||
|
|
||||||
if [[ ${_recursive} != "recursive" ]] ; then
|
if [[ ${_recursive} != "recursive" ]] ; then
|
||||||
# https://serverfault.com/questions/156437/how-to-chown-a-directory-recursively-including-hidden-files-or-directories
|
# https://serverfault.com/questions/156437/how-to-chown-a-directory-recursively-including-hidden-files-or-directories
|
||||||
chown ${user}:${user} ${_trg_path}*
|
chown ${USER}:${USER} ${_trg_path}*
|
||||||
chown ${user}:${user} ${_trg_path}.[^.]*
|
chown ${USER}:${USER} ${_trg_path}.[^.]*
|
||||||
else
|
else
|
||||||
chown -R ${user}:${user} ${_trg_path}*
|
chown -R ${USER}:${USER} ${_trg_path}*
|
||||||
chown -R ${user}:${user} ${_trg_path}.[^.]*
|
chown -R ${USER}:${USER} ${_trg_path}.[^.]*
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
chown ${user}:${user} ${_trg_path}
|
chown ${USER}:${USER} ${_trg_path}
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -116,7 +119,7 @@ deploy_file() {
|
|||||||
|
|
||||||
# locate firefox's profile directory
|
# locate firefox's profile directory
|
||||||
firefox_profile_dir() {
|
firefox_profile_dir() {
|
||||||
ffdir=/home/${user}/.mozilla/firefox/
|
ffdir=/home/${USER}/.mozilla/firefox/
|
||||||
|
|
||||||
if ! [ -d "$ffdir" ]
|
if ! [ -d "$ffdir" ]
|
||||||
then
|
then
|
||||||
@@ -160,7 +163,7 @@ if [ ${operation} == "dots" ] ; then
|
|||||||
|
|
||||||
# bashrc
|
# bashrc
|
||||||
file_name=.bashrc
|
file_name=.bashrc
|
||||||
file_path=/home/${user}
|
file_path=/home/${USER}
|
||||||
deploy_file "${dots_trg}/bash/${file_name}" "${file_path}/${file_name}"
|
deploy_file "${dots_trg}/bash/${file_name}" "${file_path}/${file_name}"
|
||||||
|
|
||||||
# bin (executable binaries, scripts)
|
# bin (executable binaries, scripts)
|
||||||
@@ -173,15 +176,15 @@ if [ ${operation} == "dots" ] ; then
|
|||||||
deploy_file "${dots_trg}/environment/${file_name}" "${file_path}/${file_name}" no_chown
|
deploy_file "${dots_trg}/environment/${file_name}" "${file_path}/${file_name}" no_chown
|
||||||
|
|
||||||
# mounts
|
# mounts
|
||||||
# file_name=nas.mount
|
file_name=nas.mount
|
||||||
# file_path=/etc/systemd/system
|
file_path=/etc/systemd/system
|
||||||
# deploy_file "${dots_trg}/systemd/${file_name}" "${file_path}/${file_name}" no_chown
|
deploy_file "${dots_trg}/systemd/${file_name}" "${file_path}/${file_name}" no_chown
|
||||||
#
|
|
||||||
# sed -i 's|[USERNAME]|klevstul|g' "${file_path}/${file_name}"
|
sed -i 's|[USERNAME]|klevstul|g' "${file_path}/${file_name}"
|
||||||
# sed -i 's|[PASSWORD]|${LILLESORTEBOKS}|g' "${file_path}/${file_name}"
|
sed -i 's|[PASSWORD]|${LILLESORTEBOKS}|g' "${file_path}/${file_name}"
|
||||||
#
|
|
||||||
# mount_target=/mnt/nas
|
mount_target=/mnt/nas
|
||||||
# mkdir -p ${mount_target}
|
mkdir -p ${mount_target}
|
||||||
|
|
||||||
# ----------
|
# ----------
|
||||||
# printing
|
# printing
|
||||||
@@ -245,7 +248,7 @@ if [ ${operation} == "dots" ] ; then
|
|||||||
|
|
||||||
# lf
|
# lf
|
||||||
file_name=lfrc
|
file_name=lfrc
|
||||||
file_path=/home/${user}/.config/lf
|
file_path=/home/${USER}/.config/lf
|
||||||
mkdir -p ${file_path}
|
mkdir -p ${file_path}
|
||||||
deploy_file "${dots_trg}/lf/${file_name}" "${file_path}/${file_name}"
|
deploy_file "${dots_trg}/lf/${file_name}" "${file_path}/${file_name}"
|
||||||
|
|
||||||
@@ -273,35 +276,35 @@ if [ ${operation} == "dots" ] ; then
|
|||||||
# symlink is created below. as well, ".gtkrc-2.0.mine" had no effect, so
|
# symlink is created below. as well, ".gtkrc-2.0.mine" had no effect, so
|
||||||
# ".gtkrc-2.0" is overwritten
|
# ".gtkrc-2.0" is overwritten
|
||||||
file_name=settings.ini
|
file_name=settings.ini
|
||||||
file_path=/home/${user}/.config/gtk-3.0
|
file_path=/home/${USER}/.config/gtk-3.0
|
||||||
mkdir -p ${file_path}
|
mkdir -p ${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
|
||||||
file_path=/home/${user}
|
file_path=/home/${USER}
|
||||||
deploy_file "${dots_trg}/gtk/${file_name}" "${file_path}/${file_name}"
|
deploy_file "${dots_trg}/gtk/${file_name}" "${file_path}/${file_name}"
|
||||||
tmp_file_path_full="/home/${user}/.config/gtk-3.0/bookmarks"
|
tmp_file_path_full="/home/${USER}/.config/gtk-3.0/bookmarks"
|
||||||
trash-put ${tmp_file_path_full}
|
trash-put ${tmp_file_path_full}
|
||||||
ln -s "${file_path}/${file_name}" "${tmp_file_path_full}"
|
ln -s "${file_path}/${file_name}" "${tmp_file_path_full}"
|
||||||
|
|
||||||
file_name=.gtkrc-2.0
|
file_name=.gtkrc-2.0
|
||||||
file_path=/home/${user}
|
file_path=/home/${USER}
|
||||||
deploy_file "${dots_trg}/gtk/${file_name}" "${file_path}/${file_name}"
|
deploy_file "${dots_trg}/gtk/${file_name}" "${file_path}/${file_name}"
|
||||||
|
|
||||||
# nitrogen
|
# nitrogen
|
||||||
file_path=/home/${user}/.config/nitrogen
|
file_path=/home/${USER}/.config/nitrogen
|
||||||
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/${user}/.config/pcmanfm/default
|
file_path=/home/${USER}/.config/pcmanfm/default
|
||||||
mkdir -p ${file_path}
|
mkdir -p ${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/${user}/.config/VSCodium/User
|
file_path=/home/${USER}/.config/VSCodium/User
|
||||||
mkdir -p ${file_path}
|
mkdir -p ${file_path}
|
||||||
deploy_file "${dots_trg}/vscodium/${file_name}" "${file_path}/${file_name}"
|
deploy_file "${dots_trg}/vscodium/${file_name}" "${file_path}/${file_name}"
|
||||||
|
|
||||||
@@ -310,13 +313,13 @@ if [ ${operation} == "dots" ] ; then
|
|||||||
|
|
||||||
# i3
|
# i3
|
||||||
file_name=config
|
file_name=config
|
||||||
file_path=/home/${user}/.config/i3
|
file_path=/home/${USER}/.config/i3
|
||||||
mkdir -p ${file_path}
|
mkdir -p ${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/${user}/.config/i3status
|
file_path=/home/${USER}/.config/i3status
|
||||||
mkdir -p ${file_path}
|
mkdir -p ${file_path}
|
||||||
deploy_file "${dots_trg}/i3status/${file_name}" "${file_path}/"
|
deploy_file "${dots_trg}/i3status/${file_name}" "${file_path}/"
|
||||||
|
|
||||||
@@ -325,13 +328,13 @@ if [ ${operation} == "dots" ] ; then
|
|||||||
if [ ${I3WM} == "true" ] || [ ${QTILE} == "true" ] ; then
|
if [ ${I3WM} == "true" ] || [ ${QTILE} == "true" ] ; then
|
||||||
|
|
||||||
# xorg
|
# xorg
|
||||||
file_path=/home/${user}
|
file_path=/home/${USER}
|
||||||
deploy_file "${dots_trg}/xorg/.*" "${file_path}/"
|
deploy_file "${dots_trg}/xorg/.*" "${file_path}/"
|
||||||
|
|
||||||
# lemurs (display/login manager)
|
# lemurs (display/login manager)
|
||||||
file_name_src=.xinitrc
|
file_name_src=.xinitrc
|
||||||
file_name_trg=i3
|
file_name_trg=i3
|
||||||
file_path_src=/home/${user}
|
file_path_src=/home/${USER}
|
||||||
file_path_trg=/etc/lemurs/wms
|
file_path_trg=/etc/lemurs/wms
|
||||||
if [ -f ${file_path_trg}/${file_name_trg} ] ; then
|
if [ -f ${file_path_trg}/${file_name_trg} ] ; then
|
||||||
echo ""
|
echo ""
|
||||||
@@ -341,7 +344,7 @@ if [ ${operation} == "dots" ] ; then
|
|||||||
echo ""
|
echo ""
|
||||||
echo "creating soft link: ${file_path_src}/${file_name_src} ➔ ${file_path_trg}/${file_name_trg}"
|
echo "creating soft link: ${file_path_src}/${file_name_src} ➔ ${file_path_trg}/${file_name_trg}"
|
||||||
ln -s ${file_path_src}/${file_name_src} ${file_path_trg}/${file_name_trg}
|
ln -s ${file_path_src}/${file_name_src} ${file_path_trg}/${file_name_trg}
|
||||||
chown -h ${user}:${user} ${file_path_trg}/${file_name_trg}
|
chown -h ${USER}:${USER} ${file_path_trg}/${file_name_trg}
|
||||||
ls -al ${file_path_trg}
|
ls -al ${file_path_trg}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -364,21 +367,21 @@ if [ ${operation} == "dots+" ] ; then
|
|||||||
# ----------
|
# ----------
|
||||||
# fonts
|
# fonts
|
||||||
# ----------
|
# ----------
|
||||||
file_path=/home/${user}/.local/share/fonts
|
file_path=/home/${USER}/.local/share/fonts
|
||||||
mkdir -p ${file_path}
|
mkdir -p ${file_path}
|
||||||
deploy_file "${dotsplus_trg}/fonts/install/*" "${file_path}/"
|
deploy_file "${dotsplus_trg}/fonts/install/*" "${file_path}/"
|
||||||
|
|
||||||
# ----------
|
# ----------
|
||||||
# images
|
# images
|
||||||
# ----------
|
# ----------
|
||||||
file_path=/home/${user}/.local/share/img
|
file_path=/home/${USER}/.local/share/img
|
||||||
mkdir -p ${file_path}
|
mkdir -p ${file_path}
|
||||||
deploy_file "${dotsplus_trg}/images/*" "${file_path}/"
|
deploy_file "${dotsplus_trg}/images/*" "${file_path}/"
|
||||||
|
|
||||||
# ----------
|
# ----------
|
||||||
# wallpapers
|
# wallpapers
|
||||||
# ----------
|
# ----------
|
||||||
file_path=/home/${user}/.local/share/wp
|
file_path=/home/${USER}/.local/share/wp
|
||||||
mkdir -p ${file_path}
|
mkdir -p ${file_path}
|
||||||
deploy_file "${dotsplus_trg}/wallpapers/install/*" "${file_path}/"
|
deploy_file "${dotsplus_trg}/wallpapers/install/*" "${file_path}/"
|
||||||
|
|
||||||
@@ -390,7 +393,7 @@ if [ ${operation} == "dots+" ] ; then
|
|||||||
# https://vscodethemes.com/e/sdras.night-owl/night-owl-no-italics?language=javascript
|
# https://vscodethemes.com/e/sdras.night-owl/night-owl-no-italics?language=javascript
|
||||||
# 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/${user}/.vscode-oss/extensions
|
file_path=/home/${USER}/.vscode-oss/extensions
|
||||||
mkdir -p ${file_path}
|
mkdir -p ${file_path}
|
||||||
deploy_file "${dotsplus_trg}/miscellaneous/${file_name}" "${file_path}/" chown recursive
|
deploy_file "${dotsplus_trg}/miscellaneous/${file_name}" "${file_path}/" chown recursive
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user