Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds option to unlock terminal by pressing L thrice #164

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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

@@ -598,7 +599,14 @@ if (console) {
bold = 2;
break;
case 'L':
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;
}

@@ -85,6 +85,7 @@ typedef struct cmatrix {
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

@@ -85,6 +85,7 @@ typedef struct cmatrix {
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
3 participants