[Lcdproc] Re: [Patch] Setting the exit message
Peter McCurdy
peter.mccurdy@gmail.com
Fri Mar 30 14:52:01 2007
------=_Part_63970_20600154.1175266257025
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
On 3/30/07, Peter McCurdy <peter.mccurdy@gmail.com> wrote:
> On 3/30/07, Peter McCurdy <peter.mccurdy@gmail.com> wrote:
> > Since it's not just me who finds it really useful to set the shutdown
> > message (see http://lists.omnipotent.net/pipermail/lcdproc/2007-March/011540.html
> > ), I figured I'd extract the relevant bit from
> > contrib/patches/lcdprocserverOPT.diff so it can get applied to the
> > main source tree.
> >
> > Attached is a patch that adds a [server]goodbye key, which controls
> > the message displayed on the LCD when LCDd exits. If the message is
> > longer than 16 or 20 characters (dependant on the size of your
> > screen), it will continue onto the second line. As a bonus compared
> > to contrib/patches/lcdprocserverOPT.diff, if your message is less than
> > 16/20 characters, the second line is blank instead of still displaying
> > the second line from the default message :) It also adds some
> > documentation to LCDd.conf.
> >
> > The patch is made against LCDproc 0.5.1. If it gets accepted, I'll
> > send a followup patch to remove this part from lcdprocserverOPT.diff.
>
> Oops, I accidentally sent in an old version of the patch. Here's the
> updated version (which actually will blank out the second line if your
> message is too short).
Third try's the charm. How about this time I send in a version that
actually uses the defaults if you don't set the key in the config
file, and that doesn't leak memory. Granted, the memory leak was only
on shutdown when it doesn't really matter, but it's worth being neat.
Since I feel like I'm losing some credibility here, I should say that
this time I tested the patch on my CF633 display (16x2) with the
config key unset, and then set to the strings that were 0, 15, 16, 17,
20, 21, 31, 32, and 41 characters long. That should cover all the
interesting sizes.
Looks like even if this patch doesn't get accepted to the main
distribution, I'll be sending a followup patch to fix all these
problems in the lcdprocserverOPT.diff code.
Thanks.
Peter.
------=_Part_63970_20600154.1175266257025
Content-Type: application/octet-stream;
name=custom-shutdown-message-v3.patch
Content-Transfer-Encoding: base64
X-Attachment-Id: f_ezwr0id3
Content-Disposition: attachment; filename="custom-shutdown-message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