LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 09-15-2015, 02:34 PM   #1
CVAlkan
Member
 
Registered: Nov 2012
Location: Northwest suburbs of Chicago
Distribution: Ubuntu & Mint LTS, Manjaro Rolling; Android
Posts: 242

Rep: Reputation: Disabled
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?

Thanks in advance ...
 
Old 09-19-2015, 12:18 AM   #2
Diantre
Member
 
Registered: Jun 2011
Distribution: Slackware
Posts: 515

Rep: Reputation: 234Reputation: 234Reputation: 234
Quote:
Originally Posted by CVAlkan View Post
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 View Post
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:

Code:
[place]
s0_position_matches = class=Pcmanfm;
s0_position_x_values = 750;
s0_position_y_values = 164;
s0_position_constrain_workarea = false;
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.

Hope that helps.
 
Old 09-20-2015, 08:51 AM   #3
CVAlkan
Member
 
Registered: Nov 2012
Location: Northwest suburbs of Chicago
Distribution: Ubuntu & Mint LTS, Manjaro Rolling; Android
Posts: 242

Original Poster
Rep: Reputation: Disabled
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:

[place]
s0_position_matches = class=Nautilus;class=libreoffice-writer;
s0_position_x_values = 338;60;
s0_position_y_values = 172;84;
s0_position_constrain_workarea = false;false;

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.
 
  


Reply

Tags
compiz, ubuntu 14.04



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Where are the Compiz-Config Fixed Window Placement Settings kept? CVAlkan Ubuntu 2 06-26-2014 06:23 AM
css div - fixed size + center placement Ephracis Programming 6 12-05-2008 05:54 PM
window placement jimerickso Ubuntu 2 09-29-2007 11:19 PM
Window Placement enlight1 Linux - Distributions 1 06-17-2003 05:46 PM
window placement JunLitsu Linux - Software 0 04-24-2003 12:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 06:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration