dotfiles/.config/shell/bin/copy-path

12 lines
228 B
Bash
Executable file

#!/bin/sh
# copies the passed arguments to the clipboard
CLIPBOARD_MANAGER="${CLIPBOARD_MANAGER:-xsel -b}"
if [ $# -eq 0 ]; then
set -- "$(pwd)"
fi
for f; do
realpath "$f"
done | sed -z '$ s/\n$//' | $CLIPBOARD_MANAGER