summaryrefslogtreecommitdiffstats
path: root/konversation/scripts/sayclip
blob: 06b82343477276588c0e49f6477fc1129cea3c6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

# Prints the contents of the clipbaord into Konversation with flood protection.
# Klipper must be running.
# Usage: /exec sayclip [pause-time]
# Pause time defaults to 1 second.
# By Gary Cramblitt (garycramblitt@comcast.net)
# Use however you wish.

PORT=$1;
SERVER=$2;
TARGET=$3;
PAUSETIME="1s";
if [ -n "$4" ]
then
  PAUSETIME="$4"
fi

dcop klipper klipper getClipboardContents | while read line; do dcop $PORT default say $SERVER "$TARGET" " $line"; sleep $PAUSETIME; done