aboutsummaryrefslogtreecommitdiffstats
path: root/apps/rellink
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2024-02-17 09:57:59 +0100
committerMattias Andrée <maandree@kth.se>2024-02-17 09:57:59 +0100
commitca5d7551235aac0df995ab8d67d0e473a2162abc (patch)
tree8729a14e2a8e9629bf192ae18941c5563933f347 /apps/rellink
parentSome new icons and aliases (diff)
downloadsimple-icon-theme-ca5d7551235aac0df995ab8d67d0e473a2162abc.tar.gz
simple-icon-theme-ca5d7551235aac0df995ab8d67d0e473a2162abc.tar.bz2
simple-icon-theme-ca5d7551235aac0df995ab8d67d0e473a2162abc.tar.xz
New icons, more icons linked into claws-mail theme, and installation of claws-mail theme
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'apps/rellink')
-rwxr-xr-xapps/rellink30
1 files changed, 30 insertions, 0 deletions
diff --git a/apps/rellink b/apps/rellink
new file mode 100755
index 0000000..2981f3f
--- /dev/null
+++ b/apps/rellink
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+set -e
+
+test $# = 2 || test $# = 3
+
+target="$1"
+link="$2"
+destdir="$3"
+
+test $(printf '%s\n' "$target" "$link" | grep '^/' | wc -l) = 2
+
+T="$target"
+L="$link"
+while test $(printf '%s\n' "$T" "$L" | grep / | wc -l) = 2; do
+ Td="$(printf '%s\n' "$T" | cut -d / -f 1)"
+ Ld="$(printf '%s\n' "$L" | cut -d / -f 1)"
+ if test ! "$Td" = "$Ld"; then
+ break
+ fi
+ T="$(printf '%s\n' "$T" | cut -d / -f 2-)"
+ L="$(printf '%s\n' "$L" | cut -d / -f 2-)"
+done
+while printf '%s\n' "$L" | grep / > /dev/null; do
+ T="$(printf '../%s\n' "$T")"
+ L="$(printf '%s\n' "$L" | cut -d / -f 2-)"
+done
+target="$T"
+
+ln -s -- "$target" "$destdir$link"