From 251a4bf20906a92c0ecfe16e024e1382c049a431 Mon Sep 17 00:00:00 2001 From: Siina Mashek Date: Tue, 22 Dec 2020 06:11:00 +0200 Subject: [PATCH] Migrating to hostname-based linker --- {bin => common}/boop.sh | 0 {bin => common}/extip | 0 {bin => common}/mobile | 0 {bin => common}/scrot.sh | 0 {bin => common}/vpn | 0 link.sh | 10 ++++++++-- {bin => remedios}/capturecard | 0 7 files changed, 8 insertions(+), 2 deletions(-) rename {bin => common}/boop.sh (100%) rename {bin => common}/extip (100%) rename {bin => common}/mobile (100%) rename {bin => common}/scrot.sh (100%) rename {bin => common}/vpn (100%) rename {bin => remedios}/capturecard (100%) diff --git a/bin/boop.sh b/common/boop.sh similarity index 100% rename from bin/boop.sh rename to common/boop.sh diff --git a/bin/extip b/common/extip similarity index 100% rename from bin/extip rename to common/extip diff --git a/bin/mobile b/common/mobile similarity index 100% rename from bin/mobile rename to common/mobile diff --git a/bin/scrot.sh b/common/scrot.sh similarity index 100% rename from bin/scrot.sh rename to common/scrot.sh diff --git a/bin/vpn b/common/vpn similarity index 100% rename from bin/vpn rename to common/vpn diff --git a/link.sh b/link.sh index a0b491e..3fac106 100755 --- a/link.sh +++ b/link.sh @@ -1,6 +1,8 @@ #!/bin/sh -files=($(ls $PWD/bin)) +node=$(uname -n) +node_files=($(ls $PWD/$node)) +common_files=($(ls $PWD/common)) dest="$HOME/.local/bin" # Ensure destination exists @@ -8,6 +10,10 @@ if [ ! -d "$dest" ]; then mkdir -p "$dest" fi -for file in "${files[@]}"; do +for file in "${node_files[@]}"; do + ln -sf "$PWD/bin/$file" "$dest" +done + +for file in "${common_files[@]}"; do ln -sf "$PWD/bin/$file" "$dest" done diff --git a/bin/capturecard b/remedios/capturecard similarity index 100% rename from bin/capturecard rename to remedios/capturecard