forked from GH-forks/hyprfreeze
chore: rebranding
This commit is contained in:
parent
922c1ee7bc
commit
0476868da6
2 changed files with 77 additions and 48 deletions
114
README.md
114
README.md
|
@ -1,77 +1,105 @@
|
|||
# hyprfreeze
|
||||
# Coolant
|
||||
|
||||
[![basher install](https://www.basher.it/assets/logo/basher_install.svg)](https://www.basher.it/package/)
|
||||
Hyprfreeze is a utility to suspend a game process (and other programs) in Hyprland and Sway.
|
||||
|
||||
Coolant is a utility to suspend a game process, or any other program. It uses
|
||||
the existing `SIGSTOP` and `SIGCONT` signals under the hood.
|
||||
|
||||
Currently Coolant supports X11 (excluding suspending the active window),
|
||||
Hyprland and Sway. Pull requests (e.g. for other Wayland window managers)
|
||||
welcome!
|
||||
|
||||
https://github.com/Zerodya/hyprfreeze/assets/73220426/541318e2-441a-485a-91c5-f58d4f65926a
|
||||
|
||||
**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
|
||||
Based on [Zerodya/hyprfreeze](https://github.com/Zerodya/hyprfreeze).
|
||||
|
||||
**Note:** Running games in [**gamescope**](https://github.com/ValveSoftware/gamescope) is highly recommended. (See [#1](https://github.com/Zerodya/hyprfreeze/issues/1))
|
||||
**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
|
||||
|
||||
**Caveats:**
|
||||
|
||||
Some processes, especially games, might not react well to being suspended and
|
||||
resumed later. Be sure to save your progress/work before trying it!
|
||||
|
||||
**Note:** Running games in
|
||||
[**gamescope**](https://github.com/ValveSoftware/gamescope) is highly
|
||||
recommended. (See
|
||||
[Zerodya/hyprfreeze#1](https://github.com/Zerodya/hyprfreeze/issues/1).)
|
||||
|
||||
## Installation
|
||||
### Arch Linux
|
||||
Hyprfreeze is available in [AUR](https://aur.archlinux.org/packages/hyprfreeze-git).
|
||||
|
||||
### Dependencies
|
||||
- a compatible window manager (`hyprland` or `sway`) to get the PID of the active window
|
||||
- `jq` to parse json
|
||||
- `psmisc` contains 'pstree' which is required to list child processes
|
||||
### Optional
|
||||
- [`hyprprop`](https://github.com/vilari-mickopf/hyprprop) or [`swayprop`](https://git.alternerd.tv/alterNERDtive/swayprop) to get the pid of a window by selecting it with your mouse
|
||||
### Highly Recommended
|
||||
- [`gamescope`](https://github.com/ValveSoftware/gamescope) fixes mouse input not working in other XWayland windows after pausing a Wine game. It's also the superior way to game in Wayland anyway.
|
||||
|
||||
### Basher
|
||||
Hyprfreeze is compatible with shell script package manager [Basher](https://basher.it).
|
||||
|
||||
Coolant is compatible with shell script package manager
|
||||
[Basher](https://basher.it).
|
||||
|
||||
```bash
|
||||
basher install Zerodya/hyprfreeze
|
||||
basher install git.alternerd.tv/alterNERDtive/coolant
|
||||
```
|
||||
(Github mirror: `basher install alterNERDtive/coolant`.)
|
||||
|
||||
### Manual
|
||||
Clone this repo and symlink the `hyprfreeze` script to a directory in your `PATH`:
|
||||
|
||||
Clone this repo and symlink the `coolant` script to a directory in your `PATH`:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/Zerodya/hyprfreeze.git Hyprfreeze
|
||||
ln -s $(pwd)/Hyprfreeze/hyprfreeze $HOME/.local/bin
|
||||
git clone https://git.alternerd.tv/alterNERDtive/coolant.git Coolant
|
||||
ln -s $(pwd)/Coolant/coolant $HOME/.local/bin
|
||||
```
|
||||
|
||||
### Dependencies
|
||||
|
||||
- JQ to parse json
|
||||
- pstree which is required to list child processes
|
||||
- (Optional) xprop on X11,
|
||||
[hyprprop](https://github.com/vilari-mickopf/hyprprop) (on Hyprland) or
|
||||
[swayprop](https://git.alternerd.tv/alterNERDtive/swayprop) (on Sway) to get
|
||||
the pid of a window by selecting it with your mouse.
|
||||
- (Optional) Systemd for detecting session type / desktop via `loginctl`.
|
||||
|
||||
## Usage
|
||||
|
||||
Add a bind in your Hyprland or Sway config to pause the current active window:
|
||||
|
||||
```bash
|
||||
# ~/.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/swayprop must be installed)
|
||||
|
||||
-s, --silent don't send notification
|
||||
-t, --notif-timeout notification timeout in milliseconds (default 5000)
|
||||
--info show information about the process
|
||||
--dry-run doesn't actually suspend/resume a process, useful with --info
|
||||
--debug enable debug mode
|
||||
```
|
||||
-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 (requires xprop
|
||||
/ hyprprop / swayprop)
|
||||
|
||||
-s, --silent don't send notification
|
||||
-t, --notif-timeout notification timeout in milliseconds (default 5000)
|
||||
--info show information about the process
|
||||
--dry-run doesn't actually perform an action, useful with --info
|
||||
--debug enable debug mode
|
||||
```
|
||||
|
||||
### Examples:
|
||||
|
||||
```bash
|
||||
# Pause game by process name
|
||||
hyprfreeze -n eldenring.exe
|
||||
coolant -n eldenring.exe
|
||||
```
|
||||
|
||||
```bash
|
||||
# Get info about a process by clicking on its window, without suspending it
|
||||
hyprfreeze -r --info --dry-run
|
||||
coolant -r --info --dry-run
|
||||
```
|
||||
## 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.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
function printHelp() {
|
||||
cat <<EOF
|
||||
Usage: hyprfreeze (-a | -p <pid> | -n <name> | -r) [options]
|
||||
Usage: $(basename "$0") (-a | -p <pid> | -n <name> | -r) [options]
|
||||
|
||||
Utility to suspend a game process (and other programs) in Hyprland.
|
||||
|
||||
|
@ -12,12 +12,13 @@ Options:
|
|||
-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/swayprop must be installed)
|
||||
-r, --prop toggle suspend by clicking on window (requires xprop
|
||||
/ hyprprop / swayprop)
|
||||
|
||||
-s, --silent don't send notification
|
||||
-t, --notif-timeout notification timeout in milliseconds (default 5000)
|
||||
--info show information about the process
|
||||
--dry-run doesn't actually suspend/resume a process, useful with --info
|
||||
--dry-run doesn't actually perform an action, useful with --info
|
||||
--debug enable debug mode
|
||||
EOF
|
||||
}
|
||||
|
@ -40,7 +41,7 @@ function toggleFreeze() {
|
|||
# Prevent suspending itself
|
||||
local pid_of_script=$$
|
||||
if echo "$PIDS" | grep -q "$pid_of_script"; then
|
||||
echo "You are trying to suspend the hyprfreeze process."
|
||||
echo "You are trying to suspend the Coolant process."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -161,7 +162,7 @@ function sendNotification() {
|
|||
|
||||
local message="PID $PID"
|
||||
|
||||
notify-send "${title}" "${message}" -t "$NOTIF_TIMEOUT" -a Hyprfreeze
|
||||
notify-send "${title}" "${message}" -t "$NOTIF_TIMEOUT" -a Coolant
|
||||
}
|
||||
|
||||
function args() {
|
Loading…
Reference in a new issue