Results 1 to 9 of 9

Thread: Run a program under different theme?

  1. #1
    Join Date
    May 2010
    Beans
    4

    Run a program under different theme?

    Hey guys and gals!

    This is probably a dumb question...

    Anyways, I have installed Wii-Black as my theme for Ubuntu. It looks really neat for a lot of programs like Geany. Unfortunately, for others like Open Office (PowerPoint), it turns all the slides gray, and when going to do a sideshow, it looks terrible.

    Now, my question is: Can I run a program under a different theme than what I have as my default? Like forcing Open Office to run under human..?

    Thanks!
    -Frosty Fox =^_^=

  2. #2
    Join Date
    Jun 2007
    Location
    Nottingham, UK
    Beans
    1,659
    Distro
    Ubuntu

    Re: Run a program under different theme?

    You could set up a new user, set the theme for that user, and use the "su" command to run a program as that user.
    email: me@rory.sh
    IRC: ​blazemore@freenode

  3. #3
    Join Date
    May 2010
    Beans
    4

    Re: Run a program under different theme?

    Quote Originally Posted by blazemore View Post
    You could set up a new user, set the theme for that user, and use the "su" command to run a program as that user.
    Thanks for the suggestion!

    I did as you said and created a user, and left the default theme for them. Proceeded to use the su command and run a program, but I ran into a problem...


    Code:
    frosty@arctic:~$ su programmer
    Password: 
    programmer@arctic:/home/frosty$ geany 
    No protocol specified
    Geany: cannot open display
    programmer@arctic:/home/frosty$
    Code:
    frosty@arctic:~$ gksu -u programmer geany
    No protocol specifiedGeany: cannot open display
    
    frosty@arctic:~$
    I think it's because su doesn't let the user use my X? I'm not sure... I'm not really a pro at ubuntu.. I can just get around...
    Last edited by df0xyd; May 22nd, 2010 at 04:13 PM.

  4. #4
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: Run a program under different theme?

    In case of oo edit the /usr/bin/ooffice file:
    Code:
    gksu gedit /usr/bin/ooffice
    to:
    Code:
    #!/bin/sh
    export SAL_USE_VCLPLUGIN=gen
    /usr/lib/openoffice/program/soffice  "$@"
    In case of other applications you can set the theme by changing the value of the GTK2_RC_FILES variable, i.e.:
    Code:
    GTK2_RC_FILES="/usr/share/themes/Human/gtk-2.0/gtkrc" gedit

  5. #5
    Join Date
    May 2010
    Beans
    4

    Re: Run a program under different theme?

    Quote Originally Posted by sisco311 View Post
    In case of oo edit the /usr/bin/ooffice file:
    Code:
    gksu gedit /usr/bin/ooffice
    to:
    Code:
    #!/bin/sh
    export SAL_USE_VCLPLUGIN=gen
    /usr/lib/openoffice/program/soffice  "$@"
    In case of other applications you can set the theme by changing the value of the GTK2_RC_FILES variable, i.e.:
    Code:
    GTK2_RC_FILES="/usr/share/themes/Human/gtk-2.0/gtkrc" gedit
    That works out, super awesome! Thank you soo much! ^^

    But! I have one last question! The GTK2_RC_FILES variable works awesome if I'm launching from a terminal. Unfortunately, that does not affect the Applications menu. Is there any way I can change that or should I just create a alias under .bashrc that just screens the program and ignore the applications menu?

  6. #6
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: Run a program under different theme?

    Quote Originally Posted by df0xyd View Post
    That works out, super awesome! Thank you soo much! ^^

    But! I have one last question! The GTK2_RC_FILES variable works awesome if I'm launching from a terminal. Unfortunately, that does not affect the Applications menu. Is there any way I can change that or should I just create a alias under .bashrc that just screens the program and ignore the applications menu?
    You have to edit the command field of the launcher. Right click on the menu -> Edit Menus -> Highlight the item -> Properties and edit the command field to something like:
    Code:
    bash -c "GTK2_RC_FILES="/usr/share/themes/Theme/gtk-2.0/gtkrc" original-command"

  7. #7
    Join Date
    May 2010
    Beans
    4

    Re: Run a program under different theme?

    Quote Originally Posted by sisco311 View Post
    You have to edit the command field of the launcher. Right click on the menu -> Edit Menus -> Highlight the item -> Properties and edit the command field to something like:
    Code:
    bash -c "GTK2_RC_FILES="/usr/share/themes/Theme/gtk-2.0/gtkrc" original-command"
    Thank you very, very much sisco311!

    Problem is [SOLVED] =^_^=

  8. #8
    Join Date
    Oct 2009
    Location
    Copenhagen, Denmark
    Beans
    13
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Run a program under different theme?

    I too thank for the above solution. I used to change the colors in the Opera browser when using a dark theme -- with a white/light text color making a reply on a comment on facebook (etc.) would otherwise be unreadable.

  9. #9
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

Tags for this Thread

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
  •