Reverted back to original installer

This commit is contained in:
Phil 2025-05-20 21:58:56 +01:00
parent 82c82d05b4
commit 26f4b64562
2 changed files with 5 additions and 45 deletions

View File

@ -1,50 +1,12 @@
#!/bin/bash
## DOWNLOADED FROM GIT REPO ##
## DOWNLOADED FROM GITHUB ##
# 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
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
target_file="~/$file"
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
for file in $(find . -maxdepth 1 -name ".*" -type f -printf "%f\n" ); do
if [ -e ~/$file ]; then
mv -f ~/$file{,.dtbak}
fi
ln -s $PWD/$file $target_file
ln -s $PWD/$file ~/$file
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

View File

@ -1,2 +0,0 @@
//@theme "/usr/share/rofi/themes/arthur.rasi"
@theme "/usr/share/rofi/themes/gruvbox-dark-soft.rasi"