Results 1 to 10 of 13

Thread: "Aero Snap" in openbox

Hybrid View

  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
    May 2008
    Beans
    1

    Re: "Aero Snap" in openbox

    Hello,
    it's been quite a while but i'm really interested in what you said about programs remembering their last size and position.
    How can you get those variables in order to use them ?

    ty

    Quote Originally Posted by kyruz View Post
    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

  9. #9
    Join Date
    Jan 2013
    Beans
    1

    Re: "Aero Snap" in openbox

    There's a tool that brings actual aero snapping to openbox. So that the windows tile if you drag them to the edge of the screen. Check out opensnap
    Full disclosure: Shameless advertisment, I wrote it.

  10. #10
    Join Date
    Dec 2004
    Beans
    260

    Re: "Aero Snap" in openbox

    On a general note. This isn't "aero snapping". It's called tiling, manual at that.

    Suggestion to the original poster: Use percents for your values, and you should get a configuration that'll work on any size screen.

    I may eventually publish my own setup if I ever get around to it, but for now you can read more on this at:

    http://urukrama.wordpress.com/2011/1...ng-in-openbox/
    http://ubuntuforums.org/showpost.php...6&postcount=18
    http://crunchbanglinux.org/forums/to...manual-tiling/
    http://crunchbanglinux.org/forums/post/58722/#p58722
    http://urukrama.wordpress.com/2011/1...ng-in-openbox/

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
  •