-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlinkdots.sh
More file actions
executable file
·28 lines (25 loc) · 980 Bytes
/
Copy pathlinkdots.sh
File metadata and controls
executable file
·28 lines (25 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
green='\033[0;32m'
black='\033[0;30m'
clean='\033[0m'
backupdir=~/.config.bak
echo "This script will backup conflicting files in ~/.config/ to $backupdir, and symlink my configs instead.\nMake sure $backupdir doesn't exist when this script is run."
echo "Continue? (y/N)"
read ans
if [ $ans != y ] && [ $ans != Y ]; then
echo "Exiting without doing anything" && exit
fi
# backup
[ -d $backupdir ] && echo "$backupdir already exists. Please make sure $backupdir doesn't exist.\nExiting without doing anything." && exit
mkdir -p $backupdir
echo "$backupdir created"
for conf in $(ls configs/.config); do
([ -f ~/.config/$conf ] || [ -d ~/.config/$conf ]) &&
mv ~/.config/$conf $backupdir/$conf && echo "moved ~/.config/$conf into $backupdir/$conf"
done
# symlink
stow -t ~/ */ && echo "symlink successful"
#**for wallpaper**
ln -s ~/pix/walls/wall ~/.config/dwm/walls/shivam-baraik-Nu8S-iMWAPw-unsplash-4.jpg
echo "script ending ${green}successfully${clean}!"
exit