[-] Zerodya@lemm.ee 2 points 8 months ago

Wow, I wish I knew this workaround during my early gameplay lol.

[-] Zerodya@lemm.ee 7 points 8 months ago

Indeed. However it's necessary to use that command on both the main PID and all its child processes, otherwise you will run into issues like the game video stopping but the game logic still running in the background.

This is just a tool to automate finding the pid (via hyprctl or other ways) and correctly suspending it.

120
submitted 8 months ago by Zerodya@lemm.ee to c/linux_gaming@lemmy.world

Hello! You may be interested in Hyprfreeze if you game in Hyprland. It's a small script that lets you suspend games just like gaming consoles do.

I always find it annoying when I'm playing and I quickly need to leave my desk or talk to someone, only to die to some random enemy in Elden Ring or to miss (unpausable) cutscenes of a game.

I've built this script to prevent that from happening and over time it's reached a point where I find it robust enough and want to share it with others. Any feedback is always appreciated.

Github repo: https://github.com/Zerodya/hyprfreeze

[-] Zerodya@lemm.ee 4 points 1 year ago* (last edited 1 year ago)

There is Nyrna, but it doesn't work on Wayland.

Afaik saving to swap isn't possible as it's something managed by the kernel, although you can try tweaking cgroups. Nyrna also mentions that this isn't currently possible.

[-] Zerodya@lemm.ee 1 points 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.

[-] Zerodya@lemm.ee 3 points 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.ee 6 points 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.

56

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.

8
submitted 1 year ago* (last edited 1 year ago) by Zerodya@lemm.ee to c/selfhost@lemmy.ml

Do your chats look like this? Do you always forget which contacts use which apps? Do you wish there was a way to have all your chats in just one place?

In the following guide I'm going to show you how to use Matrix to achieve your dream of an all-in-one chat app, by using Matrix bridges and securing the connection with Cloudflare Tunnels.

1
submitted 1 year ago* (last edited 1 year ago) by Zerodya@lemm.ee to c/unixporn@lemmy.world

Zerodya

joined 1 year ago