]> sipb.mit.edu Git - wiki.git/blob - doc/barnowl_random_zsigs.mdwn
Update zwrite -C option
[wiki.git] / doc / barnowl_random_zsigs.mdwn
1 [[!meta title="Random Zsigs for BarnOwl"]]
2
3 ## Random Zsigs for BarnOwl
4
5 Note: There's a lot of background information in here which can be bypassed.
6
7 First off, if you haven't already, take a look at BarnOwl's internal documentation. Try the following two commands.
8         
9         :help
10         :show quickstart
11         
12 (Also viewable outside of BarnOwl, in the form of messier-to-read source code, at [/help.c - BarnOwl - Trac](http://barnowl.mit.edu/browser/help.c) and the "intro" file at [/docs/intro.txt - BarnOwl - Trac](http://barnowl.mit.edu/browser/doc/intro.txt),
13
14 ### Intro to Zsigs
15 A "zsig" appears after your username (your Athena account name) in Zephyr (see [[Using Zephyr (a.k.a. Zephyr for Dummies)|doc/zephyr]] if you don't know what Zephyr is).
16
17 By default, if your name is Jane Lillian Doe, your zsig is `(Jane L Doe)`. For instance, if you're on Zephyr, you might see
18
19         2013 / personal / jdoe  22:16  (Jane L Doe)
20                 ...hey I'm talking here.
21                 
22 Most people keep it that way, since people may not immediately know who you are by your username. Some people opt to remove the middle initial or leave it at an interesting quote. To do so, in BarnOwl simply type in
23
24         :set zsig  "This is a very interestin' quote."
25         
26 (BarnOwl accepts either single or double quotes to enclose your zsig, allowing you to use the other type of quote inside your zsig. Experiment, BarnOwl tells you what it interpreted your command as by showing as confirmation
27
28         zsig = 'This is a very interestin' quote.'      
29
30 ### Random Zsig Generator
31 But what if you want to set up a random zsig generator?
32
33 **Deprecated: BarnOwl now has better built-in support for zsig randomization than it did when this page was written. Rather than reading the rest of this page, you may want to read `show variable zsigfunc`, and look at `random_zephyr_signature`.**
34
35 In outline, we use some bash magic that prints a zsig out to `stdout`, then set up BarnOwl to run that bit of bash magic. BarnOwl has something already which will automagically take that `stdout` and pipe it into your zsig.
36
37 #### Steps Outside of BarnOwl: Creating the zsigs file
38 Connect to Athena if you haven't already.
39
40 1. Create a file of zsigs. In this article we'll call the file `.zsigs`
41
42 2. Put zsigs in the file, separated by newlines
43         
44                 a zsig
45                 random zsig2
46                 random234
47
48 3. If you want to, test the bit of bash magic we'll be using
49
50                 kusername@dr-wily:~$ shuf -n1 ~/.zsigs
51                 random zsig2
52         
53         The second line should be one of the zsigs from your list. Run it multiple times if you want to check for randomness.
54
55 #### Setting Up BarnOwl: Using the zsigproc variable
56 ##### Background
57 Open up BarnOwl now.
58         
59         kusername@dr-wily:~$ add barnowl; barnowl
60
61 Using the command `:show variables` inside of BarnOwl we see descriptions of the variables of interest to us:
62         
63         zsig - zephyr signature (default: '')
64         zsigproc - name of a program to run that will generate zsigs (default: '<null>')     
65
66 To get more detailed descriptions we can use, respectively
67
68         :show variable zsig
69         :show variable zsigproc
70
71 We will also use the `:startup` command, which is described in
72
73         :help startup
74         
75 ##### The Steps
76
77 1. Use the `:startup` command in BarnOwl to write to the "~/.owl/startup" file (or wherever you decided to put the your startup settings file for BarnOwl). (Alternatively, edit the "~/.owl/startup" file directly). As mentioned in the detailed documentation, the variable `zsig` takes precedence over `zsigproc`. Make sure that `zsig` is empty. Then set `zsigproc` to run our bit of bash magic.
78
79                 :startup set zsig ''
80                 :startup set zsigproc 'shuf -n1 ~/.zsigs'
81         
82 2. Force BarnOwl to reload the startup configuration file
83
84                 :source "~/.owl/startup"
85                 
86 3. Optional: Check that the correct startup file is loaded
87
88                 :show startup
89                 
90 Now you have random zsigs.