nix-configs/scripts/desktop/permaclip/pc-set.sh

17 lines
394 B
Bash
Raw Normal View History

2022-09-12 17:07:23 +02:00
# create ~/permaclip if it doesnt exist already
mkdir -p $HOME/permaclip
tr_name=$(echo $@ | xargs)
if [ x"$tr_name" != x"" ]; then
2022-09-12 17:16:26 +02:00
tr_name="${tr_name% (*}"
2022-09-12 17:07:23 +02:00
clipdata=$(xclip -selection c -o)
2022-11-01 18:18:56 +01:00
echo "$clipdata" > $HOME/permaclip/$tr_name
2022-09-12 17:07:23 +02:00
fi
echo -e "\0markup-rows\x1ftrue"
for reg in $(ls ~/permaclip); do
content=$(cat ~/permaclip/$reg)
2022-09-14 11:19:26 +02:00
echo -e "$reg (<i>${content:0:30}</i>)"
2022-09-12 17:07:23 +02:00
done