Easily suspending programs

90

Have you ever been faced in a situation where your computer gets totally frozen, and you can barely move you mouse cursor, and wished that there is a pausebutton, like the control + alt + Escape from KDE that kills the selected applications window.

Now you can! – with my little BASHscript.

(If the pasteexpires, please notify me, and I post a fresh one 😉 )

What the script does:
when the script is connected with a keyboard shortcut, when one pressed the combo:
control + alt + ~ or the chosen combination, the mouse cursor will change to a cross, which we can now click on anywindow, than the program will suspend using the STOP signal.

Another shortcut is used to wake the application, it’s the same procedure, point and click the suspended applications window :D.

This is an exportedsettings file for the shortcuts in KDE4, just change $HOME to your path to the script, and than import it using KDE4 System Settings in the category Input Actions.

It works on programs made in>
Python, C, C++, mono-C#,  perl and other languages, except for Java, which has one central virtual machine that loads Java classes.

Usage of my scrpt, for instance, one needs to search something, but the system is overloaded due to the programming IDE (like Eclipse), so it points to the Eclipse window, the scripts the PID from the xwindow-id and suspends the application with kill -STOP ourPid.

Looking forward to make my GNU/Linux box faster and more usable :), despite my machines power  :D.

P.S: if someone knows any better script/program or have made one, please give me a link, please :).