]> sipb.mit.edu Git - wiki.git/blob - doc/barnowl_random_zsigs.mdwn
Link to barnowl.mit.edu instead of barnowl.scripts.mit.edu:444
[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 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.
34
35 #### Steps Outside of Barnowl: Creating the zsigs file
36 Connect to Athena if you haven't already.
37
38 1. Create a file of zsigs. In this article we'll call the file `.zsigs`
39
40 2. Put zsigs in the file, separated by newlines
41         
42                 a zsig
43                 random zsig2
44                 random234
45
46 3. If you want to, test the bit of bash magic we'll be using
47
48                 kusername@dr-wily:~$ shuf -n1 ~/.zsigs
49                 random zsig2
50         
51         The second line should be one of the zsigs from your list. Run it multiple times if you want to check for randomness.
52
53 #### Setting Up Barnowl: Using the zsigproc variable
54 ##### Background
55 Open up Barnowl now.
56         
57         kusername@dr-wily:~$ add barnowl; barnowl
58
59 Using the command `:show variables` inside of Barnowl we see descriptions of the variables of interest to us:
60         
61         zsig - zephyr signature (default: '')
62         zsigproc - name of a program to run that will generate zsigs (default: '<null>')     
63
64 To get more detailed descriptions we can use, respectively
65
66         :show variable zsig
67         :show variable zsigproc
68
69 We will also use the `:startup` command, which is described in
70
71         :help startup
72         
73 ##### The Steps
74
75 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.
76
77                 :startup set zsig ''
78                 :startup set zsigproc 'shuf -n1 ~/.zsigs'
79         
80 2. Force Barnowl to reload the startup configuration file
81
82                 :source "~/.owl/startup"
83                 
84 3. Optional: Check that the correct startup file is loaded
85
86                 :show startup
87                 
88 Now you have random zsigs.