Results 1 to 8 of 8

Thread: change theme from command line

  1. #1
    Join Date
    Jul 2008
    Location
    America
    Beans
    175
    Distro
    Ubuntu 10.04 Lucid Lynx

    change theme from command line

    is there a way to change theme from the command line. Currently my theme is Ambiance, and I would like to change it to clearlooks. I want to do this from the command line, becuase thats just badass!!

    Also, is there a way to figure out what my current theme is from the command line?

    THanks

  2. #2
    Join Date
    Jan 2010
    Beans
    Hidden!

    Re: change theme from command line

    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"

  3. #3
    Join Date
    Jul 2008
    Location
    America
    Beans
    175
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: change theme from command line

    thanks

  4. #4
    Join Date
    Sep 2011
    Beans
    615

    Re: change theme from command line

    I put the first 3 commands in a script and they work fine. Strangely, they do NOT change my custom pointer, but that's cool, I like my pointer. How can I generalize this? In other words how can I inspect a theme (eg. High Contrast Inverse) and determine what commands would duplicate the effect of System, Preferences, Appearance, theme tab, High Contrast Inverse (or whatever). Failing a general solution, how about a specific one for High Contrast Inverse or my customised High Contrast Inverse,LP (which is just HCI with the pointer made bigger)? I intend to point launchers to two scripts to toggle between these if I can figure it out. Or better yet, is there an environment variable or something I could use to tell the script which theme is in effect and toggle to the other one so I could use one launcher instead of two?

  5. #5
    Join Date
    Sep 2011
    Beans
    615

    Re: change theme from command line

    OK, I figured it out. Anybody else that wants to do something like this, here's how:
    Look at Limestone's commands as a template and a guide to where to look in gconf-editor.
    Set a theme you like and then type gconf-editor on a command line to open that program (or maybe you can add it to your menus if you use it much) Then use Limestones commands to follow down the hierarchy/tree doodad (ok, that'll make sense if you are looking at it) until you come to the value for the last argument of the command and substitute that value in the command.

    I still don't know if there is an elegant way for a script to enquire what theme is in use or what these values are. Maybe they are environment variables. If nothing else, maybe I can set a variable in the same script and use some sort of conditional statement to run one or the other set of commands depending on the environment variable. But that wouldn't survive rebooting. So maybe I should have it create a file somewhere to act the same way.

  6. #6
    Join Date
    Sep 2011
    Beans
    615

    Re: change theme from command line

    Found a lot with method above but haven't found how to change the location of the window control buttons from left to right upper corner and change them to the trad __,Square,X symbols. I'd like to modify the default theme minimally, changing only the window controls symbols and locations to make them like clearlooks. Any suggestions?

  7. #7
    Join Date
    Sep 2011
    Beans
    615

    Re: change theme from command line

    None of this seems to work any more with the new post-Maverick interface. As far as I can tell that is because the Gnome people didn't make any effort to continue to support legacy commands in Gnome 3. Please correct me if I'm wrong.

    Am I missing something here? Is there some simple way to to change the environment, without sticking to the soon-to-be-forever-frozen-so-that-no-security-flaws-will-ever-be-fixed gnome 2, or going to Mate, the further development of which seems open to question, so that my old scripts continue to work?

    Can anyone point me to a reference to equivalent command syntax that works in the current gnome panel/oneric gnome classic (no effects) environment and how to extrapolate it to different themes and theme elements?

    Is there another distro that is more committed to maintaining backwards compatibility so that users don't waste time working out useful scripts that break when it is updated?
    Last edited by Dreamer Fithp Apprentice; February 21st, 2012 at 08:17 PM.

  8. #8
    Join Date
    Sep 2011
    Beans
    615

    Re: change theme from command line

    Update: It works fine in Mate if you make some simple substitutions of program and directory names, mostly replacing "g" or "gnome" with "mate".

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •