8 ms·
XSuspender Auto-suspend inactive X11 applications
- mhitza 5y agoWhat's up with the swastika symbol in the footer?
- adar 5y agoIt's a Hindu/Buddhist swastika, which is still widely used by adherents of said religions.
- netizen-936824 5y agoAre you sure? There are two of them, each facing opposite directions
- comice 5y agoTheir github avatar has similar iconography: https://github.com/kernc https://github.com/kernc And this other user has the same avatar and explicitly says they are buddhist. https://github.com/neokin https://github.com/neokin no other signs anywhere I can see that give any cause for concern.
- adar 5y agoYep! I speak from experience as an Indian.
- mkdirp 5y agoAccording to Wikipedia[0]: > In Hinduism, the right-facing symbol (clockwise) (卐) is called swastika, symbolizing surya ("sun"), prosperity and good luck, while the left-facing symbol (anti-clockwise) (卍) is called sauwastika, symbolising night or tantric aspects of Kali. [0] https://en.wikipedia.org/wiki/Swastika https://en.wikipedia.org/wiki/Swastika
- deleted 5y ago[deleted]
- gpvos 5y agoI'd say having both of them increases the chance of them being Hindu swastikas. The nazis used only a single direction.
- dtx1 5y agoWhat do programs on linux do when they get the sigstop? Especially complex programs like browsers?
- anthk 5y agoThey stop completely and the window looks frozen.
- vbezhenar 5y agoI don't see how is it different from laptop being suspended. Any program should be ready for that scenario.
- harvie 5y agoIn case there is some stateful network connection (eg. TCP, SSH, HTTP, IMAP, ...) it will probably timeout sooner or later. Then it depends on how well the app can detect it and reconnect once resumed again.
- LinuxBender 5y agoAnd that is probably mostly fine since HTTP is or is supposed to be stateless. IMAP by design can reconnect and one can work around SSH by using MOSH [1] in those cases which is stateless and great for lossy and/or mobile networks. [1] - https://mosh.org/ https://mosh.org/
- gpvos 5y agoThey do nothing anymore. The OS will not give them any CPU time until they are resumed. No network communication, no redrawing of windows. If they started subprocesses, those might still run; I don't know the details about that.
- caaqil 5y agoThis could be useful, I may try it out. For anyone who uses this: how much did it improve the system's performance?
- anthk 5y agoAlso, a good tool to have is cpulimit.
- praash 5y agoSounds like a good idea, especially on applications that you don't need notifications from. I'd love it if suspension could be limited to the awfully bloated web renderer processes and still let the core application handle its background-y application-ish stuff in the background.
- 1kurac 5y agoThe closest option seems to be `resume_every=` [1] which resumes the application so it can handle its accumulated events. All apps are preconfigured with it. [2] [1]: https://kernc.github.io/xsuspender/xsuspender.1.html https://kernc.github.io/xsuspender/xsuspender.1.html [2]: https://github.com/kernc/xsuspender/blob/8949dbee0d489a020c794716f357485589a58b6d/data/xsuspender.conf#L16-L20 https://github.com/kernc/xsuspender/blob/8949dbee0d489a020c7...
- capableweb 5y ago> Zero vulnerabilities or memory leaks Dangerous to put on your landing page. First, if it gains popularity and more people start looking into it, you will find vulnerabilities or memory leaks, it's just a question of effort and time. Secondly, it invites people to prove you wrong, maybe more than wanted, and once they find something, you're gonna have to eat your shoe. Maybe something better would be "Security & Performance high priority" or similar, with better wording.
- caaqil 5y agoI don't think it's a serious statement, just tongue in cheek kinda thing. The next sentence clearly indicates that: > Guaranteed or your money back! (In case you do find any, please let us know.)
- capableweb 5y agoHaha, you're right! I thought that referred to some support contract the developer was offering, but based on the rest of the content of the page (and lack of support contract), I think you're right :)
- goodpoint 5y agoMaybe it was meant as bait for the RIIR crowd.
- rendall 5y agoIt's brilliant, for exactly those reasons. If it motivates someone to find flaws, I would happily claim my code is "flawless". When I'm inevitably proven wrong, I can fix the bug / merge the PR and say "Thanks to [contributor]'s hard work and sharp eyes, now the code is completely flawless!" Hopefully, it would motivate even more to prove me wrong. Really smart, on the part of the developers, to say that.
- BiteCode_dev 5y agoThis will destroy the trust people may have in any author's claim as well...
- nemetroid 5y agoNot a big fan of fake testimonials.
- geokon 5y agoYou used to be able to suspend KDE Activities (sorta like a group of running applications - similar to switching to "desktop" in most DEs). So you could have separate activities for different projects. It was very handy. You could have some huge bloated C++ IDE + documentation + whatever in the background somewhere ready to be resumed when you need it. At some point it all got removed though. I have no idea why (and now "Activities" are kinda pointless). My guess is some applications break and they got lots of complaints - but that's just a guess
- hulitu 5y ago> Modern GUI applications tend to use significant system resources, such as CPU time, even when they're not being actively used. The biggest offender here is the browser. I don't see any room for improvement by this programm here.
- kmarc 5y agoFirefox (and AFAIK Chrome too) has native APIs for unloading/suspending tabs. I use [1] auto tab discard to configure background tab unloading after a certain period of time. Works very well, battery usage reduced greatly. [1]: https://addons.mozilla.org/en-US/firefox/addon/auto-tab-discard/ https://addons.mozilla.org/en-US/firefox/addon/auto-tab-disc...
- Arnavion 5y agoThe problem with "discard"ing tabs is that restoring the tab reloads it, leading to an annoying wait and also losing the state that it was in. Neither browser gives a way to just pause the JS analogous to a SIGSTOP, ie whatever next function the JS calls just blocks, or timer events stop being delivered, until an analogous SIGCONT.
- thatfunkymunki 5y agototally agree, I absolutely hate when I return to a tab and it has to reload, losing the entire reason I didn't close it in the first place.
- pantalaimon 5y agoTeams is also high on the list, but this is essentially a browser too.
- albertzeyer 5y agoFor Chrome, I wrote this simple script: https://github.com/albertz/system-tools/blob/master/bin/chrome-suspender.py https://github.com/albertz/system-tools/blob/master/bin/chro... This works also on MacOSX, and really saves quite some resources. Even with tab suspenders (The Great Suspender), Chrome still takes quite some resources.
- zft 5y ago
- richrichardsson 5y agoThe Swastika was around for a long time before it got appropriated by the Nazi Party. If it had been rotated 45 degrees you might have an argument for it not being cool.
- iqanq 5y agoIf you can't use a symbol in a place that seems a problem about that place.
- 5e92cb50239222b 5y agoEasy for you to say if you haven't had two generations of your family (and all your friend's families) butchered by the Nazis, and half of your country destroyed. I live in such a place and certainly don't consider it "a problem". Buddhists manage just fine, somehow.
- goodpoint 5y agoNo. The swastika is illegal in various countries, including Germany, and for very good reasons given what happend in WW2. Using it in a Buddhist or Hindu context is perfectly fine, of course. But you cannot expect people to see it on a random website without context and be happy with it.
- zppln 5y ago
- rhn_mk1 5y agoI made a similar thing that's done using KDE's focus signals, forwarded from kwin over dbus. The benefits of using kwin's signals are that it potentially works also on Wayland. The downside is that it only works on KDE. I used it to stop Firefox instances that I wasn't using. The quirks are real though, and the clipboard hangup + a remote SSH client combo occasionally made the X session completely unresponsive due to reasons I don't quite remember. The solution was to kill the remote X connection. Another nasty quirk is that switching away from a Jitsi session and back in made the session completely irrecoverable with about 50% chance. Not even a browser restart could help – the sound was permanently gone. I would not recommend this solution for the faint hearted, except maybe in the milder version where the processes get limited access to CPU using cgroups - but not zero, so that they can't choke and take down other parts of the system. Nowadays Firefox improved its CPU usage a little, so I'm not using the program, but I might need to come back to it again.
- heywire 5y agoI’d love to have something like this for Gnome on Wayland. Either automatically like this project, or some kind of “pause” button on the title bar. If only there were a couple more hours per day…
- anthk 5y agoYou can script that with xprop | pgrep.
- deleted 5y ago[deleted]
- AshamedCaptain 5y agoI really dislike these "suspend-on-idle" approaches. Developers should "pay their taxes" (see The Old New Thing) and make applications well-behave on idle, rather than forcing by default to suspend everything which is a real annoyance. Specially in the FLOSS world, I think most programs are actually doing rather nice, since during the powertop era there was some push for people to "pay their taxes". Nowadays it seems that people no longer care as much, but we still have a nice headstart.
- bitwize 5y agoI really dislike these "virtual memory" approaches. Developers should "pay their taxes" and make applications well-behave with regard to memory, rather than forcing by default to segfault on every memory access outside of process bounds which is a real annoyance.
- Filligree 5y agoHeh. Point taken (though I'm not GP), but I think we should try for both?
- AshamedCaptain 5y agoThis is kind of a broken analogy, since we do usually know that an out-of-bounds memory access is definitely an undesirable thing, but how do you know idle CPU activity is an undesirable thing ? In fact, the entire complain is because suspending background processes _is_ annoying, and may even lead to data loss. To put it in another way: > forcing by default to segfault on every memory access outside of process bounds which is a real annoyance. Is forcing to segfault a real annoyance ? Can you show me an example of where it is an annoyance ? Do you prefer to let processes continue accessing obviously undefined memory and/or corrupting the memory of other processes or the system ? On the other hand, suspending a process on idle is an annoyance: * If it was a service, you've just caused a Denial of Service attack. * If it was a timer/cron/alarm of some sort, you've just caused it to miss important events -- the user will arrive late to their meeting. * If it is a client, it suddenly stopped talking to its server, with unknown consequences. * If it was even a simple editor that is just saving the user document as a background task, you've lost user data.
- w-m 5y agoOn macOS, there's App Nap: https://developer.apple.com/library/archive/documentation/Performance/Conceptual/power_efficiency_guidelines_osx/AppNap.html https://developer.apple.com/library/archive/documentation/Pe... I can see in the Activity Monitor that many apps actually are suspended this way: all the Apple stuff like Safari web content, Finder, Xcode, Music, but also quite a long list of 3rd party apps, like Microsoft Office or Sublime Text. Unfortunately none of the messaging apps (Slack, Signal, WhatsApp) and their content and rendering processes ever seem to nap, nor seem other Electron-based stuff like VS Code. They're all happily eating 1-5% CPU, all day. Shame!
- incanus77 5y agoThis is yet another example of the advantages of native apps on the Mac platform, part of why Mac users get so upset about hogs like Slack. App Nap has been on the Mac platform for nearly 10 years.
- w-m 5y agoI’m curious why all the Electron apps fail at napping. As per the linked Apple documentation, there’s no need to opt in or call an API or anything, the app is simply required not to be constantly redrawing the window. Is this where they fail, with gifs and blinking cursors? Can’t be that simple, right, or somebody would have fixed it?
- incanus77 5y agoI'm curious too, but haven't looked into it. There's this: https://codereview.chromium.org/2914913002/ https://codereview.chromium.org/2914913002/ And I do know that in general, Chrome is perceived as a resource hog on the Mac, at the expense of great performance. I'm guessing it hasn't been made easy.
- deleted 5y ago[deleted]
- smoldesu 5y ago> "It's a real shame I cannot use it on Wayland." > - A GNOME Desktop User Alright, I'll give it a try but only because you've got one of the best fake testimonials I've seen in a while.
- mzs 5y agohttps://github.com/kernc/xsuspender https://github.com/kernc/xsuspender - Prevents pasting from clipboard while the selection source process is suspended … - Won't work in remote X sessions. - Won't work with Wayland. … - Processes that take a long time to shut down after their window already disappears may be stopped in the middle of their termination routines.
- michaelmrose 5y ago- A clipboard manager solves the issue with the clipboard because you will be pasting from it. This is noted on https://kernc.github.io/xsuspender/xsuspender.1.html#BUGS https://kernc.github.io/xsuspender/xsuspender.1.html#BUGS See https://wiki.archlinux.org/title/clipboard https://wiki.archlinux.org/title/clipboard - Seems like nobody cares about remote X sessions any longer. - You could probably work up something with sways ipc by subscribing to workspace focus events and suspending apps in workspaces that are hidden. - You can avoid this issue with a timeout on actually suspending things.
- m0ngr31 5y agoI tried to use this for a little bit, but I kept having random issues on things like Telegram and Slack where when it'd gain focus again it couldn't ever keep up with the keyboard as I was typing anymore.
- 1kurac 5y agoWhat settings did you use for Slack, and did you, by chance, have `downclock_on_battery=` enabled? https://github.com/kernc/xsuspender/blob/92ea5c6dfcb0f79eb106ce249299d419a8b36304/data/xsuspender.conf#L44-L46 https://github.com/kernc/xsuspender/blob/92ea5c6dfcb0f79eb10...
- m0ngr31 5y agoI did have that enabled, disabled it and still had the same issue. [Slack] match_wm_class_contains = slack send_signals = false IIRC, I still had issues with this setting
- hjek 5y agoI wish this was available for Sway. Could be great for old laptops.
- Arnavion 5y agoYou can do it for sway too. `swaymsg -t subscribe -m '["window"]'` will send you an event every time focus changes, from which you can get the ID and PID of the newly focused window. However the script will have to track the previously-focused-now-unfocused window itself (which the ID is useful for). Care will also have to be taken to handle the case when focus moves to a container rather than a window. I use a similar SIGSTOP/SIGCONT script myself, but it's for when I turn my desktop PC's monitors off for the night rather than focus changes. It uses `swaymsg -t subscribe -m '["workspace"]'` for `"move"` events; when windows move to the "NOOP-1" workspace their processes get SIGSTOP'd, and when they move from the "NOOP-1" workspace their processes get SIGCONT'd.