From 8f1ac1ef2c77665e7c17eaa6a46ea1b6d68e5c22 Mon Sep 17 00:00:00 2001 From: progandy Date: Thu, 17 Dec 2015 22:28:41 +0100 Subject: sway: enable workspace selection by number --- include/workspace.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/workspace.h b/include/workspace.h index b916f715..c69ccdbb 100644 --- a/include/workspace.h +++ b/include/workspace.h @@ -10,6 +10,7 @@ extern char *prev_workspace_name; char *workspace_next_name(void); swayc_t *workspace_create(const char*); swayc_t *workspace_by_name(const char*); +swayc_t *workspace_by_number(const char*); bool workspace_switch(swayc_t*); swayc_t *workspace_output_next(); swayc_t *workspace_next(); -- cgit v1.2.3 From 76c520a04b09490591c8ca7f854592f2a7a50042 Mon Sep 17 00:00:00 2001 From: progandy Date: Fri, 18 Dec 2015 01:01:02 +0100 Subject: sway: insert numbered workspaces in order fixes #308 Ordered by number ascending, with insert before same numbers. Workspaces without numbers are appended at the end of the list. Example order: 1 2:named 3:the_second 3:the_first 9 FIRST_NAME SECOND_NAME ... --- include/layout.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/layout.h b/include/layout.h index 62e4c202..b7731031 100644 --- a/include/layout.h +++ b/include/layout.h @@ -24,6 +24,10 @@ int index_child(const swayc_t *child); // parent must be of type C_WORKSPACE or C_CONTAINER void add_child(swayc_t *parent, swayc_t *child); +// Adds child to parent at index, if parent has no focus, it is set to child +// parent must be of type C_WORKSPACE or C_CONTAINER +void insert_child(swayc_t *parent, swayc_t *child, int index); + // Adds child as floating window to ws, if there is no focus it is set to child. // ws must be of type C_WORKSPACE void add_floating(swayc_t *ws, swayc_t *child); -- cgit v1.2.3