gaim_add2dict
This script adds an "autocorrect" definition inside of a text file. The def will look like:
|
COMPLETE: 1 CASE: 0 BAD: misspelling GOOD: fixed_spelling |
This helps prevent typos in Gaim. If you want to access the script from directly within gaim, you can use the gaim-slashexec plugin (this is the src tarball; the guifications site is down) and just use the /exec command from inside gaim.
BASH:
-
#!/bin/bash
-
# will add a def to dict file (for gaim autocorrect)
-
PROGN=gaim_add2dict
-
# script takes 2 args, BAD word followed by GOOD word
-
# where is your dict?
-
GAIM_DICT_FILE=/path/to/my/dict/file
-
-
if [ $# -ne 2 ]; then
-
echo "error: $PROGN: I need 2 args, please..."
-
exit 1
-
else #exactly 2 args
-
BADWORD=$1
-
GOODWORD=$2
-
BAD_EXISTS_TEST=`grep -cx "BAD $BADWORD" $GAIM_DICT_FILE` # 1 if line exists
-
if [ $BAD_EXISTS_TEST -ne 0 ]; then
-
echo "error: $PROGN: BAD $BADWORD already exists in $GAIM_DICT_FILE"
-
exit 1
-
fi
-
echo -e "\nCOMPLETE 1\nCASE 0\nBAD $BADWORD\nGOOD $GOODWORD\n" | cat ->> $GAIM_DICT_FILE && echo 'the definition has been added (does this message make it thru?'
-
fi
-
exit 0
1 comment January 5th, 2007