will8211 / unimatrix

Python script to simulate the display from "The Matrix" in terminal. Uses half-width katakana unicode characters by default, but can use custom character sets. Accepts keyboard controls while running. Based on CMatrix.
GNU General Public License v3.0
1.75k stars 161 forks source link

term lock #39

Open petaflot opened 1 year ago

petaflot commented 1 year ago

following #2 but not quite:

I usually like to set screen lock (and often screensaver too) explicitly : I don't like such tools to interfere with my work (reading a document, watching misc media, contemplating code).

using unimatrix as a term lock would be cool ; I started looking into it but I'm not quite sure where to put the code

basically, desired behaviour is "show a matrix until ctrl+Z is pressed ; then request password else restart (and log failed attempts, possibly with webcam shot)"

vlock program can be used as a locker, instead of re-inventing the wheel : https://linux.die.net/man/1/vlock

petaflot commented 1 year ago

this works (and suprisingly also protects from Ctrl+Z)

alias vlock='unimatrix -l cP -c red -s 95 ;
        /usr/bin/vlock &&
        unimatrix -l BPPPsk -c green -s 98 -w'

requires Braille symbols ;-)

petaflot commented 1 year ago

currently in my ~/.bashrc:

unimatrix -l BPPPsk -c green -s 98 -w
alias vlock='unimatrix -l cP -c red -s 98 -w ;
        unimatrix -l BPPPsk -c blue -g black -f -s 95 ;
        /usr/bin/vlock &&
        killall unimatrix 2>/dev/null;
        killall -9 vlock 2>/dev/null;
        unimatrix -l BPPPsk -c green -s 98 -w'

that killall -9 vlock is there in case other terms have been locked. still looking for a way to lock all terms simultanously

IS NOT SAFE when inside screen or tmux