On Thu, 17 Mar 2011, Benjamin R. Haskell wrote:
> On Thu, 17 Mar 2011, Le Tian wrote:
>
>> Hi again, I'm trying to find out how to make a custom status bar in wmii. I
>> have found "status()" lines in /home/wmii.rc file(hmmm what is it doing
>> here?!)
>
> Maybe your '$HOME' env var was unset or improperly set at some point?
>
>
>> these is what I found:
>> status() {
>> Action status
>> if wmiir remove /rbar/status 2>/dev/null; then
>> echo "$WMII_NORMCOLORS" | wmiir create /rbar/status
>> while status | wmiir write /rbar/status; do
>> Action status &
>>
>> I can barely understand it.
>
> Posting a 'grep' without context is pretty worthless. The only section you
> should care about is the part starting at 'status() {'.
>
>
>> So if anyone had an experience in setting up his custom bar, could you
>> please tip me how to do it, cause I don't know where to look else.
>
> Look in the actual file, not the grep, and you should see something like:
>
> # Status Bar Info
> status() {
> echo -n $(uptime | sed 's/.*://; s/,//g') '|' $(date)
> }
>
> (I think that's the default for some version or another...)
>
> The point is that whatever's in the function is what gets run each time the
> status is updated.
>
> If the custom script you mentioned in the first post is called do-the-thing,
> and it's in your $PATH and executable, just change those four lines to:
>
> # Status Bar Info
> status() {
> do-the-thing
> }
>
> --
> Best,
> Ben
Tian,
Here is a copy of my wmiirc_local including the status bar detail (the
variables at the top refer to key-bindings I set in the main wmiirc so that
all users get access to them and can customise the apps they use, I also
have autocutsel launch when I login so that parcellite and the term
clipboards are kept in sync
#------------------------------------------------------------------------
MODKEY=Mod4
WEB_BROWSER=jumanji
IRC_CLIENT="uxterm-256color" -e weechat-curses
EMAIL_CLIENT="uxterm-256color" -e alpine
#IRC_CLIENT="xterm +bdc -ai -vb +dc -bg black -fg green -e weechat-curses"
#EMAIL_CLIENT="xterm +bdc -ai -vb +dc -bg black -fg green -e alpine"
eval volti &
eval net_applet &
eval parcellite &
# Personised Colour
export WMII_NORMCOLORS='#bbc5ff #010101 #285577'
export WMII_FOCUSCOLORS='#a0ff00 #010101 #000000'
export WMII_BACKGROUND='#000000'
#export WMII_BACKGROUND='#010101'
#export WMII_FONT='-*-Sans-medium-r-*-*-9-*-*-*-*-*-*-*'
export WMII_FONT='-*-liberation sans-medium-r-*-*-10-*-*-*-*-*-iso10646-*'
export WMII_TERM="uxterm -bg black -fg green"
#export WMII_TERM=st
# Status Bar Info for thinkpad
status() {
echo -n label ' Wlan0:' $(/sbin/iwconfig wlan0 | sed 's/ /\n/g' | grep
Quality) 'IP:' $(/sbin/ifconfig wlan0 | grep 'inet addr' | sed 's/\s*inet
addr://' | sed 's/ .*$//') '|' 'Bat:' $(acpi -b | sed 's/\s*Battery
0:\s*[a-zA-Z]*, //' | sed 's/,.*$//')' |' ' CPU:' $(cat /proc/cpuinfo |
grep 'cpu MHz' | sed 's/.*: //g; s/\..*//g;')'MHz ''Temp:'$(awk '{print
$2}' /proc/acpi/ibm/thermal)C' | ''Vol:' $(aumix-text -q | grep vol |
sed 's/vol [0-9]*, //' | sed 's/, P//')' | ' $(date +"%A %d %B %H:%M ")
}
#--------------------------------------------------------------------------
Which looks like this:
http://postimage.org/image/2o9ibfu5g/
I hope this helps you out.
Jase
Received on Fri Mar 18 2011 - 06:13:48 CET
This archive was generated by hypermail 2.2.0 : Fri Mar 18 2011 - 00:24:04 CET