A scripts/sayclip [License: UNKNOWN] commit dd366010d4bc097e48eb29d055fddc6b9b71c4a0 Author: Gary Cramblitt Date: Sat Jun 26 15:07:20 2004 +0000 Add sayclip script for printing contents of clipboard to current channel with flood protection. svn path=/trunk/kdeextragear-2/konversation/; revision=323808 diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 6c342bf..e091bdd 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -1,4 +1,4 @@ scriptsdir=$(kde_datadir)/konversation/scripts -scripts_SCRIPTS=amarok bug fortune gauge juk noatun uptime kdeversion cmd +scripts_SCRIPTS=amarok bug fortune gauge juk noatun uptime kdeversion cmd sayclip scripts_DATA=fortunes.dat diff --git a/scripts/README b/scripts/README index c17f7af..b20176b 100644 --- a/scripts/README +++ b/scripts/README @@ -38,3 +38,7 @@ kdeversion Displays the Qt/KDE version. cmd Prints the output of a given command. usage: /exec cmd command +sayclip Prints the contents of the clipboard on the current channel + with flood protection. Klipper must be running. + usage: /exec sayclip [pause-time] + diff --git a/scripts/sayclip b/scripts/sayclip new file mode 100755 index 0000000..68c5ff8 --- /dev/null +++ b/scripts/sayclip @@ -0,0 +1,19 @@ +#!/bin/bash + +# 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 Konversation say $SERVER "$TARGET" " $line"; sleep $PAUSETIME; done