- First, Catch your sigs. Best Sigs (or “tags”) are either random lines that make just as much sense in context as they do out of it, Famous quotes from infamous people, or lines you stole off a website somewhere.
- Prepare text files.
The quotes need to be seperated by % signs, which is a bugger if you’re using ones that are one line per quote. Personally, I’ve got a shell script like this:
#!/bin/bash read FOO while [ "$FOO" ] do echo -e "$FOOn%" read FOO done
which I can call with “
cat $file | fortunate > ~/.sigmonster/$file“.
Note I’ve put all my sig files in a directory all of their own, this makes life easier. Then we have to make databases of them. There is a util called “strfile” which comes with fortune (which we will be using in a sec) that does this. Make databases of all files (
for FILE in ~/.sigmonster/*;do strfile $FILE;done).
- Fortune favours the brave
Now we get fortune to randomly pick a line from any one of those files and display it. Like this: fortune ~/.sigmonster/ (Thoughout this, I’ve used ~/.sigmonster for the directory where I put the files. This is up to you, obviously). If this didn’t work (“fortune:/ not a fortune file or directory“) then something is wrong in step 2
- Set your sig
The first line of your signature will be read from ~/.signature, so I’d recommend putting something in there, probably the stuff you want to remain consistant across sigs. If you don’t want anything to be consistant, make an empty file.
- Live and Slrn
(Yes, these titles are getting worse). In your ~/.slrnrc file, you may have a line saying “set editor_command "vim +'set wm=72' +'set noai' +%d '%s'" or similer.
If so, comment it out (prefix it with “%”) andput in the following:
set editor_command "FILE='%s';vim +'set wm=72' +'set noai' +%d $FILE;cat .signature >> $FILE; /usr/games/fortune ~/.sigmonster/ >> $FILE"
If you’re feeling brave, you can merge your existing line with the new one, but I’d try mine first if I were you 🙂
- The Explaination
The editor_command declaration specifies what slrn is to do in the event of something needing to be edited – a message, for example. What I did there was replace the command with a script that edits the file, tacks a sig onto the end of it and sends it back to slrn for posting. The downsides of that script are that you don’t see the sig before posting. That’s because my setup has an auto-post formatter that makes my attributions right, but screws up my sig something chronic, so I have to add the sig afterwards. You could do it the other way around (tack on the sig then do the editing) by having this editor_command instead:
set editor_command "FILE='%s';cat .signature >> $FILE; /usr/games/fortune ~/.sigmonster/ >> $FILE";vim +'set wm=72' +'set noai' +%d $FILE