Hey all! If you do any gaming on Hyprland, you might be interested in hyprfreeze.

It’s a very simple bash script I made to “freeze” a game process (or any other process) in Hyprland, which you may find useful to:

  • Pause games during unpausable cutscenes
  • Save system resources (CPU and GPU are free, the process is saved in RAM)

Should just work^^TM in most scenarios but my testings can only go so far and any feedback would be very appreciated.

    • Zerodya@lemm.eeOP
      link
      fedilink
      English
      arrow-up
      5
      ·
      1 year ago

      Haha, yes! Ctrl+Z sends a TSPT signal to a terminal process, while this script sends a STOP signal to every process in a game’s process tree. Both get resumed with a SIGCONT so they’re kinda similar.

    • Zerodya@lemm.eeOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      1 year ago

      No, it uses hyprctl to get the pid of the current active window. Which compositor are you using? It might be possible to get the pid in a different way.

        • Zerodya@lemm.eeOP
          link
          fedilink
          English
          arrow-up
          1
          ·
          1 year ago

          I’m not familiar with qtile, but I’m fairly sure there’s currently no way to get information about the active window on mutter unfortunately.

          Thing with wayland is, each compositor has to implement things their own way, so you’re limited to what your compositor allows you to do.

          For instance, you can get window information in sway with swaymsg. On other compositors you may have to find workarounds.

  • stepanzak@iusearchlinux.fyi
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    That’s cool! Do you know about any similar solution for KDE Plasma/Kwin by any chance? Also, would it be theoretically possible to save the process to some kind of swapfile on disk so it doesn’t take up space in RAM?