Skip to content

xhsdf/ctile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Manual Tiling and Window Placement

Replacement for rtile.

Demo

Demo using Openbox

Modes

--all

Tile all windows on screen.

--all-active

Tile all windows on the same monitor as the active window.

--all-monitor-(id)

Tile all windows on monitor id. Ids start at 1 at the left-most monitor.

--all-split

Tile all windows on screen and make every window half as big as the previous.

--all-split-active

Tile all windows on the same monitor as the active window and make every window half as big as the previous.

--all-split-monitor-(id)

Tile all windows on monitor id and make every window half as big as the previous. Ids start at 1 at the left-most monitor.

--top, --top-left, --top-right, --bottom, --bottom-left, --bottom-right, --left, --right, --full

Move active window to edges.

--split-(up|down|left|right)

Split active window (either in half or using all windows occupying the same space).

--split

Split active window (either in half or using all windows occupying the same space). The direction is determined by window geometry.

--grow-(up|down|left|right)

Grow active window to the nearest edge (window or screen) of a direction.

--grow

Grow active window to the nearest edge (window or screen) in all directions.

--grid-(c)x(r)-(x),(y)

Place active window at x,y in a grid of c columns and r rows.

Example 1: --grid-3x3-2,2 will place the window in the middle of a 3x3 grid.
Example 2: --grid-2x2-2,1 is the same as ctile --top-right.

--swap

Swap the position of the last two active windows.

--swap-biggest

Swap the position of the active window with the biggest window on the same screen.

--cycle

Cycle the positions of all windows on screen.

--next-monitor

Move active window to the next monitor.

--cycle-monitors

Move all windows on screen to their next monitor.

--no-config-file

Do not load the config file.

--add-to-config

Adds elements to the config (does not write them to the config file).

Example 1: --add-to-config='<gaps bottom="42"/>' sets the bottom gap.
Example 2: --add-to-config='<column_config windows="3" monitor="1" column_sizes="2, 1"/>' adds a column config.
Example 3: --add-to-config='<column_config windows="3" monitor="1" column_sizes="2, 1"/><gaps bottom="42"/>' adds a column config and sets the bottom gap.

--print-window-info

Shows info for valid windows on the current workspace.

--print-monitor-info

Shows info for active monitors.

--version

Show version.

Features

  • Configurable gaps between windows in all operating modes.
  • Settings per workspace, monitor and window class.

Settings

When ctile is run it will look for a config file in $HOME/.config/ctile/ctile.xml.

Gap Settings

top, bottom, left, right

Space between windows and screen edges.

windows_horz

Horizontal space between windows.

windows_vert

Vertical space between windows.

Tiling Settings

Mirror settings are only relevant for automatic tiling.

workspace

Workspace the config applies to. Applies to all workspaces if not specified. Ids start at 1.

monitor

Monitor the config applies to. Applies to all workspaces if not specified. Ids start at 1 at the left-most monitor.

main_mult

Multiplier that determines how much width the main column takes up. (default = 1.0)

mirror_horz

true: The main window is placed on the right.

mirror_vert

true: Windows are placed from the bottom up.

Window Settings

Window settings are only relevant when tiling all windows.

class

Window class (e.g. "firefox" or "mpv").

workspace

Workspace the config applies to. Applies to all workspaces if not specified. Ids start at 1.

monitor

Monitor the config applies to. Applies to all workspaces if not specified. Ids start at 1 at the left-most monitor.

priority

Priority determines the order windows are placed in. Higher priority windows get placed first. (default = 1)

floating

true: Window will be ignored.

Virtual Monitors

Split monitors into multiple virtual monitors.

monitor

Monitor to be split. Ids start at 1 with the left-most monitor.

workspace

Workspace the split applies to. Applies to all workspaces if not specified. Ids start at 1.

horz

Number of virtual horizontal monitors to split into.

vert

Number of virtual vertical monitors to split into.

Example: <split_monitor monitor="1" horz="2"/>: Splits the first monitor horizontally into 2 virtual monitors

Custom Column Configs

Manually specify where windows should be placed when tiling all windows.

windows

Number of windows the config applies to.

workspace

Workspace the config applies to. Applies to all workspaces if not specified. Ids start at 1.

monitor

Monitor the config applies to. Applies to all workspaces if not specified. Ids start at 1 at the left-most monitor.

column_sizes

Array of column sizes.
Example: column_sizes="1, 3" will make 2 columns. The first will have 1 window and the second will have 3 windows.

Example Config

The config file must be placed at ~/.config/ctile/ctile.xml

