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, | |||
39 | TO_COLOR_BORDER_BOTTOM, | 39 | TO_COLOR_BORDER_BOTTOM, |
40 | TO_COLOR_BUTTON, | 40 | TO_COLOR_BUTTON, |
41 | TO_COLOR_TEXT, | 41 | TO_COLOR_TEXT, |
42 | TO_COLOR_BUTTON_TEXT, | ||
42 | TO_THICK_BAR_BORDER, | 43 | TO_THICK_BAR_BORDER, |
43 | TO_PADDING_MESSAGE, | 44 | TO_PADDING_MESSAGE, |
44 | TO_THICK_DET_BORDER, | 45 | TO_THICK_DET_BORDER, |
@@ -72,6 +73,7 @@ int swaynag_parse_options(int argc, char **argv, struct swaynag *swaynag, | |||
72 | {"border-bottom", required_argument, NULL, TO_COLOR_BORDER_BOTTOM}, | 73 | {"border-bottom", required_argument, NULL, TO_COLOR_BORDER_BOTTOM}, |
73 | {"button-background", required_argument, NULL, TO_COLOR_BUTTON}, | 74 | {"button-background", required_argument, NULL, TO_COLOR_BUTTON}, |
74 | {"text", required_argument, NULL, TO_COLOR_TEXT}, | 75 | {"text", required_argument, NULL, TO_COLOR_TEXT}, |
76 | {"button-text", required_argument, NULL, TO_COLOR_BUTTON_TEXT}, | ||
75 | {"border-bottom-size", required_argument, NULL, TO_THICK_BAR_BORDER}, | 77 | {"border-bottom-size", required_argument, NULL, TO_THICK_BAR_BORDER}, |
76 | {"message-padding", required_argument, NULL, TO_PADDING_MESSAGE}, | 78 | {"message-padding", required_argument, NULL, TO_PADDING_MESSAGE}, |
77 | {"details-border-size", required_argument, NULL, TO_THICK_DET_BORDER}, | 79 | {"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, | |||
97 | "Multiple buttons can be defined.\n" | 99 | "Multiple buttons can be defined.\n" |
98 | " -Z, --button-dismiss-no-terminal <text> <action> Like " | 100 | " -Z, --button-dismiss-no-terminal <text> <action> Like " |
99 | "--button-dismiss, but does not run the action in a terminal.\n" | 101 | "--button-dismiss, but does not run the action in a terminal.\n" |
100 | " -c, --config <path> Path to config file.\n" | 102 | " -c, --config <path> Path to config file.\n" |
101 | " -d, --debug Enable debugging.\n" | 103 | " -d, --debug Enable debugging.\n" |
102 | " -e, --edge top|bottom Set the edge to use.\n" | 104 | " -e, --edge top|bottom Set the edge to use.\n" |
103 | " -f, --font <font> Set the font to use.\n" | 105 | " -f, --font <font> Set the font to use.\n" |
104 | " -h, --help Show help message and quit.\n" | 106 | " -h, --help Show help message and quit.\n" |
105 | " -l, --detailed-message Read a detailed message from stdin.\n" | 107 | " -l, --detailed-message Read a detailed message from stdin.\n" |
106 | " -L, --detailed-button <text> Set the text of the detail button.\n" | 108 | " -L, --detailed-button <text> Set the text of the detail button.\n" |
107 | " -m, --message <msg> Set the message text.\n" | 109 | " -m, --message <msg> Set the message text.\n" |
108 | " -o, --output <output> Set the output to use.\n" | 110 | " -o, --output <output> Set the output to use.\n" |
109 | " -s, --dismiss-button <text> Set the dismiss button text.\n" | 111 | " -s, --dismiss-button <text> Set the dismiss button text.\n" |
110 | " -t, --type <type> Set the message type.\n" | 112 | " -t, --type <type> Set the message type.\n" |
111 | " -v, --version Show the version number and quit.\n" | 113 | " -v, --version Show the version number and quit.\n" |
112 | "\n" | 114 | "\n" |
113 | "The following appearance options can also be given:\n" | 115 | "The following appearance options can also be given:\n" |
114 | " --background RRGGBB[AA] Background color.\n" | 116 | " --background RRGGBB[AA] Background color.\n" |
115 | " --border RRGGBB[AA] Border color.\n" | 117 | " --border RRGGBB[AA] Border color.\n" |
116 | " --border-bottom RRGGBB[AA] Bottom border color.\n" | 118 | " --border-bottom RRGGBB[AA] Bottom border color.\n" |
117 | " --button-background RRGGBB[AA] Button background color.\n" | 119 | " --button-background RRGGBB[AA] Button background color.\n" |
118 | " --text RRGGBB[AA] Text color.\n" | 120 | " --text RRGGBB[AA] Text color.\n" |
119 | " --border-bottom-size size Thickness of the bar border.\n" | 121 | " --button-text RRGGBB[AA] Button text color.\n" |
120 | " --message-padding padding Padding for the message.\n" | 122 | " --border-bottom-size size Thickness of the bar border.\n" |
121 | " --details-border-size size Thickness for the details border.\n" | 123 | " --message-padding padding Padding for the message.\n" |
122 | " --button-border-size size Thickness for the button border.\n" | 124 | " --details-border-size size Thickness for the details border.\n" |
123 | " --button-gap gap Size of the gap between buttons\n" | 125 | " --button-border-size size Thickness for the button border.\n" |
124 | " --button-dismiss-gap gap Size of the gap for dismiss button.\n" | 126 | " --button-gap gap Size of the gap between buttons\n" |
125 | " --button-margin-right margin Margin from dismiss button to edge.\n" | 127 | " --button-dismiss-gap gap Size of the gap for dismiss button.\n" |
126 | " --button-padding padding Padding for the button text.\n"; | 128 | " --button-margin-right margin Margin from dismiss button to edge.\n" |
129 | " --button-padding padding Padding for the button text.\n"; | ||
127 | 130 | ||
128 | optind = 1; | 131 | optind = 1; |
129 | while (1) { | 132 | while (1) { |
@@ -255,6 +258,11 @@ int swaynag_parse_options(int argc, char **argv, struct swaynag *swaynag, | |||
255 | fprintf(stderr, "Invalid text color: %s", optarg); | 258 | fprintf(stderr, "Invalid text color: %s", optarg); |
256 | } | 259 | } |
257 | break; | 260 | break; |
261 | case TO_COLOR_BUTTON_TEXT: // Button text color | ||
262 | if (type && !parse_color(optarg, &type->button_text)) { | ||
263 | fprintf(stderr, "Invalid button text color: %s", optarg); | ||
264 | } | ||
265 | break; | ||
258 | case TO_THICK_BAR_BORDER: // Bottom border thickness | 266 | case TO_THICK_BAR_BORDER: // Bottom border thickness |
259 | if (type) { | 267 | if (type) { |
260 | type->bar_border_thickness = strtol(optarg, NULL, 0); | 268 | type->bar_border_thickness = strtol(optarg, NULL, 0); |