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.
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, os 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(os.path.abspath(savefile),skipDefaults=False)
To import settings, you could just change the last line to
Now to run, just save and
chmod +x scriptname.py and run
./scriptname.py FILE or run with
python scriptname.py FILE if you don't
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.
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.