Monday, April 29, 2024
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 2207  / 1 Year ago, wed, march 29, 2023, 6:50:37

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.


More From » command-line

 Answers
2

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 context.Import(os.path.abspath(savefile))



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 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.


[#33159] Thursday, March 30, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
whoppinolo

Total Points: 93
Total Questions: 113
Total Answers: 107

Location: Cyprus
Member since Mon, Oct 24, 2022
2 Years ago
whoppinolo questions
Tue, Feb 14, 23, 08:30, 1 Year ago
Wed, Sep 28, 22, 06:56, 2 Years ago
Fri, May 27, 22, 01:55, 2 Years ago
Tue, Oct 12, 21, 09:33, 3 Years ago
;