Skip to content

Conversation

@abishekvashok
Copy link
Owner

Adds option to unlock terminal put into Cmatrix lock mode by pressing L thrice.

Updates man page with the minor change as well.

Fixes: #87 and #162
Signed-off-by: Abishek V Ashok [email protected]

Adds option to unlock terminal put into Cmatrix lock mode by pressing
L thrice.

Updates man page with the minor change as well.

Fixes: #87 and #162
Signed-off-by: Abishek V Ashok <[email protected]>
Copy link

@PaulCoral PaulCoral left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. That's a good idea to make this option work decently.

It works but it is wierd.
Two cases :

  • You press CTRL-C first and then three times L and it leaves the app. This is unexpected because you tap ctrl-c and one hour later you type three times L (?)
  • Second you press 4 or + times L and it doesn't work as lock_count > 3

if (lock == 1) {
lock_count++;
}
lock = 1;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why ? This causes the bug where you press four times L and it breaks. See previous comment.

Comment on lines +602 to +604
if (lock == 1) {
lock_count++;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add :

} else {
    lock_count = 0;
    lock = 1;
}

/* Global variables */
int console = 0;
int xwindow = 0;
int lock = 0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe change type to bool from stdbool.h ?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

int console = 0;
int xwindow = 0;
int lock = 0;
int lock_count = 0;
Copy link

@PaulCoral PaulCoral Jan 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be unsigned, maybe uint8_t from stdint.h.

@xgpt
Copy link

xgpt commented Jun 4, 2023

Would much prefer to see an option that requires the user's password, although it might suffice to just have a preset password inside of a user's home directory in the config file. A default password might work as well.

If one wanted to avoid PAM integration and just use. correctly permission'd file inside of a user's home directory that might work more easily.

I mean, that's secure enough for our SSH config files and whatnot, should be good enough to implement a shoulder-surfing-screensaver?

I think the use-case of using it as a screenlocker when you step away from your computer would be pretty awesome.

Honestly my coworkers almost certainly don't know linux so ctrl-alt-F1 is basically the same as winkey-L as far as practical efficacy goes to meet needed security for me personally..

@xgpt
Copy link

xgpt commented Jun 4, 2023

Just an idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation about "-l" lock screen option

4 participants