mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-26 06:46:45 -04:00
Enable the use of flash as visual bell
With this patch we can configure flash in the bell section. The colors section allow now to configure the color of the flash and the alpha to apply to. Default values are the values which where currently used for flash, altough I personally like a nice red (eb1313) better.
This commit is contained in:
parent
36ed07788e
commit
9147407f9f
6 changed files with 16 additions and 13 deletions
|
|
@ -60,9 +60,12 @@
|
||||||
row ([#1364][1364]).
|
row ([#1364][1364]).
|
||||||
* Support for DECSET/DECRST/DECRQM 2027 (_Grapheme cluster
|
* Support for DECSET/DECRST/DECRQM 2027 (_Grapheme cluster
|
||||||
processing_).
|
processing_).
|
||||||
|
* Support for visual bell which flashes the terminal window.
|
||||||
|
([#1508][1508]).
|
||||||
|
|
||||||
[1077]: https://codeberg.org/dnkl/foot/issues/1077
|
[1077]: https://codeberg.org/dnkl/foot/issues/1077
|
||||||
[1364]: https://codeberg.org/dnkl/foot/issues/1364
|
[1364]: https://codeberg.org/dnkl/foot/issues/1364
|
||||||
|
[1508]: https://codeberg.org/dnkl/foot/issues/1508
|
||||||
|
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
||||||
4
config.c
4
config.c
|
|
@ -1031,7 +1031,7 @@ parse_section_bell(struct context *ctx)
|
||||||
return value_to_bool(ctx, &conf->bell.urgent);
|
return value_to_bool(ctx, &conf->bell.urgent);
|
||||||
else if (strcmp(key, "notify") == 0)
|
else if (strcmp(key, "notify") == 0)
|
||||||
return value_to_bool(ctx, &conf->bell.notify);
|
return value_to_bool(ctx, &conf->bell.notify);
|
||||||
else if (strcmp(key, "flash") == 0)
|
else if (strcmp(key, "visual") == 0)
|
||||||
return value_to_bool(ctx, &conf->bell.flash);
|
return value_to_bool(ctx, &conf->bell.flash);
|
||||||
else if (strcmp(key, "command") == 0)
|
else if (strcmp(key, "command") == 0)
|
||||||
return value_to_spawn_template(ctx, &conf->bell.command);
|
return value_to_spawn_template(ctx, &conf->bell.command);
|
||||||
|
|
@ -1300,7 +1300,7 @@ parse_section_colors(struct context *ctx)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (strcmp(key, "flash_alpha") == 0) {
|
else if (strcmp(key, "flash-alpha") == 0) {
|
||||||
float alpha;
|
float alpha;
|
||||||
if (!value_to_float(ctx, &alpha))
|
if (!value_to_float(ctx, &alpha))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -394,9 +394,8 @@ Note: do not set *TERM* here; use the *term* option in the main
|
||||||
|
|
||||||
Default: _no_
|
Default: _no_
|
||||||
|
|
||||||
*flash*
|
*visual*
|
||||||
When set to _yes_, foot will emit the bell signal flashing the
|
When set to _yes_, foot will flash terminal window.
|
||||||
terminal window whenever *BEL* is received.
|
|
||||||
|
|
||||||
Default: _no_
|
Default: _no_
|
||||||
|
|
||||||
|
|
@ -618,14 +617,13 @@ can configure the background transparency with the _alpha_ option.
|
||||||
*flash*
|
*flash*
|
||||||
Color to use for the terminal window flash.
|
Color to use for the terminal window flash.
|
||||||
|
|
||||||
Default: _7f7fff_.
|
Default: _7f7f00_.
|
||||||
|
|
||||||
|
|
||||||
*flash_alpha*
|
*flash_alpha*
|
||||||
Flash translucency. A value in the range 0.0-1.0, where 0.0
|
Flash translucency. A value in the range 0.0-1.0, where 0.0
|
||||||
means completely transparent, and 1.0 is opaque.
|
means completely transparent, and 1.0 is opaque.
|
||||||
|
|
||||||
Default: _0.7_.
|
Default: _0.5_.
|
||||||
|
|
||||||
*alpha*
|
*alpha*
|
||||||
Background translucency. A value in the range 0.0-1.0, where 0.0
|
Background translucency. A value in the range 0.0-1.0, where 0.0
|
||||||
|
|
|
||||||
6
foot.ini
6
foot.ini
|
|
@ -43,7 +43,7 @@
|
||||||
[bell]
|
[bell]
|
||||||
# urgent=no
|
# urgent=no
|
||||||
# notify=no
|
# notify=no
|
||||||
# flash=no
|
# visual=no
|
||||||
# command=
|
# command=
|
||||||
# command-focused=no
|
# command-focused=no
|
||||||
|
|
||||||
|
|
@ -78,8 +78,8 @@
|
||||||
# alpha=1.0
|
# alpha=1.0
|
||||||
# background=242424
|
# background=242424
|
||||||
# foreground=ffffff
|
# foreground=ffffff
|
||||||
# flash=7f7fff
|
# flash=7f7f00
|
||||||
# flash_alpha=0.7
|
# flash_alpha=0.5
|
||||||
|
|
||||||
## Normal/regular colors (color palette 0-7)
|
## Normal/regular colors (color palette 0-7)
|
||||||
# regular0=242424 # black
|
# regular0=242424 # black
|
||||||
|
|
|
||||||
4
render.c
4
render.c
|
|
@ -1582,7 +1582,9 @@ render_overlay(struct terminal *term)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OVERLAY_FLASH:
|
case OVERLAY_FLASH:
|
||||||
color = color_hex_to_pixman_with_alpha(term->colors.flash, term->colors.flash_alpha);
|
color = color_hex_to_pixman_with_alpha(
|
||||||
|
term->conf->colors.flash,
|
||||||
|
term->conf->colors.flash_alpha);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3294,7 +3294,7 @@ term_bell(struct terminal *term)
|
||||||
notify_notify(term, "Bell", "Bell in terminal");
|
notify_notify(term, "Bell", "Bell in terminal");
|
||||||
|
|
||||||
if (term->conf->bell.flash)
|
if (term->conf->bell.flash)
|
||||||
term_flash(term, 100);
|
term_flash(term, 100);
|
||||||
|
|
||||||
if ((term->conf->bell.command.argv.args != NULL) &&
|
if ((term->conf->bell.command.argv.args != NULL) &&
|
||||||
(!term->kbd_focus || term->conf->bell.command_focused))
|
(!term->kbd_focus || term->conf->bell.command_focused))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue