nix-configs/other/scripts/desktop/permaclip/pc-get.sh

16 lines
385 B
Bash
Raw Normal View History

2022-09-12 15:07:23 +00:00
# create ~/permaclip if it doesnt exist already
mkdir -p $HOME/permaclip
2022-09-12 15:16:26 +00:00
tr_name=$(echo ${@% (*} | xargs)
2022-09-12 15:07:23 +00:00
if [ x"$tr_name" != x"" ]; then
2022-09-14 09:19:26 +00:00
nohup bash -c "xclip -selection c -i $HOME/permaclip/${tr_name% (*}" > /dev/null
2022-09-12 15:07:23 +00:00
exit 0
fi
echo -e "\0markup-rows\x1ftrue"
for reg in $(ls ~/permaclip); do
content=$(cat ~/permaclip/$reg)
2022-09-14 09:19:26 +00:00
echo -e "$reg (<i>${content:0:50}...</i>)"
2022-09-12 15:07:23 +00:00
done