Comments (4)
In which platform Linux/Windows ?
from cmatrix.
Linux, my temporary way was set a shortcuts run cmatrix
with terminal's arguments '--full-screen'
but it's not safe enought, any key-input will enter my desktop without passwd
I wanna be safe, with enter passwd
from cmatrix.
leaving computer
Do you mean shutting it down or in sleep as a screen saver?
@RanchoCooper
from cmatrix.
Since @pipeseroni got me, I have been trying to find a way to do something like this, a way that you can actually have a terminal screensaver using any programs that draw stuff in terminal window.
I was thinking someone might have written a special terminal emulator that also works as screen locker, like a merged program of st + xlock's locking, but I couldn't find one. Or a locker that can grab all the inputs, and leave X's screen as is, then when any inputs come in, popping up a dialog, but no such thing exists. I wonder if we can simply hack xlock for its password input screen.
When I read @RanchoCooper's words a few hours ago:
any key-input will enter my desktop
A terribly bad idea came to me: what if that triggers lock screen?
It's not perfect, because once entering the lock screen, we stay with it, but it's an idea, although a crappy one. Nonetheless, I was wondering if I could somehow achieve it only using simple shell script without any library/tool to interact with X.
So I wrote this script:
#!/bin/bash
# monitor any input device plugging in and unplugging
ICMD="ls /dev/input/by-id/"
ILST="$($ICMD)"
# () to suppress job control message
( while [[ "$($ICMD)" == "$ILST" ]]; do sleep 0.1; done & )
# monitor all inputs
# note: PS/2 won't be in by-*/*, so listening to all input*
for i in /dev/input/event*; do
# just read one byte and exits.
# when unplugging an input device, cat throws "No such device" to stderr
cat "$i" 2>/dev/null | read -n 1 &
done
# wait here until any job exits
wait -n
# kill all the remaining jobs
kill $(jobs -p)
su -c xlock $SUDO_USER
Unfortunately, this has to be run by root, if using tools like xinput or any that can listen to whole X, it doesn't require root. Also, you don't want any power saving with this script, or maybe let mouse input passes, so it can bring computer out of saving mode without triggering lock screen, if switching windows can't be done with mouse.
Anyway, any sane people wouldn't want to use this, I am just throwing the script here for insane people who like insecure stuff.
from cmatrix.
Related Issues (20)
- How to unlock my computer? HOT 5
- "+-" characters instead of japanese in linux TTY when using -l argument HOT 3
- Build failed. Should we add -D_XOPEN_SOURCE_EXTENDED in CMakeLists.txt? HOT 5
- customise colours, including background
- Running one character worth of cmatrix HOT 1
- Missing files causing errors
- Segfault when $TERM is unset on Linux HOT 3
- Characters Above the Bottom Do not Change HOT 1
- The black color setting does not work correctly HOT 2
- Wrong color settings HOT 2
- Allow hex values as colors
- able to read and display Tang poetry. HOT 1
- No transparent backround with xcompmgr compositor HOT 1
- Compile error with current ncurses versions HOT 1
- display unnormal code HOT 1
- undefined reference to `addwstr` on when trying to `make` HOT 5
- termios HOT 1
- termios not working on screensaver when running cmatrix with sudo
- What is the cmatrix license...?
- Is there a plan for another release? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cmatrix.