mirror of
https://github.com/labwc/labwc.git
synced 2026-02-09 10:07:31 -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
12
include/action-prompt-command.h
Normal file
12
include/action-prompt-command.h
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef LABWC_ACTION_PROMPT_COMMAND_H
|
||||
#define LABWC_ACTION_PROMPT_COMMAND_H
|
||||
|
||||
struct buf;
|
||||
struct action;
|
||||
struct theme;
|
||||
|
||||
void action_prompt_command(struct buf *buf, const char *format,
|
||||
struct action *action, struct theme *theme);
|
||||
|
||||
#endif /* LABWC_ACTION_PROMPT_COMMAND_H */
|
||||
|
|
@ -23,6 +23,8 @@ struct action {
|
|||
|
||||
struct action *action_create(const char *action_name);
|
||||
|
||||
const char *action_get_str(struct action *action, const char *key,
|
||||
const char *default_value);
|
||||
bool action_is_valid(struct action *action);
|
||||
bool action_is_show_menu(struct action *action);
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,17 @@ void buf_expand_shell_variables(struct buf *s);
|
|||
*/
|
||||
void buf_add_fmt(struct buf *s, const char *fmt, ...);
|
||||
|
||||
/**
|
||||
* buf_add_hex_color - add rgb color as hex string to C string buffer
|
||||
* @s: buffer
|
||||
* @color: rgb color to be added
|
||||
*
|
||||
* For example:
|
||||
* - With the input 'red' (defined as red[4] = { 1.0f, 0.0f, 0.0f, 1.0f}) the
|
||||
* string "#ff0000ff" will be written to the buffer.
|
||||
*/
|
||||
void buf_add_hex_color(struct buf *s, float color[4]);
|
||||
|
||||
/**
|
||||
* buf_add - add data to C string buffer
|
||||
* @s: buffer
|
||||
|
|
|
|||
|
|
@ -74,6 +74,8 @@ struct rcxml {
|
|||
enum lab_placement_policy placement_policy;
|
||||
bool xwayland_persistence;
|
||||
bool primary_selection;
|
||||
char *prompt_command;
|
||||
|
||||
int placement_cascade_offset_x;
|
||||
int placement_cascade_offset_y;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue