Any way to center Cinnamon Windows ????

Please post suggestions for improvement of Cinnamon on:
https://github.com/linuxmint/Cinnamon
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
sfeltch

Any way to center Cinnamon Windows ????

Post by sfeltch »

Hi all,

I am currently using mate 13 but would like to use Cinnamon. The thing that stops me is I hate the opening of windows in random or "smart" placement. Is there a way and am I missing it somewhere to center window placement in Cinnamon? If not I would hope that this would be a feature to add.

Thanks in advance,

sfeltch
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
herbie643
Level 3
Level 3
Posts: 190
Joined: Tue Oct 19, 2010 9:16 pm

Re: Any way to center Cinnamon Windows ????

Post by herbie643 »

I 2nd that. Centering windows is an option in Compiz but since Compiz is not supported it cannot be done. I have written code that automatically centers windows. It is not that hard. To add as an option would be childsplay. Come on guys, add that feature. It will be welcomed I am sure.
GeneC

Re: Any way to center Cinnamon Windows ????

Post by GeneC »

herbie643 wrote:......... I have written code that automatically centers windows. It is not that hard.............
:D

herbie

Can you share?
I know nothing of writing code, but if you post a "HOW TO".. :mrgreen:

I posted asking for this when Cinnamon first came out, so I would not wait on it to be implemented by the developers soon.... :lol:
lurkatron

Re: Any way to center Cinnamon Windows ????

Post by lurkatron »

personally i want windows to appear in pre-defined fixed positions
herbie643
Level 3
Level 3
Posts: 190
Joined: Tue Oct 19, 2010 9:16 pm

Re: Any way to center Cinnamon Windows ????

Post by herbie643 »

I did a Google search on 'center window in css' and found this

.centered {
position: fixed;
top: 50%;
left: 50%;
}
and inserted into the theme gtkwidgets.css
at the Gtkwindow section

Mine now looks like
GtkWindow {
color: @theme_fg_color;
.centered {
position: fixed;
top: 50%;
left: 50%;
}
}

Now this only seems to work on GTK3 applications. Haven't found a way in GTKRC yet.
I realize this is a kludge of sorts, since most users have no clue where to look.


The path would be /usr/share/themes/themename/gtk-3,0/gtkwidgets.css

But at least it seems to work.
User avatar
twodogs
Level 4
Level 4
Posts: 320
Joined: Sat Jun 09, 2007 9:18 pm

Re: Any way to center Cinnamon Windows ????

Post by twodogs »

You can center windows in Cinnamon!

Go to Cinnamon Settings and click 'Keyboard.'
Under 'windows' scroll down to the keyboard shortcut for centering windows.

There is not one currently set so you will have to do it.

I use alt + space and my windows immediately center.


Hope this helps.

I use Cinnamon 1.6 yadda yadda yadda.
HoppityBob

Re: Any way to center Cinnamon Windows ????

Post by HoppityBob »

Cinammon is really nice and I love the clean, uncluttered look, but I would also like the option to set the position (and even the size) of windows as they open. Personally I like them to open centered and to remember their previous size, not open scattered randomly about the screen.

I'd also very much like the option to force specific windows/applications to open/stay on certain workspaces. Kde can do this and I'll be sticking with it as my main DE so long as it's the only one that seems to able to.
allypink

Re: Any way to center Cinnamon Windows ????

Post by allypink »

How do folks.
Seriously loving cini 1.6. Thanks Clem and the gang.
Centering was easy with twodogs advice (there's a good Ausie expression) using the second 'windows menu key' on the rhs of the keyboard leaving the other for Mint's menu.
Would be better to have the option in cini setup to do it automaticly. I have to agree.......... on a large screen not centering is a pain!
I think with this version of Mint if have found my Mint 10 upgrade.
;)
d00med

Re: Any way to center Cinnamon Windows ????

Post by d00med »

herbie643 wrote:Mine now looks like
GtkWindow {
color: @theme_fg_color;
.centered {
position: fixed;
top: 50%;
left: 50%;
}
}
This doesn't work here at all, but I can't imagine how that would be valid CSS. Don't believe I've ever seen a nested class like that. I tried defferent versions of that CSS centering hack, but none worked.
herbie643
Level 3
Level 3
Posts: 190
Joined: Tue Oct 19, 2010 9:16 pm

Re: Any way to center Cinnamon Windows ????

Post by herbie643 »

I got the code from a google search on centering in css.
Like I said, it worked for me. .xsession-errors complained about needing a ; but other than that it worked.
herbie643
Level 3
Level 3
Posts: 190
Joined: Tue Oct 19, 2010 9:16 pm

