You are not logged in.
today, a colleague showed me this dvd:
http://www.thinkgeek.com/gadgets/lights/7427/
it's mainly a cycling trough the colour palette
what's the shortest script to do the same (written in a language that has a wrapper/bindings to xlibs) ... anyone?
The impossible missions are the only ones which succeed.
Offline
you could write a shell script that cycles through the colours and passes each of them to xsetroot or bsetroot.
Offline
Like this:
#!/bin/sh
step=7;
r=0; b=0; g=0;
while true; do
while [ $r -le 256 ]; do
while [ $g -le 256 ]; do
while [ $b -le 256 ]; do
c=`printf "rgb:%x/%x/%x" $r $g $b`;
xsetroot -solid $c;
b=$(( $b + $step ));
done
g=$(( $g + $step ));
b=0;
done
r=$(( $r + $step ));
g=0;
done
r=0;
done
Offline
Hmm.. why do I have the feeling a TV doesn't come with fans...
Later edit: I've added a "sleep 0.01" in the 3rd level for and.. after some seconds of running... the computer rebooted... twilight zone... can't find a good reason for this. The sleep period was probably a bit too short... anyway... weird.
:: / my web presence
Offline
cool! i totally forgot about xsetroot ;-)
The impossible missions are the only ones which succeed.
Offline
i3839, nice codelet ... only the flickering is not so nice ... we need to keep the sum of r+g+b gradient or constant to have a nice smooth change of colour
does bash support trigonometry functions? (sinus cosinus)
The impossible missions are the only ones which succeed.
Offline
Of course it doesn't, don't be silly. It doesn't even support floating points (or I'd used the 'rgbi:' syntax instead).
Offline
for something like that... if you're serious about this - just tear apart xsetroot and double (triple? overkill...) buffer it... shouldn't be hard....
Offline
This would be sweet to have. I'd totally use it instead of a screensaver. Or maybe it could be coded as a screen saver? O.O
·¬»· i am shadowhand, powered by webfaction
Offline
I use my keyboard attached to the server as an addtional source of blue light :-) (it's a vivanco keyboard with nice blue backlight).
Offline
More tools for color cycling (and not only) :-)
http://www.x.org/contrib/applications/xcycle.README
http://www.jwz.org/xdaliclock/
http://www.gweep.net/~jer/xtacy.html
Offline
doing it with aalib could be fun, there are a few small example programs with it like colored ascii flames. It would probably be pretty easy to make short colored ascii animations.
Offline
Like this:
#!/bin/sh step=7; r=0; b=0; g=0; while true; do while [ $r -le 256 ]; do while [ $g -le 256 ]; do while [ $b -le 256 ]; do c=`printf "rgb:%x/%x/%x" $r $g $b`; xsetroot -solid $c; b=$(( $b + $step )); done g=$(( $g + $step )); b=0; done r=$(( $r + $step )); g=0; done r=0; done
Shouldn't the loops go only till 255 (or replace -le with -lt)?
One more question - how do I get this working? When I run xsetroot -solid rgb:200/0/0, it exits immediately with no output, no errors, but nothing happens. I tried to protect the rgb argument with double quotes and/or escape sequences, still nothing.
Offline
Yes, it must be 255, I changed it in a later version, but I couldn't get rid of the flickering, so never posted it.
I use the printf because the values are in hex, so rgb:200/0/0 is wrong.
Offline
... but I couldn't get rid of the flickering, so never posted it.
the flickering happens, becuase it jumps from 255 to 0. the best way would be to alternate r b g but keep the sum of these 3 values constant or at least equicontinuously changing. that's also why i asked if trigonometry functions are available in bash (but they are not, unfortunately). maybe something similar can be coded in perl
The impossible missions are the only ones which succeed.
Offline
I let it move from 0 to 255 and then back to 0 again. Also tried keeping the sum the same, but the flickering didn't went away, although it was slightly less.
Offline