Skip to content

Zerodya/hyprfreeze

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 

Repository files navigation

❄️ hyprfreeze

Hyprfreeze is a utility to suspend a game process (and other programs) in Hyprland.

Hyprfreeze.mp4

Useful to:

  • Pause single-player games that can't normally be paused (Elden Ring, Baldur's Gate 3, ...)
  • Pause cutscenes to read the subtitles or if you suddenly need to leave your desk
  • Save system resources (excluding RAM) if you need them for another computer task, or if the game's pause menu uses too many

Note: This repo is feature-complete so it will not receive frequent updates. I still use this tool everyday and will update it to fix potential bugs or if hyprctl changes its syntax.

Dependencies

  • hyprland to get the PID of the active window
  • jq to parse json
  • psmisc contains 'pstree' which is required to list child processes

Optional

  • hyprprop to get the pid of a window by selecting it with your mouse

Installation

Arch Linux

Hyprfreeze is available in the AUR. (Maintained by Aethar)

Manual

Clone this repo and symlink the hyprfreeze script to a directory in your PATH:

git clone https://github.com/Zerodya/hyprfreeze.git Hyprfreeze
ln -s $(pwd)/Hyprfreeze/hyprfreeze $HOME/.local/bin

Then install completions for your shell:

Bash:

sudo ln -s $(pwd)/completions/bash/hyprfreeze /usr/share/bash-completion/completions/

Zsh:

sudo ln -s $(pwd)/completions/zsh/_hyprfreeze /usr/share/zsh/site-functions/

Fish:

sudo ln -s $(pwd)/completions/fish/hyprfreeze.fish /usr/share/fish/completions/

Usage

Add a bind in your Hyprland config to pause the current active window:

# ~/.config/hypr/hyprland.conf
...
# Toggle freeze on active window
bind = , PAUSE, exec, hyprfreeze -a

Available flags

-h, --help            show help message

-a, --active          toggle suspend by active window
-p, --pid             toggle suspend by process id
-n, --name            toggle suspend by process name/command
-r, --prop            toggle suspend by clicking on window (hyprprop must be installed)

-s, --silent          don't send notification
-t, --notif-timeout   notification timeout in milliseconds (default 5000)
--dry-run             doesn't actually suspend/resume a process
--debug               enable debug mode
--no-xorg-workaround  skip the XWayland mouse capture workaround (other XWayland windows may become non-interactable)

Example:

# Pause game by process name
hyprfreeze -n eldenring.exe

Caveats

  • System audio may stop when pausing Linux native games (no Proton/Wine) like Minecraft. This is a Pipewire issue. To fix it, run the game with the env variable: ALSOFT_DRIVERS=pulse

  • Pausing XWayland games (no Gamescope or Proton Wayland) may stop the mouse from working in other XWayland apps like Discord. A workaround has been implemented that quickly switches workspaces to release the mouse capture before pausing the window.

Disclaimer

There is always the risk, although slim, that an application may crash.

This is intrinsically related to modifying running processes and is not something that Hyprfreeze can prevent.

Please make sure to save your data before using hyprfreeze.