diff options
| author | Mitchell Riedstra <mitch@riedstra.dev> | 2024-01-22 19:35:09 -0500 |
|---|---|---|
| committer | Mitchell Riedstra <mitch@riedstra.dev> | 2024-01-22 19:35:09 -0500 |
| commit | 76196f760716990ee239a2455ce62b07425e0540 (patch) | |
| tree | 078377431376608a623b09486f3445c7be3e1d8b /link.sh | |
| download | rivercfg-76196f760716990ee239a2455ce62b07425e0540.tar.gz rivercfg-76196f760716990ee239a2455ce62b07425e0540.tar.xz | |
Initial
Diffstat (limited to 'link.sh')
| -rwxr-xr-x | link.sh | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -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 |
