mirror of
https://github.com/swaywm/sway.git
synced 2024-12-30 17:06:40 +01:00
Merge pull request #522 from mikkeloscar/workspace-layout
Add config option workspace_layout
This commit is contained in:
commit
91192e3c65
2 changed files with 24 additions and 1 deletions
|
@ -75,6 +75,7 @@ static sway_cmd cmd_splitv;
|
||||||
static sway_cmd cmd_sticky;
|
static sway_cmd cmd_sticky;
|
||||||
static sway_cmd cmd_workspace;
|
static sway_cmd cmd_workspace;
|
||||||
static sway_cmd cmd_ws_auto_back_and_forth;
|
static sway_cmd cmd_ws_auto_back_and_forth;
|
||||||
|
static sway_cmd cmd_workspace_layout;
|
||||||
|
|
||||||
static sway_cmd bar_cmd_binding_mode_indicator;
|
static sway_cmd bar_cmd_binding_mode_indicator;
|
||||||
static sway_cmd bar_cmd_bindsym;
|
static sway_cmd bar_cmd_bindsym;
|
||||||
|
@ -1982,6 +1983,24 @@ static struct cmd_results *cmd_workspace(int argc, char **argv) {
|
||||||
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
|
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct cmd_results *cmd_workspace_layout(int argc, char **argv) {
|
||||||
|
struct cmd_results *error = NULL;
|
||||||
|
if ((error = checkarg(argc, "workspace_layout", EXPECTED_EQUAL_TO, 1))) {
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strcasecmp(argv[0], "default") == 0) {
|
||||||
|
config->default_layout = L_NONE;
|
||||||
|
} else if (strcasecmp(argv[0], "stacking") == 0) {
|
||||||
|
config->default_layout = L_STACKED;
|
||||||
|
} else if (strcasecmp(argv[0], "tabbed") == 0) {
|
||||||
|
config->default_layout = L_TABBED;
|
||||||
|
} else {
|
||||||
|
return cmd_results_new(CMD_INVALID, "workspace_layout", "Expected 'workspace_layout <default|stacking|tabbed>'");
|
||||||
|
}
|
||||||
|
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static struct cmd_results *cmd_ws_auto_back_and_forth(int argc, char **argv) {
|
static struct cmd_results *cmd_ws_auto_back_and_forth(int argc, char **argv) {
|
||||||
struct cmd_results *error = NULL;
|
struct cmd_results *error = NULL;
|
||||||
if ((error = checkarg(argc, "workspace_auto_back_and_forth", EXPECTED_EQUAL_TO, 1))) {
|
if ((error = checkarg(argc, "workspace_auto_back_and_forth", EXPECTED_EQUAL_TO, 1))) {
|
||||||
|
@ -2036,6 +2055,7 @@ static struct cmd_handler handlers[] = {
|
||||||
{ "sticky", cmd_sticky },
|
{ "sticky", cmd_sticky },
|
||||||
{ "workspace", cmd_workspace },
|
{ "workspace", cmd_workspace },
|
||||||
{ "workspace_auto_back_and_forth", cmd_ws_auto_back_and_forth },
|
{ "workspace_auto_back_and_forth", cmd_ws_auto_back_and_forth },
|
||||||
|
{ "workspace_layout", cmd_workspace_layout },
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct cmd_results *bar_cmd_binding_mode_indicator(int argc, char **argv) {
|
static struct cmd_results *bar_cmd_binding_mode_indicator(int argc, char **argv) {
|
||||||
|
|
|
@ -208,6 +208,9 @@ or triggered at runtime.
|
||||||
Specifies that the workspace named _name_ should appear on the specified
|
Specifies that the workspace named _name_ should appear on the specified
|
||||||
_output_.
|
_output_.
|
||||||
|
|
||||||
|
**workspace_layout** <default|stacking|tabbed>::
|
||||||
|
Specifies the start layout for new workspaces.
|
||||||
|
|
||||||
Criteria
|
Criteria
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue