screen-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: backtick & hardstatus


From: Will Maier
Subject: Re: backtick & hardstatus
Date: Wed, 28 Sep 2005 08:19:03 -0500
User-agent: Mutt/1.5.6+20040907i

On Wed, Sep 28, 2005 at 11:51:23AM +0200, Thomas Baruchel wrote:
> I set backtick to 1 0 0 rathen than 1 60 1 as explained in another
> Since I like rather the "message" format than the "lastline" (which makes
> less place for applications). It works, but...

I can't think of a screenish way to do what you're talking about.
If you use zsh as your shell, consider using the periodic ()
function to execute your program. In your checkmail program, include
a bell (^G, I think) in its output. That will cause screen to
display bell_msg, which you could configure to say 'You've got mail'
or similar.

IIUC, this could only be used to alert you to the presence of new
mail (assuming checkmail produces output only when it sees mail).

> the behaviour of the message is poor : when my process writes something,
> I have a message whatever I am doing (wich is what I want), but it seems
> I have also the message (probable the "last message" when I switch from
> a windows to another, when I open a new window, etc.). What I would like
> is my message appearing 5 or 10 sec. then disappearing (I have that now)
> but no message at all when I open a new window, switch from one to another,
> etc. Now, once a message has appeared for the first time, I have it repeated
> absolutely in every circumstances (except if I do nothing related to 
> 'screen').

Could checkmail instead be a script which didn't loop, but instead
simply checked your mailbox? Then, using screen, you could run the
script every few minutes. I do a similar thing in my hardstatus with
regard to my laptop's battery; it's a simple script that polls ACPI
and, if the value of the parsed ACPI data is < 98, displays the
percentage left on the battery. If it's greater than 98, nothing is
displayed. Each time the backtick is run, if it produces output (ie,
if you have new mail), it can display that, otherwise it displays
nothing.

To do this, use the conditional braces screen provides:
    
    hardstatus alwaysmessage %?[%1`]%?

I include the square brackets only for visual clarity -- they are
syntactically unnecessary.

-- 

[Will address@hidden/address@hidden





reply via email to

[Prev in Thread] Current Thread [Next in Thread]