33 lines
531 B
Bash
Executable File
33 lines
531 B
Bash
Executable File
#!/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"
|