Xsuspender - Auto-suspend inactive X11 applications

Moderator: Forum moderators

Post Reply
User avatar
sc0ttman
Posts: 93
Joined: Sat Aug 22, 2020 3:55 pm
Has thanked: 4 times
Been thanked: 33 times

Xsuspender - Auto-suspend inactive X11 applications

Post 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 ...)
User avatar
sc0ttman
Posts: 93
Joined: Sat Aug 22, 2020 3:55 pm
Has thanked: 4 times
Been thanked: 33 times

Re: Xsuspender - Auto-suspend inactive X11 applications

Post 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
User avatar
mikewalsh
Moderator
Posts: 6350
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 882 times
Been thanked: 2073 times

Re: Xsuspender - Auto-suspend inactive X11 applications

Post 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. :?

s243a
Posts: 501
Joined: Mon Dec 09, 2019 7:29 pm
Has thanked: 90 times
Been thanked: 37 times

Re: Xsuspender - Auto-suspend inactive X11 applications

Post 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 :)

Post Reply

Return to “System”