Page 1 of 1

Xsuspender - Auto-suspend inactive X11 applications

Posted: Thu Nov 19, 2020 9:54 pm
by sc0ttman

xsuspender

Homepage: https://github.com/kernc/xsuspender

When an application window loses focus, XSuspender tries to match it to
one of the rules in its configuration. If a match is found, the
application is sent a SIGSTOP signal (preventing the process from obtaining
further CPU time). Upon windows regaining focus, the process is seamlessly
continued where it had left off.

Advantages

  • Reduce battery use (increase battery run-time).
  • Reduce interaction latency on low-end CPUs.
  • Reduce CPU fan noise.
  • Avoid apps plotting stuff behind your back.
  • Suspend processes using well-known Unix signals SIGSTOP & SIGCONT ...
  • Preconfigured for recent versions of popular software (Chromium, Firefox, JetBrains IDEs, qBittorrent, VirtualBox ...)

Re: Xsuspender - Auto-suspend inactive X11 applications

Posted: Thu Nov 19, 2020 9:58 pm
by sc0ttman

I'm loving this program so far..

I've used this to successfully limit Palemoons CPU usage, and to finally make it close properly, instead of hanging in the background hammering my CPU...

Example config

~/.config/xsuspender.conf:

Code: Select all

# Preset configuration for some common software below

[Firefox]
match_wm_class_contains = Navigator
match_wm_class_group_contains = Firefox
suspend_subtree_pattern = \/(firefox|plugin-container)
only_on_battery = false

[Palemoon]
match_wm_class_contains = Navigator
match_wm_class_group_contains = Pale moon
only_on_battery = false

[Surf]
match_wm_class_contains = surf
match_wm_class_group_contains = Surf
suspend_subtree_pattern = \/(surf|WebKitWebProcess|WebKitNetworkProcess)
only_on_battery = false

[Tabbed-Surf]
match_wm_class_contains = tabbed-surf
match_wm_class_group_contains = tabbed
suspend_subtree_pattern = \/(tabbed|surf|WebKitWebProcess|WebKitNetworkProcess)
only_on_battery = false

Use this command to find the wm_class of running programs:

Code: Select all

wmctrl -x -u -l

Re: Xsuspender - Auto-suspend inactive X11 applications

Posted: Thu Nov 19, 2020 11:12 pm
by mikewalsh

Um; I don't quite understand, Scotty. Well; I do.....but it's not so much about what the application DOES, as your statement about Palemoon.

Do you mean to say that when you close Pale Moon, it doesn't shut down properly.....that there's still threads hanging around?

Curious. When I shut Pale Moon down - on the occasions that I use it - it's always a clean shut down; I don't think I've ever seen zombies or owt like that, TBH. Unlike Firefox & derivatives, or Chromium + derivatives, which are multi-threaded, Moonchild Productions (the creators of Pale Moon) will very definitely confirm it is single-threaded.....and, moreover, built on the UXP platform, which has never supported multi-threading, apparently.

Mike. :?


Re: Xsuspender - Auto-suspend inactive X11 applications

Posted: Fri Nov 20, 2020 12:16 am
by s243a

It seems like this would be a good program to fire up if one has a lot of tabs open. I'll give it a try sometime :)