commit 5aaf5a293e6d34f474611b5056a8793838199623
parent f2ef5989e10861a60a6dcaf568e3158ef8d816be
Author: Chris Guillott <chris@techfo.xyz>
Date: Mon, 22 May 2017 12:34:56 -0500
tweak indicator stuff
Diffstat:
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/i3lock.c b/i3lock.c
@@ -78,6 +78,7 @@ int screen_number = -1;
int internal_line_source = 0;
/* bool for showing the clock; why am I commenting this? */
bool show_clock = false;
+bool show_indicator = false;
/* time formatter strings for date/time
I picked 32-length char arrays because some people might want really funky time formatters.
Who am I to judge?
@@ -910,6 +911,7 @@ int main(int argc, char *argv[]) {
{"screen", required_argument, NULL, 'S'},
{"clock", no_argument, NULL, 'k'},
+ {"indicator", no_argument, NULL, 0},
{"timestr", required_argument, NULL, 0},
{"datestr", required_argument, NULL, 0},
{"timefont", required_argument, NULL, 0},
@@ -1008,6 +1010,9 @@ int main(int argc, char *argv[]) {
case 0:
if (strcmp(longopts[optind].name, "debug") == 0)
debug_mode = true;
+ else if (strcmp(longopts[optind].name, "indicator") == 0) {
+ show_indicator = true;
+ }
else if (strcmp(longopts[optind].name, "insidevercolor") == 0) {
char *arg = optarg;
diff --git a/unlock_indicator.c b/unlock_indicator.c
@@ -80,6 +80,7 @@ extern int internal_line_source;
extern int screen_number;
extern bool show_clock;
+extern bool show_indicator;
extern char time_format[32];
extern char date_format[32];
extern char time_font[32];
@@ -301,7 +302,7 @@ xcb_pixmap_t draw_image(uint32_t *resolution) {
timeinfo = localtime(&rawtime);
if (unlock_indicator &&
- (unlock_state >= STATE_KEY_PRESSED || auth_state > STATE_AUTH_IDLE)) {
+ (unlock_state >= STATE_KEY_PRESSED || auth_state > STATE_AUTH_IDLE || show_indicator)) {
cairo_scale(ctx, scaling_factor(), scaling_factor());
/* Draw a (centered) circle with transparent background. */
cairo_set_line_width(ctx, 7.0);