Results 1 to 2 of 2

Thread: Script to switch themes, Having else problems.

  1. #1
    Join Date
    Jul 2008
    Location
    /home/nicholas
    Beans
    207
    Distro
    Ubuntu 9.10 Karmic Koala

    Script to switch themes, Having else problems.

    So I made a script to switch themes, But I also wanted the user to be able to change the metacity theme. For example, If A user typed this:
    Code:
    sh switch-theme Human
    Now this would switch the Gnome Theme And the Metacity Theme.
    This code is the problem.
    Code:
    sh switch-theme Human Glossy
    But this will change the Metacity theme and Gnome Theme to Human, When it should change the metacity theme to Glossy and change the gnome theme to Human.((Changing the gnome theme works fine.)
    Here is the script's code.
    Code:
    #!/bin/bash
    gconftool-2 --type string --set /desktop/gnome/interface/gtk_theme $1
    if [ $2=0 ]
    then
    gconftool-2 --type string --set /apps/metacity/general/theme $1
    else
    gconftool-2 --type string --set /apps/metacity/general/theme $2
    fi
    Never mind.Kept screwing up XFCE.XD
    http://www.crashie.com will crash an IE install.

  2. #2
    Join Date
    Aug 2007
    Location
    Canada
    Beans
    459
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Script to switch themes, Having else problems.

    Try replacing the line

    if [ $2=0 ]

    by

    if [ -z "$2" ]
    Best, Gnusci

    "Never make a calculation until you know the answer." -- Wheeler, Spacetime Physics, pg 60.

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
  •