initial commit
This commit is contained in:
32
copy.sh
Executable file
32
copy.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
hn=`hostname`
|
||||
|
||||
if [ ! -d $hn ]; then
|
||||
echo "no directory found for this device $hn"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Saving files for device $hn."
|
||||
echo
|
||||
|
||||
|
||||
save_if_exists () {
|
||||
# $1 is location, $2 is save location
|
||||
|
||||
src="$HOME/.config/$1"
|
||||
loc="$hn/$1"
|
||||
|
||||
if [ -e $src ]; then
|
||||
echo "Saving $src..."
|
||||
mkdir -p `dirname $loc`
|
||||
cp -r $src $loc
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
# test for sway
|
||||
save_if_exists "sway/config"
|
||||
save_if_exists "waybar/config.ini"
|
||||
save_if_exists "kitty/kitty.conf"
|
||||
save_if_exists "nvim"
|
Reference in New Issue
Block a user