Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to figure out how to automatically switch to the Equinox Evolution Dawn, Light, Dusk, and midnight theme at the appropriate time of day (ie; at 6 a.m. it would switch from midnight to dawn, at 8 or 9 it would switch to light, 7 p.m. would switch to dusk and 10 p.m. switch to midnight)

I am trying to do this using cron, with the following crontab:

0 6 * * * gconftool-2 --type=string --set /apps/metacity/general/theme 'equinox-evolution-dawn'

0 8 * * * gconftool-2 --type=string --set /apps/metacity/general/theme 'equinox-evolution-light'

0 19 * * * gconftool-2 --type=string --set /apps/metacity/general/theme 'equinox-evolution-dusk'

0 22 * * * gconftool-2 --type=string --set /apps/metacity/general/theme 'equinox-evolution-midnight'

This is not working. I am using ubuntu 10.10 with Compiz as window manager

share|improve this question
    
Not a precise answer to your question, but you might see Gnome theme which changes depending on the time of day –  belacqua Apr 11 '11 at 17:19
1  
What do you mean by "not working"? No part of the theme changes? –  Alvin Row Apr 11 '11 at 22:12
    
That's correct. No part of the theme changes in any way that I can tell. –  user3403 Apr 11 '11 at 22:35
add comment

1 Answer 1

up vote 0 down vote accepted

Can you try this script? (adapted from New Wave -Chronos)

#!/bin/bash
# Autor: Narf SS 2009
# Site: http://proyectobs.blogspot.com/
#
# Este script cambia el archivo de configuración del tema metacity "New Wave Chronos"
#y actualiza el tema.
#Para su funcionamiento (sin modificación) debe de ser añadido a la ejecución en el inicio, 
#y el tema debe de estar instaldo en la carpeta ".theme" del home del usuario.
#Y por supuesto seleccionado en la apariencia del escritorio y este mismo script añadido a las aplicacioens de inicio.

while [ true ]
do
    hora=`date +%H`

    case "$hora" in
    06|07)          # Amanecer
        gconftool-2 --type=string --set /apps/metacity/general/theme 'equinox-evolution-dawn' ;;
    08|09|10|11|12|13|14|15|16|17|18)   # Medio dia
        gconftool-2 --type=string --set /apps/metacity/general/theme 'equinox-evolution-light' ;;
    19|20|21)               # Atardecer
        gconftool-2 --type=string --set /apps/metacity/general/theme 'equinox-evolution-dust' ;;
    22|23|24|00|01|02|03|04|05) # Madrugada
        gconftool-2 --type=string --set /apps/metacity/general/theme 'equinox-evolution-midnight' ;;
    esac


    sleep 1h
done
share|improve this answer
    
That successfully changes the metacity theme, but not the GTK or icon themes...where would I find the commands for changing those, and how would I insert them into this script? –  user3403 Apr 12 '11 at 5:01
    
Just add something like: && gconftool-2 --type string --set /desktop/gnome/interface/icon_theme 'theme_name' after every gconftool-2 --type=string --set /apps/metacity/general/theme 'equinox-evolution-dawn' –  desgua Apr 12 '11 at 14:35
    
It now works correctly, had to do a few tweaks to the script because I had some of the theme names off and, in the case of the Light one, the metacity theme was actually Equinox Evoluution Rounded –  user3403 Apr 12 '11 at 23:31
    
-----Nice!----- –  desgua Apr 13 '11 at 0:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.