From 76196f760716990ee239a2455ce62b07425e0540 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Mon, 22 Jan 2024 19:35:09 -0500 Subject: Initial --- link.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 link.sh (limited to 'link.sh') diff --git a/link.sh b/link.sh new file mode 100755 index 0000000..41a7b5c --- /dev/null +++ b/link.sh @@ -0,0 +1,25 @@ +#!/bin/sh +set -e +timestamp="$(date +%m.%d.%Y)" + +if ! [ -L "$HOME/.waylandrc" ] ; then + mv "$HOME"/.waylandrc "$HOME"/.waylandrc-"$timestamp" +fi + +if [ -L "$HOME/.waylandrc" ] ; then + rm "$HOME/.waylandrc" +fi + +ln -sv "$(pwd)"/waylandrc "$HOME"/.waylandrc + +for _d in * ; do + ! [ -d "$_d" ] && continue + + dest="$HOME"/.config/"$_d" + if ! [ -L "$dest" ] && [ -d "$dest" ] ; then + mv "$dest" "$dest-$timestamp" + elif [ -L "$dest" ] ; then + rm "$dest" + fi + ln -sv "$(pwd)"/"$_d" "$dest" +done -- cgit v1.2.3