Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How can i export and import Compiz current profile settings using Command line. I'm using ubuntu 12.10. Or can i get a script for doing export and import.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

I'm not sure of a command line utility, but you can easily do this with a script in python and python-compizconfig package. Here you go:

#!/usr/bin/python
import sys
import compizconfig

#The last input on the command line will be the path to save the file to.
savefile=sys.argv[-1]

context=compizconfig.Context()
#Change keyword if you want to skip saving entries that are default
context.Export(savefile,skipDefaults=False)

To import settings, you could just change the last line to context.Import(savefile)

Now to run, just save and chmod +x scriptname.py and run scriptname.py PATH or run with python scriptname.py PATH if you don't chmod.

WARNING- I have only tested a bit and basic functionality works, but I guarantee nothing. The script can be made much more robust and functional. You have to also enter a full path for the export function to write anything (you can use a tilde to expand to one: ~/example.profile)

share|improve this answer
    
Thank you very much +Ian B. This is what I exactly needed...Thanks –  Vishal Vijay Jan 18 '13 at 3:19

Small update I wanted to add to importing that I found.

#!/usr/bin/python
#http://askubuntu.com/questions/244333/compiz-profile-settings-export-and-import-using-command-line
import sys
import compizconfig

#The last input on the command line will be the path to save the file to.
savefile=sys.argv[-1]

context=compizconfig.Context()

#saveFile is the name of the file. True specifies whether or not to overwrite current settings.
context.Import(savefile, True)

I was having an issue on import where it didn't seem to be overwriting the default values. Appending True to the end of the Import statement seems to have fixed that.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.