SkillAgentSearch skills...

Flux

An advanced automation daemon for X11 desktops and window managers. Designed to limit FPS/CPU usage and run commands on window focus and unfocus events. Provides gaming-oriented features. Written mostly in Bash and partially in C.

Install / Use

/learn @itz-me-zappex/Flux

README

flux (FLawless User eXperience)

An advanced automation daemon for X11 desktops and window managers. Designed to limit FPS/CPU usage and run commands on window focus and unfocus events. Provides gaming-oriented features. Written mostly in Bash and partially in C.

Navigation

Known issues

  • Freezing online/multiplayer games by setting unfocus-cpu-limit to 0% causes disconnects.
    • Use less aggressive CPU limit to allow game to send/receive packets.
  • Stuttery audio in unfocused game if CPU limit is pretty aggressive.
    • That should be expected, because cpulimit interrupts process with SIGSTOP and SIGCONT signals very frequently to limit CPU usage. Use unfocus-mute config key, or in case you use Pipewire with Wireplumber, you may want to use wpctl as described here.
  • In some games, with focus-grab-cursor set to true, cursor still able to escape, but does not work outside of window.
    • As example, in "Ori and the Will of the Wisps" game (Unity engine) in windowed mode. Whether do not use focus-grab-cursor config key in such cases or ignore an issue, I can not do anything with this, sorry.
  • Daemon says that it waits for cursor ungrab "without any reason".
    • That happens in case game grabs cursor manually (e.g. in fullscreen mode, not borderless one). Do not use focus-grab-cursor config key in such cases, as it becomes useless.
  • Daemon mutes multiple processes if there is >=2 processes with the same name.
    • Edge case, that happens in case processes do not report their PIDs, so daemon should guess. If you use Pipewire with Wireplumber, you may want to use this method. Keep in mind, this method does not mute processes in sandboxes with PID namespaces, unlike default one.

Screenshot

Daemon running handling already opened windows (-H) in verbose mode (-v) and enabled timestamps (-t).

Features

  • Applying CPU or FPS limit to process on unfocus and unlimit on focus. FPS limiting requires game running using MangoHud with already existing config file.
  • Reducing process priority on unfocus and restore it on focus.
  • Minimizing window on unfocus, useful for borderless windows.
  • Expanding window to fullscreen on focus. Useful for games which handle a window mode in a weird way.
  • Grabbing cursor and redirect input into focused window to prevent cursor from escaping to second monitor in case with borderless windows.
  • Executing commands and scripts on focus, unfocus and window closure events to extend daemon functionality. Daemon provides info about window and process through environment variables.
  • Logging support.
  • Notifications support.
  • Flexible identifiers support to avoid false positives, including regular expressions.
  • Working with processes running through sandbox with PID namespaces, e.g. Firejail.
  • Handling DE/WM restart or switching it on the fly.
  • Support for most of X11 DEs/WMs (EWMH-compatible ones) and does not rely on either GPU or its driver.
  • Detection and handling both explicitly and implicitly opened windows.
  • Muting processes on unfocus and unmuting on focus with Pulseaudio and Pipewire support, including Pipewire Media Session and Wireplumber.

Dependencies

Arch Linux and derivatives

Required: bash util-linux cpulimit coreutils libxres libx11 libxext xorgproto less

Optional: mangohud lib32-mangohud libnotify libpulse

Build: libxres libx11 libxext xorgproto make gcc

Debian and derivatives

Required: bash cpulimit coreutils libxres1 libx11-6 libxext6 less

Optional: mangohud mangohud:i386 libnotify-bin pulseaudio-utils

Build: libxres-dev libx11-dev libxext-dev x11proto-dev make gcc

Void Linux and derivatives

Required: bash util-linux cpulimit coreutils libXres libX11 libXext xorgproto less

Optional: MangoHud MangoHud-32bit libnotify pulseaudio-utils

Build: libXres-devel libX11-devel libXext-devel xorgproto make gcc

Fedora and derivatives

Required: bash util-linux cpulimit coreutils libXres libX11 libXext less

Optional: mangohud mangohud.i686 libnotify pulseaudio-utils

Build: libXres-devel libX11-devel libXext-devel xorg-x11-proto-devel make gcc

OpenSUSE Tumbleweed and derivatives

Required: bash util-linux cpulimit coreutils libXRes1 libX11-6 libXext6 less

Optional: mangohud mangohud-32bit libnotify4 pulseaudio-utils

Build: libXres-devel libX11-devel libXext-devel xorgproto-devel make gcc

Building and installation

Arch Linux and derivatives

Make sure you have installed base-devel package before continue.

Install cpulimit dependency from AUR

git clone https://aur.archlinux.org/cpulimit.git
cd cpulimit
makepkg -sric
cd ..

Clone this repository and use PKGBUILD to install daemon

git clone https://github.com/itz-me-zappex/flux.git
cd flux/packaging/archlinux
makepkg -sric

Remove useless packages installed during building

sudo pacman -Rns $(pacman -Qttdq)

Debian and derivatives

Clone this repository and use script to build package

git clone https://github.com/itz-me-zappex/flux.git
cd flux/packaging/debian
bash build-deb.sh

Install built package

WARNING: You need to figure out with file name, it differs depending on version and architecture, e.g.:

sudo dpkg -i flux_1.31.0.1-1_amd64.deb
sudo apt install -f

Remove useless packages installed during building

sudo apt autoremove

Fedora and derivatives

Install toolset required to create RPM package

sudo dnf install rpmdevtools

Clone this repository

git clone https://github.com/itz-me-zappex/flux.git

Create RPM tree for package

rpmdev-setuptree

Copy RPM spec file into tree

cp flux/packaging/fedora/flux.spec rpmbuild/SPECS/

Download source code

spectool -g rpmbuild/SPECS/flux.spec --sourcedir

Install build dependencies

sudo dn

Related Skills

View on GitHub
GitHub Stars6
CategoryDesign
Updated20d ago
Forks0

Languages

Shell

Security Score

90/100

Audited on Mar 21, 2026

No findings