mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-13 22:02:34 +00:00
feat: removes old link-config script, rename a few things in dev-env script, more cleanup.
This commit is contained in:
33
dev-env
33
dev-env
@@ -32,7 +32,7 @@ log() {
|
||||
log "env: $DEV_ENV"
|
||||
|
||||
# Removes a destination directory and copies all files to the destination.
|
||||
update_files() {
|
||||
update_dirs() {
|
||||
log "copying over files from: $1"
|
||||
pushd $1 &>/dev/null
|
||||
(
|
||||
@@ -60,7 +60,7 @@ update_files() {
|
||||
copy() {
|
||||
log "removing: $2"
|
||||
if [[ $dry_run == "0" ]]; then
|
||||
rm $2
|
||||
rm $2 &>/dev/null
|
||||
fi
|
||||
log "copying: $1 to $2"
|
||||
if [[ $dry_run == "0" ]]; then
|
||||
@@ -70,15 +70,30 @@ copy() {
|
||||
|
||||
# Copy all files from a directory into another directory.
|
||||
copy_files() {
|
||||
for f in $(find $1 -mindepth 1 -maxdepth 1 -type f); do
|
||||
copy $f "$2/$(basename $f)"
|
||||
done
|
||||
log "copying over files from: $1"
|
||||
pushd $1 &>/dev/null
|
||||
(
|
||||
for f in $(find . -mindepth 1 -maxdepth 1 -type f); do
|
||||
|
||||
local dest="$2/$(basename $f)"
|
||||
|
||||
if [[ $dry_run == "0" ]]; then
|
||||
rm -rf $dest >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
log " copying env: cp $f $dest"
|
||||
if [[ $dry_run == "0" ]]; then
|
||||
cp $f $dest
|
||||
fi
|
||||
done
|
||||
)
|
||||
popd &>/dev/null
|
||||
}
|
||||
|
||||
############################## MAIN ##############################
|
||||
|
||||
update_files $DEV_ENV/env/.config $XDG_CONFIG_HOME
|
||||
update_files $DEV_ENV/env/.local $HOME/.local
|
||||
update_dirs $DEV_ENV/env/.config $XDG_CONFIG_HOME
|
||||
update_dirs $DEV_ENV/env/.local $HOME/.local
|
||||
|
||||
# SYSTEMD
|
||||
mkdir -p $XDG_CONFIG_HOME/systemd/user
|
||||
@@ -89,7 +104,7 @@ copy_files $DEV_ENV/env/.config/systemd/user $XDG_CONFIG_HOME/systemd/user
|
||||
# copying configuration.
|
||||
copy $DEV_ENV/env/.zshenv $HOME/.zshenv
|
||||
mkdir -p $XDG_CONFIG_HOME/zsh
|
||||
update_files $DEV_ENV/env/.config/zsh $XDG_CONFIG_HOME/zsh
|
||||
update_dirs $DEV_ENV/env/.config/zsh $XDG_CONFIG_HOME/zsh
|
||||
copy_files $DEV_ENV/env/.config/zsh $XDG_CONFIG_HOME/zsh
|
||||
|
||||
# TMUX
|
||||
@@ -99,5 +114,7 @@ copy $DEV_ENV/env/.tmux.conf $HOME/.tmux.conf
|
||||
mkdir $HOME/.gnupg
|
||||
copy_files $DEV_ENV/env/.gnupg $HOME/.gnupg
|
||||
|
||||
copy $DEV_ENV/dev-env $HOME/.local/scripts/dev-env
|
||||
|
||||
systemctl --user daemon-reload
|
||||
hyprctl reload
|
||||
|
||||
Reference in New Issue
Block a user