Merge branch 'master' into variables_corner_cases

master
Denis Doria 9 years ago
commit 3c3e98b1a3

@ -427,7 +427,7 @@ static struct cmd_results *cmd_border(int argc, char **argv) {
static struct cmd_results *parse_border_color(struct border_colors *border_colors, const char *cmd_name, int argc, char **argv) { static struct cmd_results *parse_border_color(struct border_colors *border_colors, const char *cmd_name, int argc, char **argv) {
struct cmd_results *error = NULL; struct cmd_results *error = NULL;
if (argc != 5) { if (argc != 5) {
return cmd_results_new(CMD_INVALID, cmd_name, "Requires exact 5 color values"); return cmd_results_new(CMD_INVALID, cmd_name, "Requires exactly five color values");
} }
uint32_t colors[5]; uint32_t colors[5];
@ -476,7 +476,7 @@ static struct cmd_results *cmd_client_background(int argc, char **argv) {
uint32_t background; uint32_t background;
if (argc != 1) { if (argc != 1) {
return cmd_results_new(CMD_INVALID, "client.background", "Expect exact 1 value"); return cmd_results_new(CMD_INVALID, "client.background", "Requires exactly one color value");
} }
error = add_color("client.background", buffer, argv[0]); error = add_color("client.background", buffer, argv[0]);

@ -61,7 +61,7 @@ Colors
------ ------
Colors are defined within a _colors { }_ block inside a _bar { }_ block. Colors Colors are defined within a _colors { }_ block inside a _bar { }_ block. Colors
must be defined in hex. E.g. _#fff000_ or _#fff000ff_ when including the alpha must be defined in hex. i.e. _#rrggbb_ or _#rrggbbaa_ when including the alpha
channel. channel.
**background** <color>:: **background** <color>::

@ -100,7 +100,7 @@ They are expected to be used with **bindsym** or at runtime through **swaymsg**(
**layout** <mode>:: **layout** <mode>::
Sets the layout mode of the focused container. _mode_ can be one of _splith_, Sets the layout mode of the focused container. _mode_ can be one of _splith_,
_splitv_, or _toggle split_. _splitv_, _toggle split_, _stacking_ or _tabbed_.
**move** <left|right|up|down>:: **move** <left|right|up|down>::
Moves the focused container _left_, _right_, _up_, or _down_. Moves the focused container _left_, _right_, _up_, or _down_.
@ -150,6 +150,54 @@ or triggered at runtime.
**bindcode** <code> <command> is also available for binding with key codes **bindcode** <code> <command> is also available for binding with key codes
instead of key names. instead of key names.
**client**.<color_class> <border> <background> <text> <indicator> <child_border>::
The client commands control the colors of the view borders and title bars. All
of the client commands _require_ five color values. (The one exception is
**client.background** which _requires_ one color value.) If you only want to
specify a subset, supply default colors for all the others. Colors must be
defined in hex. i.e. _#rrggbb_ or _#rrggbbaa_ when including the alpha
channel.
+
The command tokens are:
**color_class**::: Specifies the view to which the colors apply.
**client.background**:::: The color a view will be painted, underneath the
client itself. This will only be visible if a client does not fully
cover its allocated view space. This command only requires one color. _Note_:
This is not currently implemented.
**client.focused**:::: The view that has focus.
**client.focused_inactive**:::: A view that has focus within its
container, but the container is not focused.
**client.placeholder**:::: Used when drawing placeholder view contents.
Only background and text colors are used. _Note_: This is not
currently implemented.
**client.unfocused**:::: A view that does not have focus.
**client.urgent**:::: A view with an urgency hint. _Note_: This is not
currently implemented.
**border**::: The border around the title bar.
**background**::: The background of the title bar.
**text**::: The text color of the title bar.
**indicator**::: The color used to indicate where a new view will open. In a
tiled container, this would paint the right border of the current view if
a new view would be opened to the right. _Note_: This is not currently
implemented.
**child_border**::: The border around the view itself.
+
The default colors are:
+
--
[options="header"]
|===========================================================================
|color_class |border |background |text |indicator |child_border
|background |n/a |#ffffffff |n/a |n/a |n/a
|focused |#4c7899ff |#285577ff |#ffffffff |#2e9ef4ff |#285577ff
|focused_inactive |#333333ff |#5f676aff |#ffffffff |#484e50ff |#5f676aff
|unfocused |#333333ff |#222222ff |#888888ff |#292d2eff |#222222ff
|urgent |#2f343aff |#900000ff |#ffffffff |#900000ff |#900000ff
|placeholder |#000000ff |#0c0c0cff |#ffffffff |#000000ff |#0c0c0cff
|===========================================================================
--
**debuglog** <on|off|toggle>:: **debuglog** <on|off|toggle>::
Enables, disables or toggles logging for debug. The toggle argument cannot Enables, disables or toggles logging for debug. The toggle argument cannot
be used in the configuration file. be used in the configuration file.

@ -119,6 +119,7 @@ void notify_key(enum wl_keyboard_key_state state, xkb_keysym_t sym, uint32_t cod
if (state == WL_KEYBOARD_KEY_STATE_PRESSED) { if (state == WL_KEYBOARD_KEY_STATE_PRESSED) {
switch (sym) { switch (sym) {
case XKB_KEY_KP_Enter: // fallthrough
case XKB_KEY_Return: case XKB_KEY_Return:
render_data.auth_state = AUTH_STATE_VALIDATING; render_data.auth_state = AUTH_STATE_VALIDATING;
@ -159,7 +160,7 @@ void notify_key(enum wl_keyboard_key_state state, xkb_keysym_t sym, uint32_t cod
case XKB_KEY_Super_L: // fallthrough case XKB_KEY_Super_L: // fallthrough
case XKB_KEY_Super_R: // fallthrough case XKB_KEY_Super_R: // fallthrough
case XKB_KEY_Hyper_L: // fallthrough case XKB_KEY_Hyper_L: // fallthrough
case XKB_KEY_Hyper_R: // fallthrough case XKB_KEY_Hyper_R:
{ {
// don't draw screen on modifier keys // don't draw screen on modifier keys
break; break;
@ -360,7 +361,7 @@ int main(int argc, char **argv) {
{ {
int colorlen = strlen(optarg); int colorlen = strlen(optarg);
if (colorlen < 6 || colorlen == 7 || colorlen > 8) { if (colorlen < 6 || colorlen == 7 || colorlen > 8) {
sway_log(L_ERROR, "color must be specified in 3 or 4 byte format, e.g. ff0000 or ff0000ff"); sway_log(L_ERROR, "color must be specified in 3 or 4 byte format, i.e. rrggbb or rrggbbaa");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
render_data.color = strtol(optarg, NULL, 16); render_data.color = strtol(optarg, NULL, 16);

Loading…
Cancel
Save