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/FluxREADME
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
- Screenshot
- Features
- Dependencies
- Building and installation
- Post install
- Uninstallation
- Usage
- Configuration
- Tips and tricks
- Apply changes in config file
- Alternative way to mute process audio on unfocus for Pipewire with Wireplumber
- Increase process priority on window appearance
- Overclock NVIDIA GPU on focus
- Change keyboard layout to English on focus
- Increase digital vibrance on focus
- Preload shader cache on window appearance
- Disable night light on focus
- Possible questions
Known issues
- Freezing online/multiplayer games by setting
unfocus-cpu-limitto0%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
cpulimitinterrupts process withSIGSTOPandSIGCONTsignals very frequently to limit CPU usage. Useunfocus-muteconfig key, or in case you use Pipewire with Wireplumber, you may want to usewpctlas described here.
- That should be expected, because
- In some games, with
focus-grab-cursorset totrue, 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-cursorconfig key in such cases or ignore an issue, I can not do anything with this, sorry.
- As example, in "Ori and the Will of the Wisps" game (Unity engine) in windowed mode. Whether do not use
- 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-cursorconfig key in such cases, as it becomes useless.
- That happens in case game grabs cursor manually (e.g. in fullscreen mode, not borderless one). Do not use
- 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
imsg
354.2kiMessage/SMS CLI for listing chats, history, and sending messages via Messages.app.
oracle
354.2kBest practices for using the oracle CLI (prompt + file bundling, engines, sessions, and file attachment patterns).
lobster
354.2kLobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (s
Hook Development
112.2kThis skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.
