You are not logged in.

#1 2019-07-17 09:37:26

Uooops
Member
Registered: 2019-07-08
Posts: 7

A bit more of tiling in OB

I've written this keybinds configuration to tile windows in bunsen.

    <keybind key="W-w">
      <action name="If">
        <query>
          <maximizedvertical>true</maximizedvertical>
        </query>
        <then>
          <action name="UnMaximizeVert"/>
          <action name="MoveResizeTo">
            <height>50%</height>
            <y>o</y>
          </action>
        </then>
        <else>
          <action name="MaximizeVert"/>
        </else>
      </action>
    </keybind>
    <keybind key="W-s">
      <action name="If">
        <query>
          <maximizedvertical>true</maximizedvertical>
        </query>
        <then>
          <action name="UnMaximizeVert"/>
          <action name="MoveResizeTo">
            <height>50%</height>
            <y>-o</y>
          </action>
        </then>
        <else>
          <action name="MaximizeVert"/>
        </else>
      </action>
    </keybind>
    <keybind key="W-a">
      <action name="If">
        <query>
          <maximizedhorizontal>true</maximizedhorizontal>
        </query>
        <then>
          <action name="UnMaximizeHorz"/>
          <action name="MoveResizeTo">
            <width>50%</width>
            <x>0</x>
          </action>
        </then>
        <else>
          <action name="MaximizeHorz"/>
        </else>
      </action>
    </keybind>
    <keybind key="W-d">
      <action name="If">
        <query>
          <maximizedhorizontal>true</maximizedhorizontal>
        </query>
        <then>
          <action name="UnMaximizeHorz"/>
          <action name="MoveResizeTo">
            <width>50%</width>
            <x>-0</x>
          </action>
        </then>
        <else>
          <action name="MaximizeHorz"/>
        </else>
      </action>
    </keybind>

The idea comes from this post in this forum which tiles the windows with the numpads, but as I haven't got a numpad I've set keybinds to resize and move windows with "wasd" keys or arrows instead, trying to make the transition from half to quarters easier.

I'm trying to tile other windows automatically using "NextWindow" and "PreviousWindow" but I'm finding a lot of problems.

Hope this would be useful for somebody.

Edit: Video

Last edited by Uooops (2019-07-19 01:52:33)

Offline

#2 2019-07-17 14:50:33

tynman
Member
Registered: 2015-10-13
Posts: 81

Re: A bit more of tiling in OB

That's an awesome tip -- I'm not so much interested in tiling (although certainly interested enough to look at this thread), but I had not seen the "IF" action in Openbox before. I'm pretty sure that will come in handy smile.

Offline

#3 2019-07-17 20:00:44

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 1,799
Website

Re: A bit more of tiling in OB

Wasn't aware there was 'if' either, thanks for sharing.
Edit: Trying a little tiling/window moving revision, removed all the stuff I don't use daily.

Last edited by brontosaurusrex (2019-07-17 21:15:15)

Offline

#4 2019-07-19 01:58:36

Uooops
Member
Registered: 2019-07-08
Posts: 7

Re: A bit more of tiling in OB

Hi all!

I've made some changes to add keybinds for moving windows around. It works fine up to 3 windows as you can see in the video above. With more it gets a mess. I'll go on thinking how to solve it.

Those are the new keybinds:

<keybind key="W-A-w">
		<action name="If">
			<query>
				<maximizedvertical>true</maximizedvertical>
			</query>
			<then></then>
			<else>
				<action name="MoveResizeTo">
					<y>o</y>
				</action>
				<action name="NextWindow">
					<interactive>no</interactive>
					<dialog>none</dialog>
					<finalactions>
						<action name="MoveResizeTo">
							<y>-o</y>
						</action>
					</finalactions>
				</action>
				<action name="PreviousWindow">
					<interactive>no</interactive>
					<dialog>none</dialog>
					<finalactions>
						<action name="MoveResizeTo">
							<y>-o</y>
						</action>
					</finalactions>
				</action>
			</else>
		</action>
    </keybind>
    <keybind key="W-A-s">
		<action name="If">
			<query>
				<maximizedvertical>true</maximizedvertical>
			</query>
			<then></then>
			<else>
				<action name="MoveResizeTo">
					<y>-o</y>
				</action>
				<action name="NextWindow">
					<interactive>no</interactive>
					<dialog>none</dialog>
					<finalactions>
						<action name="MoveResizeTo">
							<y>o</y>
						</action>
					</finalactions>
				</action>
				<action name="PreviousWindow">
					<interactive>no</interactive>
					<dialog>none</dialog>
					<finalactions>
						<action name="MoveResizeTo">
							<y>o</y>
						</action>
					</finalactions>
				</action>
			</else>
		</action>
    </keybind>
    <keybind key="W-A-a">
		<action name="If">
			<query>
				<maximizedhorizontal>true</maximizedhorizontal>
			</query>
			<then></then>
			<else>
				<action name="MoveResizeTo">
					<x>o</x>
				</action>
				<action name="NextWindow">
					<interactive>no</interactive>
					<dialog>none</dialog>
					<finalactions>
						<action name="MoveResizeTo">
							<x>-o</x>
						</action>
					</finalactions>
				</action>
				<action name="PreviousWindow">
					<interactive>no</interactive>
					<dialog>none</dialog>
					<finalactions>
						<action name="MoveResizeTo">
							<x>-o</x>
						</action>
					</finalactions>
				</action>
			</else>
		</action>
    </keybind>
     <keybind key="W-A-d">
		<action name="If">
			<query>
				<maximizedhorizontal>true</maximizedhorizontal>
			</query>
			<then></then>
			<else>
				<action name="MoveResizeTo">
					<x>-o</x>
				</action>
				<action name="NextWindow">
					<interactive>no</interactive>
					<dialog>none</dialog>
					<finalactions>
						<action name="MoveResizeTo">
							<x>o</x>
						</action>
					</finalactions>
				</action>
				<action name="PreviousWindow">
					<interactive>no</interactive>
					<dialog>none</dialog>
					<finalactions>
						<action name="MoveResizeTo">
							<x>o</x>
						</action>
					</finalactions>
				</action>
			</else>
		</action>
    </keybind>

