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

More exit options #43

Open Lazzu opened 1 year ago

Lazzu commented 1 year ago

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:

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

will8211 commented 1 year ago

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.

will8211 commented 1 year ago

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

serpens-ignis commented 7 months ago

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.