A Rust implementation of hyprfreeze, a utility for suspending and resuming processes in Hyprland and Sway window managers (others will be supported in the future).
hyprfreeze-rs allows you to suspend and resume processes on demand, which is particularly useful for:
- Freezing resource-intensive applications when not in use
- Suspending games or video players to free up system resources
- Pausing applications without closing them
This Rust version provides the same functionality as the original bash script but with improved performance and reliability.
- Suspend/resume any process by PID, name, or window selection
- Support for Hyprland and Sway window managers
- Dry-run mode to preview actions
- Notification system to confirm actions
- Process tree handling (suspend/resume all child processes)
- Kill processes with a single command
- Display process information and status
- Clone the repository:
git clone https://github.com/streamtechteam/hyprfreeze-rs.git
cd hyprfreeze-rs- Build the project:
cargo build --release- The binary will be available at
target/release
pstree- For process tree visualizationkill- For sending signals to processesps- For process informationpidof- For finding process IDs by name- For Hyprland:
hyprctland optionallyhyprprop(only for selecting window functionality) - For Sway:
swaymsgand optionallyswayprop(only for selecting window functionality) notify-send- For desktop notificationszenity- For GUI dialogs
you can download the latest binary from the Actions tab.
# Suspend/resume the active window
hyprfreeze-rs -a
# Suspend/resume a process by PID
hyprfreeze-rs -p 1234
# Suspend/resume a process by name
hyprfreeze-rs -n firefox
# Suspend/resume a process by clicking on its window
hyprfreeze-rs -r# Kill a process instead of suspending/resuming
hyprfreeze-rs -a -k
# Show process information
hyprfreeze-rs -a --info
# Get PID of a process without taking action
hyprfreeze-rs -n firefox -P
# Dry run mode (preview actions without executing)
hyprfreeze-rs -a --dry-run
# Silent mode (no notifications)
hyprfreeze-rs -a -s
# Debug mode (show detailed output)
hyprfreeze-rs -a --debug
# Set notification timeout (in milliseconds)
hyprfreeze-rs -a -t 3000Add to your hyprland.conf:
bind = $mod, space, exec, hyprfreeze-rs -a
bind = $mod SHIFT, space, exec, hyprfreeze-rs -a --infohyprfreeze-rs uses POSIX signals to control processes:
SIGSTOPto suspend a processSIGCONTto resume a suspended process
When you target a process, hyprfreeze-rs:
- Identifies the process and all its child processes
- Checks the current state of the process
- Sends the appropriate signal (STOP or CONT) to all processes in the tree
- Displays a notification confirming the action
- Active window detection with
hyprctl - Window selection with
hyprprop(optional , required for window selection functionality)
- Active window detection with
swaymsg - Window selection with
swayprop(optional , required for window selection functionality)
others will be supported in the future.
- Support for additional window managers
- Support for additional desktop environments
- Additional features
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- This project is inspired by and based on hyprfreeze by Zerodya
- Thanks to the Hyprland and Sway communities for their excellent window managers