Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: "Aero Snap" in openbox

  1. #1
    Join Date
    Jan 2010
    Location
    Las Vegas
    Beans
    37
    Distro
    Ubuntu Development Release

    "Aero Snap" in openbox

    alright, if this is old new's then i'm sorry, but I've just found out how to set something up in open box that's been driving me insane for a while now. I personally enjoy windows "Aero Snap" features for web work, makes it easier to code and view, heres how to do it in openbox.
    Steps

    1) launch a terminal and place this code in it

    Code:
    (text Editor) ~/.config/openbox/rc.xml
    2) go down to the end of the key bindings section, right before the mouse binds begin. (this is where were going to declare the binds for the "Snap" feature.

    3)paste these binds in after the last key bind, but before the </keyboard> tag.

    Code:
        <keybind key="W-Tab">
            <action name="MoveResizeTo">
    		<x>0</x>
    		<y>0</y>
    		<width>640</width>
    		<height>970</height>
            </action>
        </keybind>
        <keybind key="C-Tab">
            <action name="MoveResizeTo">
    		<x>640</x>
    		<y>0</y>
    		<width>640</width>
    		<height>970</height>
            </action>
        </keybind>
    4) Change the widths and heights to the dimensions of your monitor, in addition to that, you'll also need to change the X position. This is currently set up for a 1280x1040 resolution display.





    Here is a few common resolutions that I've set up for copy and paste.



    800x600
    Code:
        <keybind key="W-Tab">
            <action name="MoveResizeTo">
    		<x>0</x>
    		<y>0</y>
    		<width>300</width>
    		<height>600</height>
            </action>
        </keybind>
        <keybind key="C-Tab">
            <action name="MoveResizeTo">
    		<x>300</x>
    		<y>0</y>
    		<width>300</width>
    		<height>600</height>
            </action>
        </keybind>
    1024x768
    Code:
        <keybind key="W-Tab">
            <action name="MoveResizeTo">
    		<x>0</x>
    		<y>0</y>
    		<width>512</width>
    		<height>768</height>
            </action>
        </keybind>
        <keybind key="C-Tab">
            <action name="MoveResizeTo">
    		<x>512</x>
    		<y>0</y>
    		<width>512</width>
    		<height>768</height>
            </action>
        </keybind>
    1280x720
    Code:
        <keybind key="W-Tab">
            <action name="MoveResizeTo">
    		<x>0</x>
    		<y>0</y>
    		<width>640</width>
    		<height>720</height>
            </action>
        </keybind>
        <keybind key="C-Tab">
            <action name="MoveResizeTo">
    		<x>640</x>
    		<y>0</y>
    		<width>640</width>
    		<height>720</height>
            </action>
        </keybind>
    1280x1040
    Code:
        <keybind key="W-Tab">
            <action name="MoveResizeTo">
    		<x>0</x>
    		<y>0</y>
    		<width>640</width>
    		<height>970</height>
            </action>
        </keybind>
        <keybind key="C-Tab">
            <action name="MoveResizeTo">
    		<x>640</x>
    		<y>0</y>
    		<width>640</width>
    		<height>970</height>
            </action>
        </keybind>


    ill post up more resolutions later if people are interested. Its late here and i need some sleep.
    Computer Specs:
    ----1gb DDR1 SDRAM
    ----Intel Celeron D 3.06ghz
    ----Nvidia 6200 GT Gigabyte

  2. #2
    Join Date
    Jun 2008
    Beans
    7

    Re: "Aero Snap" in openbox

    sadly this won't save the window-size for later "unsnapping"

    is it possible to achieve that with openbox?

  3. #3
    Join Date
    Apr 2011
    Beans
    24

    Re: "Aero Snap" in openbox

    I'm interested in remembering the old sizes as well.

  4. #4
    Join Date
    Nov 2006
    Location
    Norway
    Beans
    10
    Distro
    The Feisty Fawn Testing

    Re: "Aero Snap" in openbox

    I have a laptop with 1920x1200 screen resolution and I use "window tiling" in openbox alot.

    Programs remember their last size and position....

    Ctrl, Windows, Alt+Arrow keys and Alt+Tab is your friend.

    Code:
    #  WINDOWTILING
    
        <!-- Window pseudotiling -->
        <keybind key="W-Left">		# HalfLeftScreen	
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>0</x>
            <y>0</y>
            <width>955</width>
            <height>1150</height>
          </action>
        </keybind>
        <keybind key="W-Right">		# HalfRightScreen
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>-0</x>
            <y>0</y>
            <width>955</width>
            <height>1150</height>
          </action>
        </keybind>
        <keybind key="W-Up">		                # HalfUpperScreen
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>0</x>
            <y>0</y>
            <width>1920</width>
            <height>555</height>
          </action>
        </keybind>
        <keybind key="W-Down">		# HalfLowerScreen
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>0</x>
            <y>-0</y>
            <width>1920</width>
            <height>555</height>
          </action>
        </keybind>
        <keybind key="C-Left">		# QuartLowerLeftScreen
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>0</x>
            <y>-0</y>
            <width>955</width>
            <height>560</height>
          </action>
        </keybind>
        <keybind key="C-Down">		# QuartLowerRightScreen
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>-0</x>
            <y>-0</y>
            <width>955</width>
            <height>560</height>
          </action>
        </keybind>
        <keybind key="C-Up">		                # QuartUpperLeftScreen
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>0</x>
            <y>0</y>
            <width>955</width>
            <height>560</height>
          </action>
        </keybind>
        <keybind key="C-Right">		# QuartUpperRightScreen
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>-0</x>
            <y>0</y>
            <width>955</width>
            <height>560s</height>
          </action>
        </keybind>
        <keybind key="A-Right">		# FullScreen
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>center</x>
            <y>center</y>
            <width>1920</width>
            <height>1150</height>
          </action>
        </keybind>
        <keybind key="A-Left">		                 # MiddelScreen
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>center</x>
            <y>center</y>
            <width>1280</width>
            <height>1150</height>
          </action>
        </keybind>
    /y

  5. #5
    Join Date
    Dec 2011
    Beans
    Hidden!

    Re: "Aero Snap" in openbox

    nice one. respect & credits!
    please stick to the facts and be kind.
    what else can you do when you don't know each other.
    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . my avatar

  6. #6
    Join Date
    Nov 2011
    Beans
    11

    Re: "Aero Snap" in openbox

    Quote Originally Posted by kyruz View Post
    I have a laptop with 1920x1200 screen resolution and I use "window tiling" in openbox alot.
    I replaced the size in pixel with the size in percent:

    Code:
        <!-- Keybindings for window tiling -->
        <keybind key="W-Left">        # HalfLeftScreen
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>0</x>
            <y>0</y>
            <height>100%</height>
            <width>50%</width>
          </action>
        </keybind>
        <keybind key="W-Right">        # HalfRightScreen
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>-0</x>
            <y>0</y>
            <height>100%</height>
            <width>50%</width>
          </action>
        </keybind>
        <keybind key="W-Up">        # HalfUpperScreen
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>0</x>
            <y>0</y>
            <width>100%</width>
            <height>50%</height>
          </action>
        </keybind>
        <keybind key="W-Down">        # HalfLowerScreen
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>0</x>
            <y>-0</y>
            <width>100%</width>
            <height>50%</height>
          </action>
        </keybind>
        <keybind key="C-Left">        # QuartLowerLeftScreen
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>0</x>
            <y>-0</y>
            <width>50%</width>
            <height>50%</height>
          </action>
        </keybind>
        <keybind key="C-Right">        # QuartUpperRightScreen
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>-0</x>
            <y>0</y>
            <width>50%</width>
            <height>50%</height>
          </action>
        </keybind>
        <keybind key="C-Up">        # QuartUpperLeftScreen
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>0</x>
            <y>0</y>
            <width>50%</width>
            <height>50%</height>
          </action>
        </keybind>
        <keybind key="C-Down">        # QuartLowerRightScreen
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>-0</x>
            <y>-0</y>
            <width>50%</width>
            <height>50%</height>
          </action>
        </keybind>
        <keybind key="A-Right">        # FullScreen
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>0</x>
            <y>0</y>
            <width>100%</width>
            <height>100%</height>
          </action>
        </keybind>
        <keybind key="A-Left">        # MiddleScreen
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>center</x>
            <y>center</y>
            <width>50%</width>
            <height>50%</height>
          </action>
        </keybind>
    It works very well, but is not 100% accurate right now.

    I think I talk with the developers. Maybe they can help me to fix it.
    Last edited by ikem.krueger; August 22nd, 2012 at 12:15 AM.

  7. #7
    Join Date
    Nov 2011
    Beans
    11

    Re: "Aero Snap" in openbox

    I made another batch of keybindings for the keypad:

    Code:
        <!-- Keybindings for window tiling with the keypad -->
        <keybind key="W-KP_Left">        # HalfLeftScreen
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>0</x>
            <y>0</y>
            <height>100%</height>
            <width>50%</width>
          </action>
        </keybind>
        <keybind key="W-KP_Right">        # HalfRightScreen
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>-0</x>
            <y>0</y>
            <height>100%</height>
            <width>50%</width>
          </action>
        </keybind>
        <keybind key="W-KP_Up">        # HalfUpperScreen
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>0</x>
            <y>0</y>
            <width>100%</width>
            <height>50%</height>
          </action>
        </keybind>
        <keybind key="W-KP_Down">        # HalfLowerScreen
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>0</x>
            <y>-0</y>
            <width>100%</width>
            <height>50%</height>
          </action>
        </keybind>
        <keybind key="W-KP_End">        # QuartLowerLeftScreen
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>0</x>
            <y>-0</y>
            <width>50%</width>
            <height>50%</height>
          </action>
        </keybind>
        <keybind key="W-KP_Prior">        # QuartUpperRightScreen
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>-0</x>
            <y>0</y>
            <width>50%</width>
            <height>50%</height>
          </action>
        </keybind>
        <keybind key="W-KP_Home">        # QuartUpperLeftScreen
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>0</x>
            <y>0</y>
            <width>50%</width>
            <height>50%</height>
          </action>
        </keybind>
        <keybind key="W-KP_Next">        # QuartLowerRightScreen
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>-0</x>
            <y>-0</y>
            <width>50%</width>
            <height>50%</height>
          </action>
        </keybind>
        <keybind key="W-KP_Begin">        # MiddleScreen
          <action name="UnmaximizeFull"/>
          <action name="MoveResizeTo">
            <x>center</x>
            <y>center</y>
            <width>50%</width>
            <height>50%</height>
          </action>
        </keybind>
    The keys are as following:

    Code:
    <Win>+<1> Left lower corner
    <Win>+<4> Left half
    <Win>+<7> Left upper corner
    <Win>+<8> Upper half
    <Win>+<9> Right upper corner
    <Win>+<6> Right half
    <Win>+<3> Right lower corner
    <Win>+<2> Lower half
    <Win>+<5> Center
    They are resembling the positions of the window on the screen.

  8. #8
    Join Date
    Nov 2011
    Location
    Lawton, Oklahoma. USA.
    Beans
    86

    Re: "Aero Snap" in openbox

    This possible in Fluxbox, GNOME Shell, GNOME 2, MATE, Cinnamon, LXDE, Xfce, or KDE as well?

  9. #9
    Join Date
    Nov 2011
    Beans
    11

    Re: "Aero Snap" in openbox

    Quote Originally Posted by TeamRocket1233c View Post
    Is this possible in Fluxbox, Gnome Shell, Gnome 2, MATE, Cinnamon, LXDE, Xfce, or KDE as well?
    You need to distinguish between a desktop environment and a window manager.

    Desktop environments and it's window managers:

    • None: Fluxbox
    • LXDE: Openbox
    • Xfce: Xfwm
    • Gnome 2: Metacity
    • MATE: Mate-Window-Manager (a fork of Metacity)
    • Gnome Shell: Mutter
    • Cinnamon: Muffin (a fork of Mutter)
    • KDE: KWin

    For the desktop environments, either you find out where the window manager configuration files are and how to modify them.

    Or, and the by far easier way, you replace the default window manager with Openbox and use the configuration as described here.

    Install Openbox:
    Code:
    sudo apt-get install openbox openbox-themes obconf
    Replace default window manager:
    Code:
    update-alternatives --config x-window-manager
    Last edited by ikem.krueger; August 23rd, 2012 at 11:47 PM.

  10. #10
    Join Date
    Dec 2004
    Beans
    260

    Re: "Aero Snap" in openbox

    <Win>+<1> Left lower corner
    <Win>+<4> Left half
    <Win>+<7> Left upper corner
    <Win>+<8> Upper half
    <Win>+<9> Right upper corner
    <Win>+<6> Right half
    <Win>+<3> Right lower corner
    <Win>+<2> Lower half
    <Win>+<5> Center
    Those keys are normally assigned to access work-spaces directly.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •