summaryrefslogtreecommitdiff
path: root/link-user
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2024-12-01 10:31:03 +0100
committerMartin Fischer <martin@push-f.com>2024-12-11 08:37:52 +0100
commit09dc1fefcf73dd3e57939105c22d050a65222211 (patch)
tree47489f7b7846e4f2c71ebf7bd565ddf5ba62dcb7 /link-user
parentb2bd12c7c0039c33b81e1e88b825e1606ee899e2 (diff)
add sway
The config is the default config copied from /etc/sway/config.
Diffstat (limited to 'link-user')
-rwxr-xr-xlink-user26
1 files changed, 26 insertions, 0 deletions
diff --git a/link-user b/link-user
new file mode 100755
index 0000000..2cef63d
--- /dev/null
+++ b/link-user
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+# Symlinks the files in user/ into my XDG_CONFIG_HOME.
+
+XDG_CONFIG_HOME=$HOME/.config
+
+cd $(dirname "$0") # change to the directory of the script
+cd user
+
+for dir in $(find . -type d); do
+ homedir="$XDG_CONFIG_HOME/$dir"
+ if [ ! -d $homedir ]; then
+ mkdir "$homedir"
+ fi
+ if [ -L $homedir ]; then
+ rm "$homedir"
+ mkdir "$homedir"
+ fi
+done
+
+for file in $(find . -type f); do
+ homefile="$XDG_CONFIG_HOME/$file"
+ if [ -L $homefile ]; then
+ rm "$homefile"
+ fi
+ ln -s "$PWD/$file" "$homefile"
+done