GTK Theme installer v0.1.2

3 min read

Deviation Actions

lassekongo83's avatar
By
Published:
13.7K Views
My first major bash script is done. I'm trying to make it easier for people with no experience to install my GTK themes and for other theme developers to use this script for the same purpose. I will probably release this with my next theme to see if it works ok. You can grab the source now though. :)

Q: So why just not write the manual way to install a theme?
A: My script checks if the user is stupid. ;)

Q: Do you think all users are stupid?
A: Nah J/K. My script checks certain things like if gnome-shell or unity is running, or if the folder structure is messed up. It even checks if the user have the required Murrine version installed, otherwise the theme may look messy. :p However, if the user doesn't know how to install the murrine engine or any required software the error messages output - then this will not be much of a help. :p

Q: I want to use this script. What do I need to know?
A: If you're a theme developer then feel free to do so.
You should edit the script with the required information at the start:
GTK_THEME="enter-name-here" # The name of the GTK theme (The folder name.)
METACITY_THEME="enter-name-here" # The name of the metacity theme (The folder name, should be the same as above.)
MURRINE_TESTVER=0.9811 # This is version the user needs of the murrine engine. Change it if your theme requires a newer or older version.


Then save the file as your_theme-install.sh with the following required folder structure:
|your_theme-install.sh
|your_theme_folder
|---gtk-2.0
|---metacity-1


If your theme doesn't have a metacity theme, then comment out the following lines: (By adding a # in front of the line.)
gconftool-2 --type string --set /apps/metacity/general/theme "$METACITY_THEME" (There should be 2 of them.)

Then right-click on your_theme-install.sh and select Properties and click "Allow Executing File as Program." Any user should now be able to double-click on the file and select Run.

------------------------------

Grab the source here: pastebin.com/DL939Vpj

Btw, I'm not an expert at writing bash scripts. This can probably be done in a much cleaner and better way. So if you're a bash guru don't facepalm right away, give me constructive feedback. ;)
Oh, and there a probably tons of typos and grammar errors in the script. :p

I'm hoping to find a way to import an *.emerald file instead of a metacity theme. Unfortunately I have not found any way of doing this yet. But this will be the base of the script for GTK and Metacity themes. If there's any new version I'll update this journal entry.
© 2011 - 2024 lassekongo83
Comments6
Join the community to add your comment. Already a deviant? Log In
0rAX0's avatar
To import Emerald themes, extract the .emerald to '~/.emerald/themes'.

To force a theme copy the contents of an Emerald theme (from the themes folder) to '~/.emerald/theme' and use 'emerald --replace'.

Now all you have to do is to find a way to make compiz use emerald as a decorator when it starts up, normally you'd launch CCSM>Window Decoration>Command, and replace with 'emerald --replace'.

Good luck.