Heyrc
From Support
Contents |
[edit]
.heyrc
The .heyrc is a configuration file that tells hey how to behave. It is stored in your home directory and is generally hidden unless you do an ls -a
[edit]
Behaviour of hey
The .heyrc controls things like the colour of your hey message, whether the text is right, left or centre aligned and what signature comes at the bottom of your messages. It can also add decoration to you messages and even personalise the messages depending on who the message is being sent to.
[edit]
Editing your .heyrc
Your .heyrc can be edited on Spoon using vim or pico. Alternatively, you can edit it with notepad in Windows, but be sure that you don't save it as .heyrc.txt!
[edit]
Sample .heyrc
The following is a specially prepared .heyrc which explains what everything in it does.
# -*- mode:default-generic; -*- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # How this file works # # Each statement (or command or option, whatever you want to call them) takes # one line (throughout this document, that is referred to as "on a line on its # own"). Each line has a keyword and then a space and then the option or # options related to that keyword. # Example: # alias michael haster # sayhey no # # If one of the options following a keyword contains a space, or a character # that is not a number, letter or - it must be surrounded by inverted commas # Example: # argv0 "blah blah blah" # topleft "/" # # Anyline that starts with # is a comment and will not be interpreted by hey. # This is used for the explanatory parts of the file (like this) and to # temporarily turn off certain options. # # There are some options which are either on or off. To say whether they are # on or off, simply follow the keyword with on or off (and in certain cases, # yes or no; these cases are noted in the relevant section). # # This is a fully functioning file. Feel free to copy it to your home # directory and edit it to your own needs. It has some options enabled, just # so that your heys are a little more interesting. # # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # Decoration: # This section defines the decorative box around your messages. There are # 8 lines used to do this, one for each corner of the box and one for each # side. The traditional box is laid out below and looks like this: # # irokie sez: # Hey, irokie # /------------------------------\ # ) This is the traditional box. ( # \------------------------------/ # # If you want to change this, just replace the characters on the lines below # # The traditional box. topleft / top - topright \ left ) right ( bottomleft \ bottom - bottomright / # # If you don't want a decorative box around your messages, either set all of # those lines to space, or add the the word 'nodecorate' on a line on its own. # # You can change the colour of individual elements of your box as well. Add the # line 'colour <element> <colour>' and replace <element> with one of the # following: topleft, top, topright, left, right, bottomleft, bottom or # bottomright. Then replace colour with one of these: black, white, red, blue, # cyan, magenta, yellow or green. # For example, to make the right side of your box green, you'd add the line #colour right green # # You can also control how your heys are aligned by replacing the word 'off' # with the word 'on'. Be careful not to turn two on at once, as this could # stop hey from working correctly. The default is for your heys to be centre- # aligned. centrealign off leftalign off rightalign off # # This line controls whether or not hey prints the first line, which looks like # this: # Hey, irokie # # 'sayhey' on a line on its own means that hey will print that line, and # 'sayhey off' on a line on its own means that hey will not print the line. # sayhey on # # When you send a hey, there is a line at the top of the message saying who the # is from. Like this: # # Message from irokie (unknown tty) at 17:23:18 2006 # Hey, hamster # # That's controlled by this line right here. anything that comes after the word # from will be who the message is from. Try to keep this short, otherwise it # just looks silly. # #from irokie # # You can of course change the colour of your messages. To do this, just add # the line 'colour text <colour>' on its own and replace <colour> with the # colour that you want your messages to be. There are only certain colours # available, and these are: cyan, blue, green, yellow, red, magenta, white and # black (altho seeing as how most people use a black terminal, I'd recommend # against using black. Your text is white by default # # You can choose to turn off all formatting on your messages. To do this, # simply add the word 'noformat' in a line on its own. # # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # Aliases: # Aliases allow you to use shortcuts instead of your friends' usernames. # For example, if you put 'alias niall irokie' on a line on its own, then # instead of typing 'hey irokie' you can type 'hey niall' and hey will then # send the message to irokie. # This is useful if you have friends with usernames which are awkward to type. # #alias niall irokie # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # Signatures (sigs) # Hey can automagically add a 'signature' at the end of each message. It # appears on a line on its own just below the message. # Hey, Niall Feeney # # /----------------------\ # ) This is the message. ( # \----------------------/ # This is a signature. # # To add a signature to your message, simply enter a line of text with the word # 'ending' at the beginning. Everything on that line after the word ending # will be printed as your signature. There is an example below: # #ending "This is a signature." # # Keep your signatures under 80 characters (letters, spaces and punctuation # included, otherwise hey has difficulty formatting it. # # Hey can also add your username at the end of the message instead of a # signature. Just add the word 'endingname' on a line on its own. This will # not work if you've got a signature already defined. endingname # # Random Signatures # This is where the fun begins. Hey can allow you specify a file full of # possible signatures and everytime you send a message, it will randomly select # one of these and automagically attach it to you message. People have had # "sigfiles" with up to 400 quotes from songs, stupid things friends have said, # jokes and anything else they've been able to think of. The record, to the # best of your author's knowledge, belongs to ivan with 820. # # To set this up for yourself, there are 3 steps. # 1) Create a sigfile. # This is just a file with lines of text in it. Doesn't have to have a fancy # name or anything. The only thing you need to do is make sure that each # line is less that 80 characters long or your signature won't display # properly. # (Also, if you have an empty line in your sigfile, it can occassionally # cause hey to not work.) # 2) Turn off any signature you may already have. # Just make sure that you don't have a signature already defined. # 3) Add the following 3 lines to this file, each on a line on their own: # # randomending # randomfile INSERT THE LOCATION OF YOUR SIGFILE HERE. # ending randomending # # Note, where it says INSERT THE LOCATION OF YOUR SIGFILE HERE, it's looking # for a fully qualified file path; that is: # /home/<username>/<sigfile> as opposed to ~/sigfile # For example, my line reads 'randomfile /home/irokie/sigfile' # This can get a bit tricky, especially if you're new to using the command line # so if you're having problems, feel free to ask someone. Use hey! :) # # If you are using random signatu you might like to know what signature is # going on a particular message; maybe you want to show off a new one, maybe # you can use it in a joke, maybe you don't want to send a particular person # a message with an offensive signature. For whatever reason, you can make # hey print the sig before you even write the message. It looks like this: # # [ Ending is "Got to be a joker, he just do what he please." ] # [ recipients : irokie ] # # To turn this option on, add the word 'sayending' on a line on its own. I # recommend turning this one, if only for your own amusement. # # Just like with your text, you can change the colour of your signatures, # the same as you can your text, using the line 'colour sig <colour>', replaing # <colour> with one of the following: black, white, red, blue, green, cyan, # magenta or yellow. # # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # More Advanced Features of Hey # # If you wish to customise hey just a little bit more, this is where you can do # just that. # # Above, the sayhey command was described. It's the line that decides whether # or not hey prints this line: # # Hey, Niall Feeney # # /----------------------\ # # Hey provides the facility to set a specific message to follow the word 'Hey' # in this line, depending on who you are heying. It works like this: #expand username message # For example, if the following line were in your .heyrc: # # expand irokie YOU Franmed Roger Rabbit! # # then the message would read # # Hey, YOU Framed Roger Rabbit! # # /----------------------\ # # You can have as many or as few of these set up. If you do not have one set # up for a specific user, then it will use their full name. If you have sayhey # set to no, then this line will have no effect. # # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # Messages # Hey is set up to tell you a few things evey time you send a message. Like # this: # # [ recipients: hamster ] # Hello! # . # [ hey hamster--okay. ] # # If for some reason, you don't want to see these messages, just include the # word 'bequiet' on a line on its own. Not that if you are using random # signatures and you have the 'sayending' option turned on, 'bequiet' has no # effect on that. # # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # argv0 # This command changes how hey represents itself to the system. It doesn't # affect the operation of hey, but it will change what shows up when someone # runs 'w' and you are sending a message with hey. # # irokie@spoon:~$ w # 13:24:07 up 29 days, 13:38, 40 users, load average: 0.02, 0.22, 0.15 # USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT # irokie pts/59 matrix:S.0 13:23 3.00s 0.00s 0.00s hey hamster # # That's what would usually show up if someone ran 'w' while you were running # hey. However, if you include the argv0 command, you can change what appears # in the WHAT column. For example, the line: # argv0 "heying" # # shows up as: # # irokie@spoon:~$ w # 13:46:16 up 29 days, 14:00, 34 users, load average: 0.03, 0.06, 0.07 # USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT # irokie pts/59 matrix:S.0 13:23 5.00s 0.00s 0.00s heying hamster # # Whatever it is that you want to show up in the WHAT column, put that in # inverted commas following the argv0 command. # # NOTE: this does not change how you run hey, just how hey looks to others. # You still run hey by typing 'hey <username>' # # Tech note: argv0 works by modifying argv[0] (surprisingly enough). It uses # a sprintf, so don't make the line too long or hey will crash every time you # start up. Too long ~= 400 characters... # # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # verb # The 'verb' option is like the argv0 command, but it's customisable for each # person you hey. For example: # #verb hamster "talking music" # # shows up as: # # irokie@spoon:~$ w # 14:09:55 up 29 days, 14:23, 36 users, load average: 0.01, 0.00, 0.00 # USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT # irokie pts/59 matrix:S.0 13:23 2.00s 0.00s 0.00s talking music # # You can have as many of these as you like for as many different users as you # want. This has a higher precedence than argv0, so if you have somethign set # for argv0, that will be the default, but if you have a 'verb' set for a # certain person, then that will be used instead. # # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # This sample .heyrc was written by irokie, based on the old global heyrc # which was written (I think) by kehoea, who was (again, I think) one of the # original autors of hey. Any questions about this file, just hey irokie.
irokie 02:32, 12 January 2006 (GMT)
