#!/bin/zsh for i in *(/); do if [[ -h ${i:a}/supervise ]]; then continue elif [[ -d ${i:a}/supervise ]]; then echo "Warning: ${i:a}/supervise is a directory, not a symlink" else echo creating ${i:a}/supervise ln -s ${XDG_RUNTIME_DIR:-/run/user/$UID}/supervise.${i:t} ${i:a}/supervise fi done for i in */log(/); do if [[ -h ${i:a}/supervise ]]; then continue elif [[ -d ${i:a}/supervise ]]; then echo "Warning: ${i:a}/supervise is a directory, not a symlink" else ln -s ${XDG_RUNTIME_DIR:-/run/user/$UID}/supervise.${i:h:t}-log ${i:a}/supervise fi done