diff options
Diffstat (limited to 'swaynag/config.c')
-rw-r--r-- | swaynag/config.c | 58 |
1 files changed, 33 insertions, 25 deletions
diff --git a/swaynag/config.c b/swaynag/config.c index d702cc95..3488a74d 100644 --- a/swaynag/config.c +++ b/swaynag/config.c @@ -39,6 +39,7 @@ int swaynag_parse_options(int argc, char **argv, struct swaynag *swaynag, TO_COLOR_BORDER_BOTTOM, TO_COLOR_BUTTON, TO_COLOR_TEXT, + TO_COLOR_BUTTON_TEXT, TO_THICK_BAR_BORDER, TO_PADDING_MESSAGE, TO_THICK_DET_BORDER, @@ -72,6 +73,7 @@ int swaynag_parse_options(int argc, char **argv, struct swaynag *swaynag, {"border-bottom", required_argument, NULL, TO_COLOR_BORDER_BOTTOM}, {"button-background", required_argument, NULL, TO_COLOR_BUTTON}, {"text", required_argument, NULL, TO_COLOR_TEXT}, + {"button-text", required_argument, NULL, TO_COLOR_BUTTON_TEXT}, {"border-bottom-size", required_argument, NULL, TO_THICK_BAR_BORDER}, {"message-padding", required_argument, NULL, TO_PADDING_MESSAGE}, {"details-border-size", required_argument, NULL, TO_THICK_DET_BORDER}, @@ -97,33 +99,34 @@ int swaynag_parse_options(int argc, char **argv, struct swaynag *swaynag, "Multiple buttons can be defined.\n" " -Z, --button-dismiss-no-terminal <text> <action> Like " "--button-dismiss, but does not run the action in a terminal.\n" - " -c, --config <path> Path to config file.\n" - " -d, --debug Enable debugging.\n" - " -e, --edge top|bottom Set the edge to use.\n" - " -f, --font <font> Set the font to use.\n" - " -h, --help Show help message and quit.\n" - " -l, --detailed-message Read a detailed message from stdin.\n" - " -L, --detailed-button <text> Set the text of the detail button.\n" - " -m, --message <msg> Set the message text.\n" - " -o, --output <output> Set the output to use.\n" - " -s, --dismiss-button <text> Set the dismiss button text.\n" - " -t, --type <type> Set the message type.\n" - " -v, --version Show the version number and quit.\n" + " -c, --config <path> Path to config file.\n" + " -d, --debug Enable debugging.\n" + " -e, --edge top|bottom Set the edge to use.\n" + " -f, --font <font> Set the font to use.\n" + " -h, --help Show help message and quit.\n" + " -l, --detailed-message Read a detailed message from stdin.\n" + " -L, --detailed-button <text> Set the text of the detail button.\n" + " -m, --message <msg> Set the message text.\n" + " -o, --output <output> Set the output to use.\n" + " -s, --dismiss-button <text> Set the dismiss button text.\n" + " -t, --type <type> Set the message type.\n" + " -v, --version Show the version number and quit.\n" "\n" "The following appearance options can also be given:\n" - " --background RRGGBB[AA] Background color.\n" - " --border RRGGBB[AA] Border color.\n" - " --border-bottom RRGGBB[AA] Bottom border color.\n" - " --button-background RRGGBB[AA] Button background color.\n" - " --text RRGGBB[AA] Text color.\n" - " --border-bottom-size size Thickness of the bar border.\n" - " --message-padding padding Padding for the message.\n" - " --details-border-size size Thickness for the details border.\n" - " --button-border-size size Thickness for the button border.\n" - " --button-gap gap Size of the gap between buttons\n" - " --button-dismiss-gap gap Size of the gap for dismiss button.\n" - " --button-margin-right margin Margin from dismiss button to edge.\n" - " --button-padding padding Padding for the button text.\n"; + " --background RRGGBB[AA] Background color.\n" + " --border RRGGBB[AA] Border color.\n" + " --border-bottom RRGGBB[AA] Bottom border color.\n" + " --button-background RRGGBB[AA] Button background color.\n" + " --text RRGGBB[AA] Text color.\n" + " --button-text RRGGBB[AA] Button text color.\n" + " --border-bottom-size size Thickness of the bar border.\n" + " --message-padding padding Padding for the message.\n" + " --details-border-size size Thickness for the details border.\n" + " --button-border-size size Thickness for the button border.\n" + " --button-gap gap Size of the gap between buttons\n" + " --button-dismiss-gap gap Size of the gap for dismiss button.\n" + " --button-margin-right margin Margin from dismiss button to edge.\n" + " --button-padding padding Padding for the button text.\n"; optind = 1; while (1) { @@ -255,6 +258,11 @@ int swaynag_parse_options(int argc, char **argv, struct swaynag *swaynag, fprintf(stderr, "Invalid text color: %s", optarg); } break; + case TO_COLOR_BUTTON_TEXT: // Button text color + if (type && !parse_color(optarg, &type->button_text)) { + fprintf(stderr, "Invalid button text color: %s", optarg); + } + break; case TO_THICK_BAR_BORDER: // Bottom border thickness if (type) { type->bar_border_thickness = strtol(optarg, NULL, 0); |