change names in files.conf and add git pull in instractions.
This commit is contained in:
parent
752fd63e63
commit
8ca575be7c
2 changed files with 38 additions and 22 deletions
|
@ -1,21 +1,29 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
_DOTFILES="~/Documents/git/dotfiles"
|
# Use HOME variable.
|
||||||
|
|
||||||
_FILE_TO_COPY='d ~/.config/alacritty dotconfig
|
_GIT_FOLDER="${HOME}/Documents/git"
|
||||||
d ~/.config/eww dotconfig
|
|
||||||
d ~/.config/hypr dotconfig
|
|
||||||
d ~/.config/nvim dotconfig
|
|
||||||
d ~/.config/gotop dotconfig
|
|
||||||
d ~/.config/waybar dotconfig
|
|
||||||
f ~/.bashrc dotscripts/bash/.bashrc
|
|
||||||
f ~/.bash_profile dotscripts/bash/.bash_profile
|
|
||||||
d ~/.config/conky dotconfig
|
|
||||||
d ~/.local/bin dotlocal
|
|
||||||
d /etc/ly dotetc
|
|
||||||
f /etc/makepkg.conf dotetc/makepkg.conf
|
|
||||||
f /etc/pacman.conf dotetc/makepkg.conf
|
|
||||||
f /etc/doas.conf dotetc/doas.conf'
|
|
||||||
|
|
||||||
|
# u for update
|
||||||
|
# d for directory,
|
||||||
|
# f for file
|
||||||
|
|
||||||
|
_INSTRUCTIONS="u dotfiles
|
||||||
|
d ${HOME}/.config/alacritty dotfiles/dotconfig/alacritty
|
||||||
|
d ${HOME}/.config/eww dotfiles/dotconfig/eww
|
||||||
|
d ${HOME}/.config/hypr dotfiles/dotconfig/hypr
|
||||||
|
d ${HOME}/.config/nvim dotfiles/dotconfig/nvim
|
||||||
|
d ${HOME}/.config/gotop dotfiles/dotconfig/gotop
|
||||||
|
d ${HOME}/.config/waybar dotfiles/dotconfig/waybar
|
||||||
|
d ${HOME}/.config/conky dotfiles/dotconfig/conky
|
||||||
|
f ${HOME}/.bashrc dotfiles/dotscripts/bash/.bashrc
|
||||||
|
f ${HOME}/.bash_profile dotfiles/dotscripts/bash/.bash_profile
|
||||||
|
d ${HOME}/.local/bin dotfiles/dotlocal/bin
|
||||||
|
d /etc/ly dotfiles/dotetc/ly
|
||||||
|
f /etc/makepkg.conf dotfiles/dotetc/makepkg.conf
|
||||||
|
f /etc/pacman.conf dotfiles/dotetc/makepkg.conf
|
||||||
|
f /etc/doas.conf dotfiles/dotetc/doas.conf"
|
||||||
|
|
||||||
|
# Use `git pull ~/Documents/git/${<repos>}` for u
|
||||||
# Use `install -Dm644 <file_name> <dest>` for f
|
# Use `install -Dm644 <file_name> <dest>` for f
|
||||||
# Use `cp -Rf <folder> <dest>` for d
|
# Use `cp -Rf <folder> <dest>` for d
|
||||||
|
|
|
@ -1,30 +1,38 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Need doas to work.
|
||||||
|
|
||||||
cd "$( dirname "$( readlink -f "$0" )" )" || exit
|
cd "$( dirname "$( readlink -f "$0" )" )" || exit
|
||||||
|
|
||||||
CONFIG_PATH="./config"
|
CONFIG_PATH="./config"
|
||||||
|
|
||||||
. ./config/*.conf
|
. ${CONFIG_PATH}/*.conf
|
||||||
|
|
||||||
echo "$_FILE_TO_COPY"
|
echo "$_GIT_FOLDER"
|
||||||
echo "$_DOTFILES"
|
echo "$_INSTRUCTIONS"
|
||||||
|
|
||||||
while VAR= read -r line;
|
while VAR= read -r line;
|
||||||
do
|
do
|
||||||
order="$(echo $line | cut -d ' ' -f 1)"
|
order="$(echo $line | cut -d ' ' -f 1)"
|
||||||
file_on_computer="$(echo $line | cut -d ' ' -f 2)"
|
operand_1="$(echo $line | cut -d ' ' -f 2)"
|
||||||
file_on_dotfile="$(echo $line | cut -d ' ' -f 3)"
|
operand_2="$(echo $line | cut -d ' ' -f 3)"
|
||||||
|
|
||||||
if [ "$order" = "d" ]
|
if [ "$order" = "d" ]
|
||||||
then
|
then
|
||||||
echo ".. d detected .."
|
echo ".. d detected .."
|
||||||
|
echo "cp -Rf ${_GIT_FOLDER}/${operand_2} ${operand_1}"
|
||||||
elif [ "$order" = "f" ]
|
elif [ "$order" = "f" ]
|
||||||
then
|
then
|
||||||
echo ".. f detected .."
|
echo ".. f detected .."
|
||||||
|
elif [ "$order" = "u" ]
|
||||||
|
then
|
||||||
|
cd "${_GIT_FOLDER}/${operand_1}"
|
||||||
|
git pull
|
||||||
|
cd -
|
||||||
else
|
else
|
||||||
echo "Err, $order uknown"
|
echo "Err, $order uknown"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo " .. $order $file_on_computer $file_on_dotfile.. ";
|
echo ".. ${order} ${operand_1} ${operand_2} ..";
|
||||||
|
|
||||||
done <<< "$_FILE_TO_COPY"
|
done <<< "$_INSTRUCTIONS"
|
||||||
|
|
Loading…
Reference in a new issue