dotfiles/scripts/copy2clipboard
2022-03-01 18:32:55 +03:00

16 lines
292 B
Bash
Executable File

#!/bin/bash
if [ -z "$1" ]
then
file=$(find . -maxdepth 1 -type f | cut -c 3- | rofi -i -dmenu -p "Select file to copy its contents")
else
file=$1
fi
if [ -z "$file" ]; then
exit
fi
cat $file | xclip -selection c
notify-send "Contents of the '$file' is copied to clipboard!"