Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: can zsh set background color?
- X-seq: zsh-users 8334
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: can zsh set background color?
- Date: Wed, 5 Jan 2005 01:29:27 -0800 (PST)
- In-reply-to: <200501050350.j053oUtq032633@xxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <200501050350.j053oUtq032633@xxxxxxxxxxxxxxxxxxxxx>
- Reply-to: zsh-users@xxxxxxxxxx
On Tue, 4 Jan 2005, Drew Perttula wrote:
> bgcolor=`hostname | md5sum | /usr/local/bin/python -c "c1=raw_input(); col=[int(c1[x:x+2],16) for x in 0,2,4]; print '#%02x%02x%02x'%tuple([40*x/max(col) for x in col])"`
Pipe to python? Why?
setbgcolor() {
local c1=$(hostname | md5sum) max x
local -a col
for x in 0 2 4; do col+=$[16#$c1[x+1,x+2]]; done
max=${${(On)col}[1]}
print -n "\x1b]49;#"
for x in $col; do printf %02x $[40*x/max]; done
print -n "\x07"
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author