<?xml version="1.0" encoding="UTF-8"?>
<settings>
	<gaps top="20" bottom="20" left="20" right="20" windows_horz="20" windows_vert="20"/>

	<!--<tiling workspace="<id>" monitor="<id>" main_mult="1.0" mirror_horz="true|false" mirror_vert="true|false"/>-->
	<tiling monitor="1" main_mult="1.2"/>
	<tiling workspace="3" mirror_horz="true" main_mult="1.0"/>

	<!--<window class="<class>" priority="1" workspace="<id>" monitor="<id>"/>-->
	<window class="mpv" floating="true"/>
	<window class="firefox" priority="9"/>
	<window class="firefox" workspace="3" priority="-2"/>
	<window class="geany" priority="3"/>
	<window class="nemo" priority="2"/>
	<window class="terminal" priority="-1"/>

	<split_monitor monitor="1" workspace="2" horz="2" vert="1"/>

	<!--<column_config windows="<window_count>" workspace="<id>" monitor="<id>" column_sizes="<columns>"/>-->
	<column_config windows="1" column_sizes="1"/>
	<column_config windows="2" column_sizes="1, 1"/>
	<column_config windows="3" column_sizes="1, 2"/>
	<column_config windows="4" column_sizes="1, 3"/>
	<column_config windows="4" column_sizes="2, 2" monitor="2" workspace="2"/>
	<column_config windows="5" column_sizes="2, 3"/>
	<column_config windows="6" column_sizes="2, 4"/>
	<column_config windows="7" column_sizes="1, 2, 4"/>
	<column_config windows="8" column_sizes="1, 3, 4"/>
	<column_config windows="9" column_sizes="1, 4, 4"/>
	<column_config windows="10" column_sizes="2, 4, 4"/>
</settings>

Example Keybindings for Openbox using the Keypad

<keybind key="C-W-KP_8">
	<action name="Execute">
		<command>ctile --split-up</command>
	</action>
</keybind>
<keybind key="C-W-KP_2">
	<action name="Execute">
		<command>ctile --split-down</command>
	</action>
</keybind>
<keybind key="C-W-KP_4">
	<action name="Execute">
		<command>ctile --split-left</command>
	</action>
</keybind>
<keybind key="C-W-KP_6">
	<action name="Execute">
		<command>ctile --split-right</command>
	</action>
</keybind>
<keybind key="C-W-KP_0">
	<action name="Execute">
		<command>ctile --swap</command>
	</action>
</keybind>
<keybind key="C-W-KP_5">
	<action name="Execute">
		<command>ctile --next-monitor</command>
	</action>
</keybind>

<keybind key="S-W-KP_8">
	<action name="Execute">
		<command>ctile --grow-up</command>
	</action>
</keybind>
<keybind key="S-W-KP_2">
	<action name="Execute">
		<command>ctile --grow-down</command>
	</action>
</keybind>
<keybind key="S-W-KP_4">
	<action name="Execute">
		<command>ctile --grow-left</command>
	</action>
</keybind>
<keybind key="S-W-KP_6">
	<action name="Execute">
		<command>ctile --grow-right</command>
	</action>
</keybind>
<keybind key="S-W-KP_0">
	<action name="Execute">
		<command>ctile --cycle</command>
	</action>
</keybind>
<keybind key="S-W-KP_5">
	<action name="Execute">
		<command>ctile --cycle-monitors</command>
	</action>
</keybind>

<keybind key="W-KP_8">
	<action name="Execute">
		<command>ctile --top</command>
	</action>
</keybind>
<keybind key="W-KP_5">
	<action name="Execute">
		<command>ctile --full</command>
	</action>
</keybind>
<keybind key="W-KP_2">
	<action name="Execute">
		<command>ctile --bottom</command>
	</action>
</keybind>
<keybind key="W-KP_7">
	<action name="Execute">
		<command>ctile --top-left</command>
	</action>
</keybind>
<keybind key="W-KP_4">
	<action name="Execute">
		<command>ctile --left</command>
	</action>
</keybind>
<keybind key="W-KP_1">
	<action name="Execute">
		<command>ctile --bottom-left</command>
	</action>
</keybind>
<keybind key="W-KP_9">
	<action name="Execute">
		<command>ctile --top-right</command>
	</action>
</keybind>
<keybind key="W-KP_6">
	<action name="Execute">
		<command>ctile --right</command>
	</action>
</keybind>
<keybind key="W-KP_3">
	<action name="Execute">
		<command>ctile --bottom-right</command>
	</action>
</keybind>
<keybind key="W-KP_0">
	<action name="Execute">
		<command>ctile --split</command>
	</action>
</keybind>

About

C program for manual tiling and window placement in X11

Resources

Stars

Watchers

Forks

Contributors

Languages