MangoHud icon indicating copy to clipboard operation
MangoHud copied to clipboard

[Feature] Limit FPS when in background

Open pongo1231 opened this issue 2 years ago • 9 comments

Just like the "Background Application Max Frame Rate" option the NVIDIA control panel on Windows provides, this would set a custom FPS limit if a game is out of focus. It's one feature I greatly miss on Linux and would help with keeping the resource usage of games down when there's no reason to still run them at full speed.

pongo1231 avatar May 07 '22 23:05 pongo1231

I'd like to chime in on this request too, it would be super handy for multi-boxing.

foundObjects avatar Jun 20 '23 16:06 foundObjects

there is actually the -o option in gamescope, but for me it is not working - https://github.com/ValveSoftware/gamescope#options

koloved avatar Dec 16 '23 12:12 koloved

Here is a script to toggle for anyone else who would like it:

#!/bin/bash

CONFIG_FILE="$HOME/.config/MangoHud/MangoHud.conf"
FPS_HIGH=144
FPS_LOW=10

if grep -q "fps_limit=$FPS_HIGH" "$CONFIG_FILE"; then
    sed -i "s/fps_limit=$FPS_HIGH/fps_limit=$FPS_LOW/" "$CONFIG_FILE"
    notify-send -t 2000 "MangoHud" "FPS limit set to $FPS_LOW"
else
    sed -i "s/fps_limit=$FPS_LOW/fps_limit=$FPS_HIGH/" "$CONFIG_FILE"
    notify-send -t 2000 "MangoHud" "FPS limit set to $FPS_HIGH"
fi

Create .config/MangoHud/MangoHud.conf and write fps_limit=144 to MangoHud.conf and save. For ease of use create a panel and add a launcher for the script or assign it to a shortcut. Make sure to have mangohud %command% as launch property in steam. This feature would be perfect for games where you want to always be online but afk/doing something else, and the game doesn't natively have it.

filen1 avatar May 20 '24 14:05 filen1

You don't need a script to toggle fps limits, this is already a feature in mangohud

flightlessmango avatar May 20 '24 14:05 flightlessmango

its not working in wayland when i tried this last time

@flightlessmango how can i do this ? let me know please

koloved avatar May 22 '24 18:05 koloved

@koloved

its not working in wayland when i tried this last time

We've recently added wayland keybinds, so that's probably why it didn't work

flightlessmango avatar May 23 '24 13:05 flightlessmango