and this is the video again: https://youtu.be/OxnUV3nIIc0

Enjoy

Offline

#5 2019-07-31 02:55:28

Uooops
Member
Registered: 2019-07-08
Posts: 7

Re: A bit more of tiling in OB

New advances on tiling: https://youtu.be/91VR3lo1L1c

Now I can move all the windows at the same time using W + wasd keys and get them tiled automatically.

	<!--moving focused window up-->
	<keybind key="W-w">
		<action name="If">
			<query><maximizedvertical>true</maximizedvertical></query>
			<then>
				<action name="UnMaximizeVert"/>
				<action name="PreviousWindow">
					<interactive>no</interactive>
					<dialog>none</dialog>
					<finalactions>
						<action name="UnMaximizeVert"/>
						<action name="MoveResizeTo">
							<height>50%</height>
							<x>-o</x>
							<y>-o</y>
						</action>
					</finalactions>
				</action>
				<action name="MoveResizeTo">
					<height>50%</height>
					<y>o</y>
				</action>
				<action name="NextWindow">
					<interactive>no</interactive>
					<dialog>none</dialog>
					<finalactions>
						<action name="UnMaximizeVert"/>
						<action name="MoveResizeTo">
							<height>50%</height>
							<x>0</x>
							<y>-o</y>
						</action>
					</finalactions>
					</action>
			</then>
			<else>
				<action name="MaximizeVert"/>
			</else>
		</action>
    </keybind>  
    <!--moving focused window down-->     
    <keybind key="W-s">
		<action name="If">
			<query><maximizedvertical>true</maximizedvertical></query>
			<then>
				<action name="UnMaximizeVert"/>
				<action name="PreviousWindow">
					<interactive>no</interactive>
					<dialog>none</dialog>
					<finalactions>
						<action name="UnMaximizeVert"/>
						<action name="MoveResizeTo">
							<height>50%</height>
							<x>-o</x>
							<y>o</y>
						</action>
					</finalactions>
				</action>
				<action name="MoveResizeTo">
					<height>50%</height>
					<y>-o</y>
				</action>
				<action name="NextWindow">
					<interactive>no</interactive>
					<dialog>none</dialog>
					<finalactions>
						<action name="UnMaximizeVert"/>
						<action name="MoveResizeTo">
							<height>50%</height>
							<x>0</x>
							<y>o</y>
						</action>
					</finalactions>
				</action>
			</then>
			<else>
				<action name="MaximizeVert"/>
			</else>
		</action>
    </keybind>
    <!--moving focused window left-->
    <keybind key="W-a">
		<action name="If">
			<query><maximizedhorizontal>true</maximizedhorizontal></query>
			<then>
				<action name="UnMaximizeHorz"/>
				<action name="PreviousWindow">
					<interactive>no</interactive>
					<dialog>none</dialog>
					<finalactions>
						<action name="UnMaximizeHorz"/>
						<action name="MoveResizeTo">
							<width>50%</width>
							<x>-o</x>
							<y>-0</y>
						</action>
					</finalactions>
				</action>
				<action name="MoveResizeTo">
					<width>50%</width>
					<x>o</x>
				</action>
				<action name="NextWindow">
					<interactive>no</interactive>
					<dialog>none</dialog>
					<finalactions>
						<action name="UnMaximizeHorz"/>
						<action name="MoveResizeTo">
							<width>50%</width>
							<x>-o</x>
							<y>0</y>
						</action>
					</finalactions>
				</action>
			</then>
			<else>
				<action name="MaximizeHorz"/>
			</else>
		</action>
    </keybind>
    <!--moving focused window right-->
    <keybind key="W-d">
		<action name="If">
			<query><maximizedhorizontal>true</maximizedhorizontal></query>
			<then>
				<action name="UnMaximizeHorz"/>
				<action name="PreviousWindow">
					<interactive>no</interactive>
					<dialog>none</dialog>
					<finalactions>
						<action name="UnMaximizeHorz"/>
						<action name="MoveResizeTo">
							<width>50%</width>
							<x>o</x>
							<y>-0</y>
						</action>
					</finalactions>
				</action>
				<action name="MoveResizeTo">
					<width>50%</width>
					<x>-o</x>
				</action>
				<action name="NextWindow">
					<interactive>no</interactive>
					<dialog>none</dialog>
					<finalactions>
						<action name="UnMaximizeHorz"/>
						<action name="MoveResizeTo">
							<width>50%</width>
							<x>o</x>
							<y>0</y>
						</action>
					</finalactions>
				</action>
			</then>
			<else>
				<action name="MaximizeHorz"/>
			</else>
		</action>
    </keybind>

I've got problems managing more than 3 windows because I can't get how to select windows effectively unless I use NextWindow or PreviousWindow tags.

Any idea is welcome, I'm blocked.

Offline

#6 2019-08-04 16:43:13

ohnonot
...again
Registered: 2015-09-29
Posts: 3,842
Website

Re: A bit more of tiling in OB

Thank you Uooops, looks good.
I am subscribing to this thread...

Offline

Board footer

Powered by FluxBB