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.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

More exit options

Lazzu opened this issue · comments

Thank you for this awesome piece of software!

I'm using unimatrix as my screensaver in my hyprland desktop. If someone is interested how, my config is the following:

exec-once = swayidle -w timeout 600 'foot unimatrix'
windowrule=fullscreen,^(foot)$

My first world problem is that I need to push the esc key or spacebar to exit. I'd like to have a bit more options for that:

  • Any key
  • Key(s) defined as an argument
  • Mouse events, including moving mouse if at all possible

Thank you if you even consider these! I'm happy with the software as-is anyway.

Hi @Lazzu,

I think it makes sense that we could have a “screensaver mode” where the process ends on any keypress or mouse movement.

I’m not sure how most screensavers are implemented… We might need to wait a second before checking the mouse, or set a minimum movement distance so that the user doesn’t accidentally end the process right as they’re starting it.

Should be pretty straightforward though. I’ve been wanting to make some improvements, this could be included. I’m away from home for Easter, but I’ll have a look at it when I get home.

I'm starting work on a new major version, so i opened a ticket here: MTRX-9 Add screensaver mode

A workaround I found for getting this behavior is running with the "ignore keyboard" (-i) flag, and having your idle manager kill unimatrix on resume.

This is what my hyperidle.conf looks like:

listener {
    timeout = 300
    on-timeout = kitty --start-as=fullscreen unimatrix -ai -c red
    on-resume = pkill -9 -f /sbin/unimatrix
}

With this, moving the mouse or pressing any key kills the process.