Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Ubuntu & Mint LTS, Manjaro Rolling; Android
Posts: 242
Rep:
Fixed Window Placement using CompizConfig
I'm using 64 bit Ubuntu 14.04.3, and this is regarding the fixed window placement in CompizConfig Settings Manager.
For each window, I position it where I would like. Opening a terminal session (Ctrl+Alt+t) I use xwininfo the determine the "Absolute upper-left X" and "Absolute upper-left Y" values.
To set the desired window placements, I use the "Place Windows" utility from the "Window Management" section.
I then use the [New] button on the "Fixed Window Placement" tab. When the [Edit] window pops up, I click on the green [+] sign, which opens the "Edit match" box, click on the [Grab] button, and then click the cursor to auto-fill the Window Class value when the [Add] button is pressed.
Then I fill in the X and Y position values from what was reported by xwininfo. This works great, but each time I do a new install on another machine, I need to go through the same process for every window - a real pain.
Since the resolutions and screen sizes, etc. are all the same, I attempted to simply copy whatever configuration file Compiz uses to store these values. Unfortunately, I've trolled through every config file in root as well as user - hidden or not - shared or not, and so forth, and have had no luck at all finding such as file, or any file that contains anything that looks like such a list.
Knowing Murphy's law, I suspect it's in a place so obvious that I just don't see it, but I don't.
Does anyone know where these are kept?
Alternatively, is there some command line for compiz that will allow me to set them all with a bash script or something?
Unfortunately, I've trolled through every config file in root as well as user - hidden or not - shared or not, and so forth, and have had no luck at all finding such as file, or any file that contains anything that looks like such a list.
Knowing Murphy's law, I suspect it's in a place so obvious that I just don't see it, but I don't.
Does anyone know where these are kept?
I think that the settings you're looking for are stored in ~/.config/compiz/compizconfig/Default.ini.
But I also think that to achieve what you want (same fixed placement of windows in different systems), it'll be better if you use CCSM profiles.
For instance, make your changes in the "Place Windows" plugin as you described, then go to "Preferences -> Profile & Backend". Select the default profile and export it to a file using the flat-file configuration backend. This file is a simple text file, ini style, which you can take to another system and do the opposite operation, that is, import the settings.
Quote:
Originally Posted by CVAlkan
Alternatively, is there some command line for compiz that will allow me to set them all with a bash script or something?
CCSM has a few command line options, but none is used to change plugin settings. Compiz itself won't do that either, AFAIK.
It occurs to me that it may be done with the aforementioned Default.ini file. When you export the profile in CCSM, the "Place Windows" plugin section looks like this:
It's quite simple to add a bit of text to the Default.ini file with a Bash script. But be warned, this is just an idea, I haven't actually tried this on my system, so your mileage may vary. Make backups of the file if you decide to try it.
Distribution: Ubuntu & Mint LTS, Manjaro Rolling; Android
Posts: 242
Original Poster
Rep:
Fixed Window Placement using CompizConfig
Hi Diantre:
Thanks very much for your response; it doesn't work exactly that way on my system, but you got me into the right neighborhood.
I don't actually have a ~/.config/compiz/compizconfig/Default.ini file, although the directory ~/.config/compiz-1/compizconfig directory exists; it contains just two files. The first, "config" is completely empty. The second, "done_upgrades" gives the clue to my setup, which is Ubuntu 14.04.3 (Canonical's latest attempt to break as many things that used to work as they could). This contains a series of entries from "com.canonical.unity.unity.01.upgrade" through "com.canonical.unity.unity.07.upgrade". Fair enough.
So - I thought it might be useful to some others if I added the following comments and a big warning:
If you choose 'Preferences' when you open the CompizConfig Settings Manager, you can indeed save (export) the profile settings, but under "Backend:" my system is set to use "GSettings Configuration Backend" rather that using a straight .ini file. So the window placement settings are stored in the GSettings database rather than the config file I was expecting - explaining why I couldn't locate them.
On doing an export, the relevant section of the .profile document created looks like the following after I set placements for Nautilus and Writer:
As you can see, this is not your typical "key/value" format, but rather a "keyS/valueS" format; since I typically set placements for anywhere from ten to twenty windows, this might not qualify under the usual definition of "human-readable" but the import and export gives me what I need (assuming they don't change the format with every new release!!).
And now for a **** BIG WARNING ****
I thought it would be interesting to change the "Backends" output from GSettings to a regular .ini file. BAD - BAD - BAD IDEA. Luckily I had backups!!! Immediately upon making the choice in the dropdown list, my machine began losing its mind: Errors began popping up right and left; I lost the desktop completely, and the only thing that still seemed to work was Ctrl+Alt+t. Using the terminal, I attempted restarting the desktop and so forth, and finally had to do a shutdown 0 to turn off the machine (which actually didn't even finish...). I powered off and rebooted several times, but things were totally scrambled.
Having just installed 14.04.3 on a new SSD a few days earlier, I just gave up and slapped the DVD in and reinstalled, since I figured it would take to figure out all the things that might have gotten trashed. So a cautionary note for Ubuntu users: leave the choice of export backend formatting alone.
This is not, of course, the only example of things that 14.04.3 has broken, but that's another story.
But, again, thanks for pointing me in the right direction; it's much appreciated, as I asked this question in the past on several different forums and never got any response whatever.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.