How to Make a Python Script Unkillable on NixOS | Tried Running as Root but Failed

Have you considered running the python script under systemd with a timer?

Things to overcome:

  1. on timer tick establish that your user has a graphical session
  2. export the wayland socket and other bits
  3. run grim
1 Like