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

13 lines
228 B
Text
Raw Permalink Normal View History

#!/bin/sh
# copies the passed arguments to the clipboard
CLIPBOARD_MANAGER="${CLIPBOARD_MANAGER:-xsel -b}"
2024-09-08 19:56:59 -07:00
if [ $# -eq 0 ]; then
set -- "$(pwd)"
fi
for f; do
realpath "$f"
2024-05-31 01:07:26 -07:00
done | sed -z '$ s/\n$//' | $CLIPBOARD_MANAGER