Reverted back to original installer
This commit is contained in:
parent
82c82d05b4
commit
26f4b64562
48
install.sh
48
install.sh
@ -1,50 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
## DOWNLOADED FROM GIT REPO ##
|
## DOWNLOADED FROM GITHUB ##
|
||||||
|
|
||||||
# Find all dot files then if the original file exists, create a backup
|
# Find all dot files then if the original file exists, create a backup
|
||||||
# Once backed up to {file}.dtbak symlink the new dotfile in place
|
# Once backed up to {file}.dtbak symlink the new dotfile in place
|
||||||
for file in $(find . -maxdepth 1 -name ".*" -type f -printf "%f\n"); do
|
for file in $(find . -maxdepth 1 -name ".*" -type f -printf "%f\n" ); do
|
||||||
# Check if it's a file and if a symlink already exists
|
if [ -e ~/$file ]; then
|
||||||
target_file="~/$file"
|
mv -f ~/$file{,.dtbak}
|
||||||
if [ -e $target_file ]; then
|
|
||||||
if [ -L $target_file ]; then
|
|
||||||
# If it's a symlink and points to the correct location, skip it
|
|
||||||
target_link=$(readlink $target_file)
|
|
||||||
if [ "$target_link" != "$PWD/$file" ]; then
|
|
||||||
mv -f $target_file{,.dtbak} # Backup existing symlink or file
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
mv -f $target_file{,.dtbak} # Backup if it's not a symlink
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
ln -s $PWD/$file $target_file
|
ln -s $PWD/$file ~/$file
|
||||||
done
|
done
|
||||||
|
|
||||||
# Handle directories
|
|
||||||
for dir in $(find . -maxdepth 1 -name ".*" -type d); do
|
|
||||||
target_dir="~/$dir"
|
|
||||||
|
|
||||||
# Create the directory in the target location if it doesn't exist
|
|
||||||
if [ ! -d $target_dir ]; then
|
|
||||||
mkdir -p $target_dir
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Now handle symlinks for files inside the directory
|
|
||||||
for subfile in $(find $dir -type f); do
|
|
||||||
relative_subfile="${subfile#$dir/}"
|
|
||||||
target_subfile="$target_dir/$relative_subfile"
|
|
||||||
|
|
||||||
# Check if the symlink already exists and points to the correct location
|
|
||||||
if [ ! -e $target_subfile ]; then
|
|
||||||
ln -s $PWD/$subfile $target_subfile
|
|
||||||
elif [ -L $target_subfile ]; then
|
|
||||||
target_link=$(readlink $target_subfile)
|
|
||||||
if [ "$target_link" != "$PWD/$subfile" ]; then
|
|
||||||
mv -f $target_subfile{,.dtbak} # Backup existing symlink
|
|
||||||
ln -s $PWD/$subfile $target_subfile # Create new symlink
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|||||||
@ -1,2 +0,0 @@
|
|||||||
//@theme "/usr/share/rofi/themes/arthur.rasi"
|
|
||||||
@theme "/usr/share/rofi/themes/gruvbox-dark-soft.rasi"
|
|
||||||
Loading…
Reference in New Issue
Block a user