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.

Is it possible change desktop theme In each hour

share|improve this question
    
make a script that reads from a list of themes and changes the theme. have it run every $TIME by setting it up in cron. GTK theme: gconftool-2 --type=string -s /desktop/gnome/interface/gtk_theme Clearlooks Metacity: gconftool-2 --type=string -s /apps/metacity/general/theme Clearlooks Icons: gconftool-2 --type=string -s /desktop/gnome/interface/icon_theme gnome Wallpaper: gconftool-2 -t str --set /desktop/gnome/background/picture_filename "/usr/share/backgrounds/gnome.png" –  Taylor Bioniks Apr 9 '12 at 8:49
    
Good suggestion ,but I am not bash expert –  Tachyons Apr 9 '12 at 9:15
    
Do you want to change the background image or the whole theme? –  lumbric Apr 9 '12 at 9:53
    
Whole theme ,including gtk,windowo-border &icon theme –  Tachyons Apr 9 '12 at 10:07
add comment

2 Answers

here I wrote you some scripts to do random settings using gconf.

ChangeGTKTheme

#!/bin/bash
if [ "$1" == "random" ]; then
files=(~/.themes/*)
base=$(basename "${files[RANDOM % ${#files[@]}]}")
gconftool-2 --type=string -s /desktop/gnome/interface/gtk_theme $base
else
if [  "$1" == "" ];  then
    echo "Usage: $0 GTK_theme_name"
    echo "or $0 random  / for a random pick"
else
#GTK theme
gconftool-2 --type=string -s /desktop/gnome/interface/gtk_theme $1
 fi
fi

ChangeBackground

#!/bin/bash
if [ "$1" == "random" ]; then
files=(~/.backgrounds/*)
gconftool-2 -t str --set /desktop/gnome/background/picture_filename  "${files[RANDOM % ${#files[@]}]}"
else
if [  "$1" == "" ];  then
    echo "Usage: $0 path/to/background"
    echo "or $0 random  / for a random pick"
else
#Wallpaper
gconftool-2 -t str --set /desktop/gnome/background/picture_filename $1 
fi
fi

ChangeIcons

#!/bin/bash
if [ "$1" == "random" ]; then
files=(~/.icons/*)
base=$(basename "${files[RANDOM % ${#files[@]}]}")
gconftool-2 --type=string -s /desktop/gnome/interface/icon_theme  $base
else
if [  "$1" == "" ];  then
    echo "Usage: $0 icon_theme_name"
    echo "or $0 random  / for a random pick"
else
#Icons
gconftool-2 --type=string -s /desktop/gnome/interface/icon_theme $1
fi
fi

ChangeMetacityThemes

#!/bin/bash
if [ "$1" == "random" ]; then
files=(~/.themes/*)
base=$(basename "${files[RANDOM % ${#files[@]}]}")
gconftool-2 --type=string -s /apps/metacity/general/theme $base
else
if [  "$1" == "" ];  then
    echo "Usage: $0 metacity_theme_name"
    echo "or $0 random  / for a random pick"
else
#Metacity
gconftool-2 --type=string -s /apps/metacity/general/theme $1
fi
fi

Hope these help you.

share|improve this answer
    
I hope some one will create simple gtk/qt interface for it , –  Tachyons Apr 11 '12 at 12:49
add comment

Instead of writing a bash script you could do this all with cron. And if you're not a bash expert I'm guessing you're not a cron expert either so download Gnome-Schedule from the Ubuntu Software Center. That's basically a GUI for working with cron. Then just setup a task to run every hour that includes the following commands (you'd need a separate task for each command but they could run at the same time.

GTK theme:

gconftool-2 --type=string -s /desktop/gnome/interface/gtk_theme PUT_THE_THEME_NAME_HERE

Metacity:

gconftool-2 --type=string -s /apps/metacity/general/theme PUT_THE_THEME_NAME_HERE

Icons:

gconftool-2 --type=string -s /desktop/gnome/interface/icon_theme PUT_THE_ICON_THEME_NAME_HERE

Wallpaper:

gconftool-2 -t str --set /desktop/gnome/background/picture_filename "PUT_THE_PATH_TO_THE_WALLPAPER_IMAGE_HERE"

Important Note You'd need to make a separate task for each time you want the theme to change AND for each different theme it's going to change to using this process. Thus you'd make a task that runs every day at 1:00 to change the theme to Theme1. Another process that runs everyday that runs everyday to change the theme to Theme2, etc. The best way to do this would be to write a script but this would be an easy workaround.

share|improve this answer
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.