From 666ae950bc9c58b2676724e0d614f9018100fcca Mon Sep 17 00:00:00 2001 From: Alexander Martin <10480820+afmartin@users.noreply.github.com> Date: Sat, 3 Aug 2019 19:07:50 -0600 Subject: Adds option to show indicator even if idle --- main.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index fb84b05..2080d45 100644 --- a/main.c +++ b/main.c @@ -507,6 +507,7 @@ static int parse_options(int argc, char **argv, struct swaylock_state *state, LO_CAPS_LOCK_KEY_HL_COLOR, LO_FONT, LO_FONT_SIZE, + LO_IND_IDLE_VISIBLE, LO_IND_RADIUS, LO_IND_THICKNESS, LO_INSIDE_COLOR, @@ -561,6 +562,7 @@ static int parse_options(int argc, char **argv, struct swaylock_state *state, {"caps-lock-key-hl-color", required_argument, NULL, LO_CAPS_LOCK_KEY_HL_COLOR}, {"font", required_argument, NULL, LO_FONT}, {"font-size", required_argument, NULL, LO_FONT_SIZE}, + {"indicator-idle-visible", no_argument, NULL, LO_IND_IDLE_VISIBLE}, {"indicator-radius", required_argument, NULL, LO_IND_RADIUS}, {"indicator-thickness", required_argument, NULL, LO_IND_THICKNESS}, {"inside-color", required_argument, NULL, LO_INSIDE_COLOR}, @@ -638,6 +640,8 @@ static int parse_options(int argc, char **argv, struct swaylock_state *state, "Sets the font of the text.\n" " --font-size " "Sets a fixed font size for the indicator text.\n" + " --indicator-idle-visible " + "Sets the indicator to show even if idle.\n" " --indicator-radius " "Sets the indicator radius.\n" " --indicator-thickness " @@ -826,6 +830,11 @@ static int parse_options(int argc, char **argv, struct swaylock_state *state, state->args.font_size = atoi(optarg); } break; + case LO_IND_IDLE_VISIBLE: + if (state) { + state->args.indicator_idle_visible = true; + } + break; case LO_IND_RADIUS: if (state) { state->args.radius = strtol(optarg, NULL, 0); @@ -1085,7 +1094,8 @@ int main(int argc, char **argv) { .show_caps_lock_text = true, .show_keyboard_layout = false, .hide_keyboard_layout = false, - .show_failed_attempts = false + .show_failed_attempts = false, + .indicator_idle_visible = false }; wl_list_init(&state.images); set_default_colors(&state.args.colors); -- cgit v1.2.3