Results 1 to 5 of 5

Thread: detecting current theme

  1. #1
    Join Date
    Apr 2008
    Beans
    3
    Distro
    Ubuntu 6.06 Dapper

    detecting current theme

    Hey there,
    I was wondering if anybody knew how a non-GTK application could detect the current theme that gnome is using.

    There is an environment variable called GTK_RC_FILES which points me to a file called .gtkrc-1.2-gnome2 which contains the following lines:

    # Autowritten by gnome-settings-daemon. Do not edit

    include "/home/my_user_name/.gtkrc.mine"


    This file, as near as I can tell, does not exist. I know where the themes are stored and I obviously know which theme I am using but I would like to be able to have an application find out automatically.

    Any thoughts would be greatly appreciated.

    --twenty1grand

  2. #2
    Join Date
    Jan 2007
    Location
    $here ? $here : $there
    Beans
    3,717
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: detecting current theme

    For the gtk theme:
    Code:
    gconftool-2 -g /desktop/gnome/interface/gtk_theme
    Icon theme:
    Code:
    gconftool-2 -g /desktop/gnome/interface/icon_theme
    Window manager theme can be tricky but, assuming you are using either metacity or compiz without emerald:
    Code:
    gconftool-2 -g /apps/metacity/general/theme

  3. #3
    Join Date
    Apr 2008
    Beans
    3
    Distro
    Ubuntu 6.06 Dapper

    Re: detecting current theme

    Quote Originally Posted by vor View Post
    For the gtk theme:
    Code:
    gconftool-2 -g /desktop/gnome/interface/gtk_theme
    Icon theme:
    Code:
    gconftool-2 -g /desktop/gnome/interface/icon_theme
    Window manager theme can be tricky but, assuming you are using either metacity or compiz without emerald:
    Code:
    gconftool-2 -g /apps/metacity/general/theme


    Ok I will try that, thanks.
    Que aguante San Lorenso
    (I used to live in Bahia Blanca and Mar del Plata)

  4. #4
    Join Date
    Apr 2008
    Beans
    3
    Distro
    Ubuntu 6.06 Dapper

    Re: detecting current theme

    Quote Originally Posted by vor View Post
    For the gtk theme:
    Code:
    gconftool-2 -g /desktop/gnome/interface/gtk_theme
    Icon theme:
    Code:
    gconftool-2 -g /desktop/gnome/interface/icon_theme
    Window manager theme can be tricky but, assuming you are using either metacity or compiz without emerald:
    Code:
    gconftool-2 -g /apps/metacity/general/theme
    Just tried it, thats exactly what I needed! I don't know why I couldn't find that out with searches.
    Thanks!
    Last edited by twenty1grand; April 23rd, 2008 at 04:15 PM. Reason: Quoted wrong message

  5. #5
    Join Date
    Jan 2007
    Location
    $here ? $here : $there
    Beans
    3,717
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: detecting current theme

    Glad that helped.

    (And, Dale San Loren!)

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
  •