PDA

View Full Version : [lubuntu] no window decoration with compiz



icu12345
April 24th, 2014, 06:45 PM
So I decided to try out the new Lubuntu 14.04 and so far itīs working out great. However, I do want to have a window manager that supports the Ļaero snapĻ feature... so I installed compiz just to use it as a window manager.

I have added compiz --replace to be executed every time upon startup but the window decoration option in ccsm just disappears. If I select it, window decoration works fine until next time I log in. How can I make the window decoration in ccsm permanently active?

Thanks!

deadflowr
April 24th, 2014, 07:52 PM
I don't understand.
Do you have window decorations when compiz is enabled,(ie, windows have title bars and close,min,max buttons)
or it is when you click on window decorations, the option doesn't stick?

icu12345
April 24th, 2014, 10:25 PM
Well, when compiz is enabled I do not have window decorations (i.e. no title bars, no close, min, max buttons, etc.). Then I open up ccsm, put a tick next to window decoration and then it is all good... until next time I log in. Upon restart, logout/log in, etc. compiz starts and there are no window decorations. So again, I enable them in ccsm and it all works great until next time I restart.

So, is there a way to make window decorations permanently enabled?

icu12345
April 25th, 2014, 10:33 PM
anyone?

grumblebum2
April 26th, 2014, 04:48 AM
Instead of bloating Lubuntu with compiz just for aerosnap you could achieve similar using wmctrl.

sudo apt-get install wmctrl

Check this command gives your screen width...

xdpyinfo | awk '/dimensions:/{print $2}' | cut -f 1 -d 'x'
eg for my res of 1680x1050

glen@Trusty:~$ xdpyinfo | awk '/dimensions:/{print $2}' | cut -f 1 -d 'x'
1680

If that works, these two commands will tile a focused window left or right accordingly...

width=$(xdpyinfo | awk '/dimensions:/{print $2}' | cut -f 1 -d 'x') && half=$(($width/2)) && wmctrl -r :ACTIVE: -b add,maximized_vert && wmctrl -r :ACTIVE: -e 0,0,0,$half,-1

width=$(xdpyinfo | awk '/dimensions:/{print $2}' | cut -f 1 -d 'x') && half=$(($width/2)) && wmctrl -r :ACTIVE: -b add,maximized_vert && wmctrl -r :ACTIVE: -e 0,$half,0,$half,-1

To bring out of the maximized_vert state...

wmctrl -r :ACTIVE: -b toggle,maximized_vert,maximized_horz

I also use a command to resize and centre a window...

wmctrl -r :ACTIVE: -e 0,450,260,860,560
A move and resize argument has the format 'g,x,y,w,h'.The first value g is the gravity ...just leave as 0.
The four remaining values are a standard geometry specification: x,y is the position of the top left corner of the window, and w,h is the width and height of the window

If you want to bind the commands to keyboard shortcuts use sh -c
eg

sh -c "width=$(xdpyinfo | awk '/dimensions:/{print $2}' | cut -f 1 -d 'x') && half=$(($width/2)) && wmctrl -r :ACTIVE: -b add,maximized_vert && wmctrl -r :ACTIVE: -e 0,0,0,$half,-1"

I find the best way is to use mouse gestures with easystroke because you focus the window as you do the gesture.

monkeybrain20122
April 26th, 2014, 06:12 AM
Since there is no gtk-window-decorator in lubuntu you need to either install it (not sure if possible) or get emerald.

icu12345
April 26th, 2014, 09:37 AM
...

This is so cool!! Thanks for the tip ;)
I can use Easystroke also for a bunch of other useful stuff which is awesome

Is there a way to unsnap a window? So that the window returns to its original size and position. There is a workaround to maximize the window and then unmaximize it bur there must be a better way to do it...

grumblebum2
April 26th, 2014, 11:00 AM
When the window is tiled to half the screen I don't know how to return to original size and position because it's only toggling maximized_vert.
You could change the max/unmax command to only toggle maximized_vert and then set the window to a certain position and size.
Would only work for unmaximizing windows tiled left or right, not for a fully maximized window.
eg

wmctrl -r :ACTIVE: -b toggle,maximized_vert && wmctrl -r :ACTIVE: -e 0,450,260,860,560
So you would use the original commands from the first post to tile left or right and then the above would return the window to a set size and position.

Tip for easystroke is to set the gesture button to 3....ie the right button.