Next: Narcissistic ponies, Previous: Running on screen, Up: Advanced usage [Contents][Index]
If you have the file ~/.ponysayrc (.ponysayrc in your home directory,
the home directory can be spoofed by changing the system environment HOME
,)
the first thing ponysay
does is running that file. This can be used for
modifing environment variables (see Environment variables). For your convience
this can be done by modifing the map env
. The code in ~/.ponysayrc must
be written in Python 3.
For example if you want to set the PONYSAY_SHELL_LINES
to 5, but only 1 if you
are using Linux VT (TTY), your ~/.ponysayrc may look like this:
if env[TERM] == 'linux': env[PONYSAY_SHELL_LINES] = 1 else: env[PONYSAY_SHELL_LINES] = 5 |
You can examine the source code of ponysay
to figure out some nice hacking
you may want to do, everything in the source code can be used directly as long as it
is defined before ~/.ponysayrc is interpreted.
~/.ponysayrc is a fallback for ~/.config/ponysay/ponysayrc, which in turn is a fallback for ${XDG_CONFIG_HOME}/ponysay/ponysayrc. If neither of those exist, /etc/ponysayrc is used if that exists.