Re: Any way to center Cinnamon Windows ????

Post by herbie643 »

Check out my post on Center Windows.. I use devilspie...
d00med

Re: Any way to center Cinnamon Windows ????

Post by d00med »

herbie643 wrote:I got the code from a google search on centering in css.
Like I said, it worked for me. .xsession-errors complained about needing a ; but other than that it worked.
Yeah, but it isn't proper CSS as far as I know, and there likely isn't a .centered class in the theme's CSS file. Should be something like

Code: Select all

GtkWindow {
color: @theme_fg_color;
position: fixed;
top: 50%;
left: 50%;
}
But this didn't work for me either.
viking777

Re: Any way to center Cinnamon Windows ????

Post by viking777 »

gdevilspie is great for this sort of thing and it is available in the package manager and absolutely tiny.

Instructions here (see part 2):

http://www.webupd8.org/2011/02/how-to-s ... mized.html
d00med

Re: Any way to center Cinnamon Windows ????

Post by d00med »

Thanks for the suggestions of Devil's Pie. It's extra overhread, but it so nice to have the windows behave like they should,
nomko

Re: Any way to center Cinnamon Windows ????

Post by nomko »

twodogs wrote:Go to Cinnamon Settings and click 'Keyboard.'
Under 'windows' scroll down to the keyboard shortcut for centering windows.
I have Cinnamon 1.6 and when i open the keyboatrd settings in the Cinnamon settings menu i see 2 tabs: Typing and Keys (shortcuts). What do you mean with "Under windows scroll down...."??
nomko

Re: Any way to center Cinnamon Windows ????

Post by nomko »

viking777 wrote:gdevilspie is great for this sort of thing and it is available in the package manager and absolutely tiny.

Instructions here (see part 2):

http://www.webupd8.org/2011/02/how-to-s ... mized.html
Is it also applicable for Cinnamon??
viking777

Re: Any way to center Cinnamon Windows ????

Post by viking777 »

nomko wrote:
viking777 wrote:gdevilspie is great for this sort of thing and it is available in the package manager and absolutely tiny.

Instructions here (see part 2):

http://www.webupd8.org/2011/02/how-to-s ... mized.html
Is it also applicable for Cinnamon??
Well it works for centering my terminal window on Cinnamon, but I haven't tried every window type there is, that is about all I do with it at the moment. I don't suppose the information is much use to you, but when I tried it on Manjaro it failed to reposition my package manager window (which always opens up across two screens instead of on my main monitor) so it obviously has some limitations.
nomko

Re: Any way to center Cinnamon Windows ????

Post by nomko »

viking777 wrote:
nomko wrote:
viking777 wrote:gdevilspie is great for this sort of thing and it is available in the package manager and absolutely tiny.

Instructions here (see part 2):

http://www.webupd8.org/2011/02/how-to-s ... mized.html
Is it also applicable for Cinnamon??
Well it works for centering my terminal window on Cinnamon, but I haven't tried every window type there is, that is about all I do with it at the moment. I don't suppose the information is much use to you, but when I tried it on Manjaro it failed to reposition my package manager window (which always opens up across two screens instead of on my main monitor) so it obviously has some limitations.
And how can i set delispie to open all Windopws on the right side of my screen? What are the coordinates of the screen/desktop? See screenshot: http://www.wuala.com/nomko/Afbeeldingen ... 1_002.png/ download the file to see the whole screenshot.
viking777

Re: Any way to center Cinnamon Windows ????

Post by viking777 »

The instructions to use gdevilspie are on the link I gave starting about half way down with the words "To add a new rule using gDevilspie". About the only thing is doesn't tell you is that you have to manually position/size the windows you want before clicking 'get' . Everything else is more or less automatic. (you do have to have the deamon running but that is just a checkbox in the gui). I repeat though I only use this to centre my terminal window when it starts up I haven't investigated the more complex functions.
nomko

Re: Any way to center Cinnamon Windows ????

Post by nomko »

viking777 wrote:The instructions to use gdevilspie are on the link I gave starting about half way down with the words "To add a new rule using gDevilspie". About the only thing is doesn't tell you is that you have to manually position/size the windows you want before clicking 'get' . Everything else is more or less automatic. (you do have to have the deamon running but that is just a checkbox in the gui). I repeat though I only use this to centre my terminal window when it starts up I haven't investigated the more complex functions.
Didn't worked for me... Only the terminal pops up in the screen centre now, but that's it! Firefox still opens at the left side of the screen...
Locked

Return to “Cinnamon”