mirror of
https://github.com/Raymo111/i3lock-color.git
synced 2024-12-02 14:05:43 -05:00
Add option to hide modkey text (#194)
* adds option to hide modkeys text * Update i3lock.1 * Rename variable to `show_modkey_text` * Keep style consistent Co-authored-by: Raymond Li <hi@raymond.li>
This commit is contained in:
parent
e565e207fa
commit
9f774c84be
2 changed files with 22 additions and 8 deletions
4
i3lock.1
4
i3lock.1
|
@ -369,6 +369,10 @@ Sets the string to be shown while acquiring pointer and keyboard focus. Defaults
|
|||
.B \-\-lockfailedtext="text"
|
||||
Sets the string to be shown after failing to acquire pointer and keyboard focus. Defaults to "lock failed!".
|
||||
|
||||
.TP
|
||||
.B \-\-no-modkeytext
|
||||
Hides the modkey indicator (Num, Caps Lock ...)
|
||||
|
||||
.TP
|
||||
.B \-\-radius
|
||||
The radius of the circle. Defaults to 90.
|
||||
|
|
14
i3lock.c
14
i3lock.c
|
@ -92,14 +92,18 @@ char greetercolor[9] = "000000ff";
|
|||
|
||||
/* int defining which display the lock indicator should be shown on. If -1, then show on all displays.*/
|
||||
int screen_number = 0;
|
||||
|
||||
/* default is to use the supplied line color, 1 will be ring color, 2 will be to use the inside color for ver/wrong/etc */
|
||||
int internal_line_source = 0;
|
||||
/* bool for showing the clock; why am I commenting this? */
|
||||
|
||||
/* refresh rate in seconds, default to 1s */
|
||||
float refresh_rate = 1.0;
|
||||
|
||||
bool show_clock = false;
|
||||
bool slideshow_enabled = false;
|
||||
bool always_show_clock = false;
|
||||
bool show_indicator = false;
|
||||
float refresh_rate = 1.0;
|
||||
bool show_modkey_text = true;
|
||||
|
||||
/* there's some issues with compositing - upstream removed support for this, but we'll allow people to supply an arg to enable it */
|
||||
bool composite = false;
|
||||
|
@ -576,6 +580,7 @@ static void input_done(void) {
|
|||
else if (strcmp(mod_name, XKB_MOD_NAME_LOGO) == 0)
|
||||
mod_name = "Super";
|
||||
|
||||
if (show_modkey_text) {
|
||||
char *tmp;
|
||||
if (modifier_string == NULL) {
|
||||
if (asprintf(&tmp, "%s", mod_name) != -1)
|
||||
|
@ -585,6 +590,7 @@ static void input_done(void) {
|
|||
modifier_string = tmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auth_state = STATE_AUTH_WRONG;
|
||||
failed_attempts += 1;
|
||||
|
@ -1459,6 +1465,7 @@ int main(int argc, char *argv[]) {
|
|||
{"locktext", required_argument, NULL, 516},
|
||||
{"lockfailedtext", required_argument, NULL, 517},
|
||||
{"greetertext", required_argument, NULL, 518},
|
||||
{"no-modkeytext", no_argument, NULL, 519},
|
||||
|
||||
// fonts
|
||||
{"time-font", required_argument, NULL, 520},
|
||||
|
@ -1768,6 +1775,9 @@ int main(int argc, char *argv[]) {
|
|||
break;
|
||||
case 518:
|
||||
greeter_text = optarg;
|
||||
break;
|
||||
case 519:
|
||||
show_modkey_text = false;
|
||||
break;
|
||||
|
||||
// Font stuff
|
||||
|
|
Loading…
Reference in a new issue