Results 1 to 2 of 2
So, I was thinking one day, "Hmm, if there is going to be eyecandy in a distro, it should be cool."
What's more cool than a titlebar that fades colors?
...
- 01-14-2008 #1
How could this script be improved?
So, I was thinking one day, "Hmm, if there is going to be eyecandy in a distro, it should be cool."
What's more cool than a titlebar that fades colors?
This would be for GNOME
color-script.sh
It seems like a good idea, but it keeps taking over the xserver, or perhaps it's just lagging the system. It seems like an awesome idea, but I don't have to look at the same system colors, and they would fluctuate, which would be awesome. I tried doing this, but as said, it was laggy. I recently noticed that the terminal window used to execute the script gets smaller, too, as the colors change. That's weird. I don't know why it's doing that. Maybe some of you could suggest ideas to make this better.Code:#!/bin/sh gconftool-2 -t string -s /desktop/gnome/interface/gtk_color_scheme "fg_color:#000000000000 bg_color:#eaeae8e8e3e3 text_color:#000000000000 base_color:#ffffffffffff selected_fg_color:#ffffffffffff selected_bg_color:#ffff00000f42" sleep 3 gconftool-2 -t string -s /desktop/gnome/interface/gtk_color_scheme "fg_color:#000000000000 bg_color:#eaeae8e8e3e3 text_color:#000000000000 base_color:#ffffffffffff selected_fg_color:#ffffffffffff selected_bg_color:#ffff00007611" sleep 3 gconftool-2 -t string -s /desktop/gnome/interface/gtk_color_scheme "fg_color:#000000000000 bg_color:#eaeae8e8e3e3 text_color:#000000000000 base_color:#ffffffffffff selected_fg_color:#ffffffffffff selected_bg_color:#ffff0000ce93" bash $HOME/color-script.sh

- 01-14-2008 #2
First off, you should use an infinite loop instead of a recursive script. I don't know if Bash optimizes tail recursion, but it any event, your script is more suited to an infinite loop. This basically means:
Also, since only one of your variables actually changes, you would be better off having an array of possible selected_bg_color values and using a counter variable to cycle through them. This makes it easier to add new colors, and means that you only have to change the code once when it changes, as opposed to 3 times.Code:#!/bin/sh while 0; do gconftool-2 -t string -s /desktop/gnome/interface/gtk_color_scheme "fg_color:#000000000000 bg_color:#eaeae8e8e3e3 text_color:#000000000000 base_color:#ffffffffffff selected_fg_color:#ffffffffffff selected_bg_color:#ffff00000f42" sleep 3 gconftool-2 -t string -s /desktop/gnome/interface/gtk_color_scheme "fg_color:#000000000000 bg_color:#eaeae8e8e3e3 text_color:#000000000000 base_color:#ffffffffffff selected_fg_color:#ffffffffffff selected_bg_color:#ffff00007611" sleep 3 gconftool-2 -t string -s /desktop/gnome/interface/gtk_color_scheme "fg_color:#000000000000 bg_color:#eaeae8e8e3e3 text_color:#000000000000 base_color:#ffffffffffff selected_fg_color:#ffffffffffff selected_bg_color:#ffff0000ce93" doneDISTRO=Arch
Registered Linux User #388732


Reply With Quote