Giter Site home page Giter Site logo

narkhy / matrixhasyou Goto Github PK

View Code? Open in Web Editor NEW
19.0 1.0 3.0 61 KB

A script that simulates on terminal the messages recieved by Thomas Anderson at the beggining of the popular film "The Matrix".

License: GNU General Public License v3.0

Python 100.00%

matrixhasyou's Introduction

MatrixHasYou

MatrixHasYou.mp4

Demonstration video made with peek and cool-retro-term

A script that simulates with the exact right times on the terminal the four messages recieved by Thomas Anderson ("Neo") at the beggining of the popular film "The Matrix":

Wake up, Neo...
The Matrix has you...
Follow the white rabbit.
Knock, knock, Neo.
  • The script can be used anyway and anywhere, though -HINT- you can use it to customize your terminal in GNUL systems (GNUL = "GNU/Linux") by adding a command line at the end of /home/[USER]/.bashrc to run the MatrixHasYou.py script every time you launch your terminal (i.e.; python3 MatrixHasYou.py). This way the console will greet you everytime as if you were Neo :) (achieving this was the reason why I wanted to develop this script in the first place!).

  • This script addresses in two different ways the problem of representing the movie scene typed messages with high fidelity. The first two lines drop the characters with a particular rythm, so they required lists of sleep times for each character (measured from the scene, letter by letter!). For the third line it uses a function (which I called "liveType") that displays the characters in any text string in a fancy way, as if it was being typed live (in this case at a constant rate, though, also measured from the film scene). Appart from the text string itself, "liveType" also takes 'delay' and 'remain' parameters: 'delay' sets the time it takes for new characters to appear, 'remain' sets the time the whole message will remain displayed.

  • As the original scene times can likely result in too long a waiting for your everyday terminal usage, the variables 'remainFactor' and 'delayFactor' affect the whole code, so lower them to make characters appear faster and/or messages be cleared faster. The script is provided already a bit accelerated at 0.2 and 0.7 for these factors, respectively.

  • Escape the script at any time by pressing CTRL + C. Doing so will deploy a quick "Switch! Apoc!" (as Morpheus yells at the black cat 'deja vu' scene) followed by a "671tcH iN Th3 M4tr1x" message before exiting the script.

  • All the text should show in light green, but actual color will depend on your terminal color palette configuration I believe. For a better emulation of the real scene configure your 'light green' terminal color to be hex #5FFFAF (the closest 256 Xterm color to the actual text color in the film).

Things I want to add:

Please check out the "Projects" tab of this repository and feel free to contribute! I'm very much an amatateur junior developer and I don't necesarily know -yet- how to advance all this.

  • Have a little GUI (and/or CLI) from which users can set 'remainFactor' and 'delayFactor', or change the text strings, or the color, or opt-out the exit messages for a faster exit, all of this without having to edit the file manually.

  • Play a slight 'beep' sound on each character appearing, emulating the real scene sound. This would be cool but I ignore if achiavable. I've tryed printing 'bel' escape sequences to no success on my system so far. Also playing a 'knocking on door' sound as the last line appears would add to the drama!

  • Inform the code to use a particular size and font for the messages (i.e.: Tlwg Typewriter Regular) so the messages don't show in the default font/size on each system terminal, but in one resembling better the original from the movie.

  • Add some code so that any keyboard inputs won't be printed on screen while the script runs (since Neo presses "CTRL + X", and later "Esc" twice and these actions show nothing on his screen).

  • for the scripts running from .bashrc ideally they should run only the first time the terminal is launched per session (otherwise, if you launch terminals often, it can rapidly become annoying), or once a day, or once every 8 hours, for instance. But I'm quite a begginer both at Shell scripting and Python and at this moment I have no idea how to accomplish that.

If you know how to accomplish any of these ^ feel free to contribute on the project's Git at: https://github.com/narkhy/MatrixHasYou

If you like "The Matrix" aesthetics, try (and please rate) too my Matrix inspired theme for Firefox at: https://addons.mozilla.org/es/firefox/addon/the-matrix-has-you/

Enjoy! ... as in free beer ;)

https://asciinema.org/a/378478

Call trans opt: received. 9-18-99 14:32:21 REC:Log>

matrixhasyou's People

Contributors

narkhy avatar

Stargazers

Raul Faria avatar Axel avatar Martin avatar CyberMeaticus avatar Expertcoderz avatar K Cole avatar Brayden Storms avatar Gu Xi avatar GotW avatar  avatar Blaze Alan Marshall avatar Arnav Bhanwala avatar Twisted_Code avatar Nate (Mengyong) Lee avatar  avatar Óðinn Dagur Bjarnason avatar Nathan Broyles avatar Phill Johntony avatar  avatar

Watchers

 avatar

matrixhasyou's Issues

Report stupid issue <3

File "MatrixHasYou.py", line 117, in
ClearTrm()
^^^^^^^^
NameError: name 'ClearTrm' is not defined. Did you mean: 'clearTrm'?
(solve with change ClearTrm with clearTrm like suggest)

The script does not work

Thanks for the original program. I would like to report a problem. I downloaded this script, made it executable, but it doesn't work. This is what the terminal says:

./MatrixHasYou.py: line 3: from: command not found
./MatrixHasYou.py: line 4: from: command not found
./MatrixHasYou.py: line 5: from: command not found
./MatrixHasYou.py: line 7: syntax error near unexpected token `('
./MatrixHasYou.py: line 7: `def clearTrm ():'

I using Debian 12. Python3 version 3.11

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.