screen-users
[Top][All Lists]
Advanced

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

Re: X cut and paste


From: Aaron Griffin
Subject: Re: X cut and paste
Date: Tue, 20 Sep 2005 11:09:58 -0500

On 9/20/05, Ajitabh Pandey <address@hidden> wrote:
> * Aaron Griffin <address@hidden> [2005-09-15 12:51:38 -0500]:
> >One feature I was thinking about a while back would be a multiline
> >hardstatus... I use the hardstatus line for *alot* of stuff... cpu
> >temp, battery levels, scaling freq, weather, and all that jazz -
> >basically I use it in the same way most people use
> 
> May I request you to share how you use hardstatus line to monitor all that.
> If you use any external programs, it would be good to know about them as
> well.

You can do it all with the backtick command... just note that the
backtick command will not work with pipes or redierction, so
complicated things must be thrown in a script.  For example, I use:

# backticks 1, 2, 4 and 5 omitted for example
backtick 3 5 5 $HOME/.screen/therminfo
hardstatus alwayslastline "%{+b kb}[%m.%d.%y %0C:%s%a]%{kw} %1` | %2`
| %3` | %{kc}%4`%{-} | %{ky}%5`%{-} "

NOTE: the undrawable characters below (before each {} set) are C-v,C-e
in vim (^E) - they are escape characters that work insides scripts the
same way % works in the hardstatus line.  It allows me to color temp
based on the value

#! /bin/bash
#therminfo
stat=` acpi -tBf | tr -s , \  | cut -d\  -f4 `
temp=` acpi -tBf | tr -s , \  | cut -d\  -f5 `

t=${temp%%.*}
color="{k.}"
if [ $t -ge 130 ]; then
    color="{ky}"
elif [ $t -ge 140 ]; then
    color="{kr}"
fi

echo "$color$stat:$temp{-}"

I have similar scripts for weather (which simply scrapes a website)
and net up/down statistics, but that one's a tad more complicated




reply via email to

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