aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorMikkel Oscar Lyderik <mikkeloscar@gmail.com>2016-03-29 13:49:28 +0200
committerMikkel Oscar Lyderik <mikkeloscar@gmail.com>2016-03-30 00:47:58 +0200
commit86ea79ea6de62c0958511d45e755a4a7767efcd0 (patch)
tree96369d7356313ad86c1064c74db54258500814f2 /sway
parentcefcce48aad4e452be9d081b1cd1521e2b042e97 (diff)
Implement parsing of hide_edge_borders
Diffstat (limited to 'sway')
-rw-r--r--sway/commands.c25
-rw-r--r--sway/config.c2
-rw-r--r--sway/sway.5.txt3
3 files changed, 30 insertions, 0 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 333af1b4..4a3ebf9e 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -55,6 +55,7 @@ static sway_cmd cmd_font;
static sway_cmd cmd_for_window;
static sway_cmd cmd_fullscreen;
static sway_cmd cmd_gaps;
+static sway_cmd cmd_hide_edge_borders;
static sway_cmd cmd_include;
static sway_cmd cmd_input;
static sway_cmd cmd_kill;
@@ -1506,6 +1507,29 @@ static struct cmd_results *cmd_smart_gaps(int argc, char **argv) {
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}
+static struct cmd_results *cmd_hide_edge_borders(int argc, char **argv) {
+ struct cmd_results *error = NULL;
+ if ((error = checkarg(argc, "hide_edge_borders", EXPECTED_EQUAL_TO, 1))) {
+ return error;
+ }
+
+ if (strcasecmp(argv[0], "none") == 0) {
+ config->hide_edge_borders = E_NONE;
+ } else if (strcasecmp(argv[0], "vertical") == 0) {
+ config->hide_edge_borders = E_VERTICAL;
+ } else if (strcasecmp(argv[0], "horizontal") == 0) {
+ config->hide_edge_borders = E_HORIZONTAL;
+ } else if (strcasecmp(argv[0], "both") == 0) {
+ config->hide_edge_borders = E_BOTH;
+ } else {
+ return cmd_results_new(CMD_INVALID, "hide_edge_borders",
+ "Expected 'hide_edge_borders <none|vertical|horizontal|both>'");
+ }
+
+ return cmd_results_new(CMD_SUCCESS, NULL, NULL);
+}
+
+
static struct cmd_results *cmd_kill(int argc, char **argv) {
if (config->reading) return cmd_results_new(CMD_FAILURE, "kill", "Can't be used in config file.");
if (!config->active) return cmd_results_new(CMD_FAILURE, "kill", "Can only be used when sway is running.");
@@ -2063,6 +2087,7 @@ static struct cmd_handler handlers[] = {
{ "for_window", cmd_for_window },
{ "fullscreen", cmd_fullscreen },
{ "gaps", cmd_gaps },
+ { "hide_edge_borders", cmd_hide_edge_borders },
{ "include", cmd_include },
{ "input", cmd_input },
{ "kill", cmd_kill },
diff --git a/sway/config.c b/sway/config.c
index 4cb8cced..565acd05 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -182,6 +182,8 @@ static void config_defaults(struct sway_config *config) {
config->config_chain = create_list();
config->current_config = NULL;
+ config->hide_edge_borders = E_NONE;
+
// border colors
config->border_colors.focused.border = 0x4C7899FF;
config->border_colors.focused.background = 0x285577FF;
diff --git a/sway/sway.5.txt b/sway/sway.5.txt
index 1bb5cd3b..13d304bb 100644
--- a/sway/sway.5.txt
+++ b/sway/sway.5.txt
@@ -67,6 +67,9 @@ They are expected to be used with **bindsym** or at runtime through **swaymsg**(
**fullscreen**::
Toggles fullscreen status for the focused view.
+**hide_edge_borders** <none|vertical|horizontal|both>::
+ Hide window borders adjacent to the screen edges. Default is _none_.
+
**layout** <mode>::
Sets the layout mode of the focused container. _mode_ can be one of _splith_,
_splitv_, or _toggle split_.