#!/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.jsonc" save_if_exists "waybar/style.css" save_if_exists "kitty/kitty.conf" save_if_exists "kitty/koa.png" save_if_exists "nvim" save_if_exists "fish/config.fish"