mirror of
https://github.com/labwc/labwc.git
synced 2025-11-08 13:30:00 -05:00
config: add <core><promptCommand>
...to enable configuration of the action prompt command.
Also set some better defaults for labnag.
The new default command is:
labnag \
--message '%m' \
--button-dismiss '%n' \
--button-dismiss '%y' \
--background '%b' \
--text '%t' \
--border '%t' \
--border-bottom '%t' \
--button-background '%b' \
--button-text '%t' \
--border-bottom-size 1 \
--button-border-size 3 \
--timeout 0
...where the conversion specifiers are defined as follows:
%m: the `<prompt>` message option
%n: _("No")
%y: _("Yes")
%b: osd.bg.color
%t: osd.label.text.color
This config options also enables the use of a different dialog client, for
example like this:
<core>
<promptCommand>zenity --question --text="%m"</promptCommand>
</core>
This commit is contained in:
parent
7028e65154
commit
5765586636
10 changed files with 193 additions and 6 deletions
|
|
@ -128,6 +128,30 @@ buf_add_fmt(struct buf *s, const char *fmt, ...)
|
|||
s->data[s->len] = 0;
|
||||
}
|
||||
|
||||
void
|
||||
buf_add_hex_color(struct buf *s, float color[4])
|
||||
{
|
||||
/*
|
||||
* In theme.c parse_hexstr() colors are pre-multiplied (by alpha) as
|
||||
* expected by wlr_scene(). We therefore need to reverse that here.
|
||||
*
|
||||
* For details, see https://github.com/labwc/labwc/pull/1685
|
||||
*/
|
||||
float alpha = color[3];
|
||||
|
||||
/* Avoid division by zero */
|
||||
if (alpha == 0.0f) {
|
||||
buf_add(s, "#00000000");
|
||||
return;
|
||||
}
|
||||
|
||||
buf_add_fmt(s, "#%02x%02x%02x%02x",
|
||||
(int)(color[0] / alpha * 255),
|
||||
(int)(color[1] / alpha * 255),
|
||||
(int)(color[2] / alpha * 255),
|
||||
(int)(alpha * 255));
|
||||
}
|
||||
|
||||
void
|
||||
buf_add(struct buf *s, const char *data)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue