Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add grid properties, movement and resizing #57

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ install: all
install $(__NAME__) "$(DESTDIR)$(PREFIX)/bin/$(__NAME__)"
install $(__NAME_CLIENT__) "$(DESTDIR)$(PREFIX)/bin/$(__NAME_CLIENT__)"
mkdir -p "$(DESTDIR)$(DOCPREFIX)/$(__NAME__)/"
cp -fR contrib "$(DESTDIR)$(DOCPREFIX)/$(__NAME__)/"
cp -fR examples "$(DESTDIR)$(DOCPREFIX)/$(__NAME__)/"
cp -f README.md LICENSE "$(DESTDIR)$(DOCPREFIX)/$(__NAME__)/"
cd ./man; $(MAKE) install

Expand Down
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ Features
* cwm-like window groups
* Add or remove windows to a group
* Activate/Deactivate/Toggle a group
* groups can be "sticky": windows are assigned to the currently
selected group automatically
* Mouse support
* Focus, move and resize windows with the mouse
* Supports window resize hints
Expand Down Expand Up @@ -134,9 +132,6 @@ at the same time.
Windowchef allows you to add/remove windows to/from groups, show groups, hide
groups or toggle them.

You can also activate *sticky group mode*. When activated, new windows are
automatically assigned to the currently selected group. Together with the `group_activate_specific` command (see `waitron(1)`), a workspace-like workflow can be achieved.

### Virtual grids

You can tell windowchef to move and resize a window so it can fit in a cell
Expand Down
1 change: 0 additions & 1 deletion TODO.md

This file was deleted.

3 changes: 2 additions & 1 deletion client.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ static struct Command c[] = {
{ "window_monocle" , IPCWindowMonocle , 0 , NULL } ,
{ "window_close" , IPCWindowClose , 0 , NULL } ,
{ "window_put_in_grid" , IPCWindowPutInGrid , 6 , fn_hack } ,
{ "window_move_in_grid" , IPCWindowMoveInGrid , 2 , fn_offset } ,
{ "window_resize_in_grid" , IPCWindowResizeInGrid , 2 , fn_offset } ,
{ "window_snap" , IPCWindowSnap , 1 , fn_position } ,
{ "window_cycle" , IPCWindowCycle , 0 , NULL } ,
{ "window_rev_cycle" , IPCWindowRevCycle , 0 , NULL } ,
Expand Down Expand Up @@ -96,7 +98,6 @@ static struct ConfigEntry configs[] = {
{ "groups_nr" , IPCConfigGroupsNr , 1 , fn_naturals },
{ "enable_sloppy_focus" , IPCConfigEnableSloppyFocus , 1 , fn_bool },
{ "enable_resize_hints" , IPCConfigEnableResizeHints , 1 , fn_bool },
{ "sticky_windows" , IPCConfigStickyWindows , 1 , fn_bool },
{ "enable_borders" , IPCConfigEnableBorders , 1 , fn_bool },
{ "enable_last_window_focusing", IPCConfigEnableLastWindowFocusing, 1 , fn_bool },
{ "apply_settings" , IPCConfigApplySettings , 1 , fn_bool },
Expand Down
2 changes: 0 additions & 2 deletions contrib/.gitignore

This file was deleted.

56 changes: 0 additions & 56 deletions examples/sxhkdrc

This file was deleted.

25 changes: 0 additions & 25 deletions examples/windowchefrc

This file was deleted.

3 changes: 2 additions & 1 deletion ipc.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ enum IPCCommand {
IPCWindowMonocle,
IPCWindowClose,
IPCWindowPutInGrid,
IPCWindowMoveInGrid,
IPCWindowResizeInGrid,
IPCWindowSnap,
IPCWindowCycle,
IPCWindowRevCycle,
Expand Down Expand Up @@ -54,7 +56,6 @@ enum IPCConfig {
IPCConfigGroupsNr,
IPCConfigEnableSloppyFocus,
IPCConfigEnableResizeHints,
IPCConfigStickyWindows,
IPCConfigEnableBorders,
IPCConfigEnableLastWindowFocusing,
IPCConfigApplySettings,
Expand Down
14 changes: 9 additions & 5 deletions man/waitron.1
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ Closes the focused window\.
Moves and resizes the focused windows accordingly to fit in a cell defined by the \fIcell_x\fR and \fIcell_y\fR coordinates, measuring \fIcell_width\fR in width and \fIcell_height\fR in height, in a virtual grid with width \fIgrid_width\fR and height \fIgrid_height\fR on the current monitor\. \fIcell_width\fR and \fIcell_height\fR are expressed in grid cells\. Gaps around the windows in the grid can be added along with monitor gaps\.
.
.TP
\fBwindow_move_in_grid\fR \fIx\fR \fIy\fR
Move a gridded window by \fIx\fR and \fIy\fR grid spaces.
.
.TP
\fBwindow_resize_in_grid\fR \fIx\fR \fIy\fR
Resize a gridded window by \fIx\fR and \fIy\fR grid spaces.
.
.TP
\fBwindow_snap\fR \fIPOSITION\fR
Snap the window on the screen in a position defined by \fIPOSITION\fR\.
.
Expand Down Expand Up @@ -213,7 +221,7 @@ On the root window\. An integer list of currently active groups\.
.
.TP
\fBWINDOWCHEF_STATUS\fR
On each managed window\. Contains information about the window\. Notable properties: \fBgroup\fR is \-1 if the window is not in a group\. \fBstate\fR can have one of the following values: \fBnormal\fR, \fBmaxed\fR, \fBvmaxed\fR, \fBhmaxed\fR, \fBmonocled\fR\.
On each managed window\. Contains information about the window\. Notable properties: \fBgroup\fR is \-1 if the window is not in a group\. \fBstate\fR can have one of the following values: \fBnormal\fR, \fBmaxed\fR, \fBvmaxed\fR, \fBhmaxed\fR, \fBmonocled\fR\, \fBgridded\fR.
.
.SH "CONFIGURING"
Configuring is done using the \fBwm_config\fR command\. Possible configuration keys are:
Expand Down Expand Up @@ -259,10 +267,6 @@ If true, \fBwindowchef\fR will respect window resize hints as defined by ICCCM\.
Enable sloppy focus\.
.
.TP
\fBsticky_windows\fR \fIBOOL\fR
If \fIsticky_windows\fR is true, new windows will be assigned to the last activated group automatically\. Recommended for people who like using workspaces over groups\.
.
.TP
\fBenable_borders\fR \fIBOOL\fR
If true, the border will be fully managed by the window manager\. Border colors will be set each time a window gets/loses focus\. Setting it to false lets the user manage the border of every window using external tools\. (example: \fBchwb2\fR from wmutils)\.
.
Expand Down
3 changes: 0 additions & 3 deletions man/waitron.1.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions man/waitron.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ anything on `stdout`.
<cell_width> and <cell_height> are expressed in grid cells.
Gaps around the windows in the grid can be added along with monitor gaps.

* `window_move_in_grid` <x> <y>:
Move a gridded window by <x> and <y> grid spaces.

* `window_resize_in_grid` <x> <y>:
Resize a gridded window by <x> and <y> grid spaces.

* `window_snap` <POSITION>:
Snap the window on the screen in a position defined by <POSITION>.

Expand Down Expand Up @@ -178,7 +184,7 @@ Here is a list of exposed properties:
Notable properties:
`group` is -1 if the window is not in a group.
`state` can have one of the following values: `normal`, `maxed`, `vmaxed`,
`hmaxed`, `monocled`.
`hmaxed`, `monocled`, `gridded`.

## CONFIGURING

Expand Down Expand Up @@ -224,11 +230,6 @@ are:
* `enable_sloppy_focus` <BOOL>:
Enable sloppy focus.

* `sticky_windows` <BOOL>:
If <sticky_windows> is true, new windows will be assigned to the last
activated group automatically. Recommended for people who like using
workspaces over groups.

* `enable_borders` <BOOL>:
If true, the border will be fully managed by the window manager. Border colors will
be set each time a window gets/loses focus. Setting it to false lets
Expand Down
10 changes: 8 additions & 2 deletions types.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,18 @@ struct window_geom {
bool set_by_user;
};

struct grid {
int16_t gx, gy;
int16_t px, py;
int16_t sx, sy;
};

struct client {
xcb_window_t window;
struct window_geom geom;
struct window_geom orig_geom;
bool maxed, hmaxed, vmaxed, monocled;
struct grid grid;
bool maxed, hmaxed, vmaxed, monocled, gridded;
struct list_item *item;
struct list_item *focus_item;
struct monitor *monitor;
Expand All @@ -94,7 +101,6 @@ struct conf {
uint32_t groups;
bool sloppy_focus;
bool resize_hints;
bool sticky_windows;
bool borders;
bool last_window_focusing;
bool apply_settings;
Expand Down
Loading