mirror of
https://github.com/sahinakkaya/dotfiles.git
synced 2024-11-24 17:39:37 +01:00
22 lines
375 B
Bash
Executable File
22 lines
375 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ -z "$1" ]
|
|
then
|
|
files=( $(find . -maxdepth 1 -type f | cut -c 3- | rofi -i -dmenu -p "Select a file to copy") )
|
|
else
|
|
files=("$@")
|
|
fi
|
|
|
|
|
|
if [ -z "$files" ]; then
|
|
exit
|
|
fi
|
|
|
|
args=()
|
|
for arg in "${files[@]}"; do
|
|
fullpath=$(readlink -f $arg)
|
|
args+=("file://$fullpath")
|
|
done
|
|
|
|
printf '%s\n' "${args[@]}" | xclip -i -sel clipboard -t text/uri-list
|