-
-
Notifications
You must be signed in to change notification settings - Fork 432
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 timesL
(?) - Second you press 4 or + times
L
and it doesn't work aslock_count > 3
@@ -598,7 +599,14 @@ if (console) { | |||
bold = 2; | |||
break; | |||
case 'L': | |||
if (lock == 1) { | |||
lock_count++; | |||
} | |||
lock = 1; |
There was a problem hiding this comment.
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.
if (lock == 1) { | ||
lock_count++; | ||
} |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
.
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.. |
Just an idea |
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 abishekvashok@gmail.com