Skip to content

Agzes/LBS

Repository files navigation

🦀 Rust 🪶 GTK4 🚀 Wayland & X11 📂 Open-source

LBS Logo

     $\Huge{\textsf{Linux Battle Shaper (LBS)}}$ v.0.1

A powerful, universal per-process CPU limiter for Linux with Wayland and X11 support.


 Installation 

 Usage 

 Build 

Linux Battle Shaper (LBS) is a modern Linux utility (similar to BES for Windows) that allows you to limit the CPU usage of specific processes.

✨ Features

  • 🎯 Precise Limiting: Set CPU usage limits from 0% to 99.9%.
  • 🔄 Fine-tuned Cycles: Adjust the "Awake Cycle" frequency from 2ms to 400ms to balance smoothness and resource saving.
  • 🖥️ Universal Focus Monitor: Automatically unlimit a process when you switch to its window. Supports:
    • Hyprland (native)
    • Sway (native)
    • KDE Plasma (Wayland via D-Bus and X11)
    • GNOME, XFCE, and others (X11/XWayland via xprop)
  • 📥 Tray: Minimize to a system tray icon showing the current status (Active/Idle).
  • 🛡️ Safe: Automatically sends SIGCONT to all limited processes on exit to prevent them from hanging in a STOP state.
  • ⚡ Fast: Written in Rust for maximum performance and minimal memory footprint.

📥 Installation

AppImage (binary)

  • AppImage: Download the latest version from the Releases page. (run chmod +x LBS-v0.1.0.AppImage and then ./LBS-v0.1.0.AppImage and see Usage)

AUR (auto-build)

yay -S lbs

or

paru -S lbs 

🚀 Usage

  1. Launch LBS.
  2. Click the "Target..." button to select a process from the list.
  3. Adjust the limit slider (e.g., -50% will limit the process to half its speed).
  4. Enable "Unlimit at Focus" in the settings if you want the app to run at full speed whenever its window is active. (optional)

📦 Build

Prerequisites

You will need Rust, GTK4, xprop and dbus-send installed on your system.

Building from Source

  1. Install Rust.

  2. Install build-time dependencies:

    • Ubuntu/Debian: sudo apt install build-essential libgtk-4-dev pkg-config
    • Arch Linux: sudo pacman -S --needed base-devel gtk4 pkg-config
    • Fedora: sudo dnf install gtk4-devel pkgconf-pkg-config
  3. Clone the repository:

    git clone https://github.com/Agzes/LBS.git
    cd LBS
  4. Build the project:

    cargo build --release
  5. Run the binary:

    ./target/release/lbs

🗑️ Correct uninstall

AppImage:

  1. Open LBS and go to "Settings"
  2. Click "Uninstall (Remove all traces)"
  3. Remove the AppImage file.

AUR:

  1. Run yay -Rns lbs or paru -Rns lbs

📄 License

Distributed under the MIT License. See LICENSE for more information.


With ❤️ by Agzes
pls ⭐ project!

About

📊 • LBS - Linux Battle Shaper (just BES or Battle Encoder Shirasé for linux) • Software that lets you control per-process CPU usage on linux!

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages