How to Kill all process of a another workspace when system is hanged and unable to move from one WS to other. let me draw the scenario.
WS : Workspace
on WS1 : playing a song via online website through opera.
working on WS3 and get skype call on that
now I tried to move on ws1 (Ctrl +Alt + Shift + <=) but it not working
everything is fine on WS3 ( even writing this problem )
So now i want to free the headphone from that song website .
what to do to release the headphone ( audio controller ) so that it would stop.
Open that same website on same browser that workspace so that it would stop ( failed )
trying xkill but doesnt work
plug in and out USB of headphone but that doesnt work
please suggest any way to accomplish without being shut down
How about alt + F2 & type
killall opera
- this will close down Opera, and all it's subprocesses probably.When you re-start it, if it behaves like Firefox it will resume with all it's tabs retained. (I don't use Opera - so this point I'm not sure of).
If it refuses to die, use
sudo killall -9 opera
which is more heavy-handed but should do it.If you know the process Opera is using to play, you could just kill that - more subtle!
Workspaces are an abstraction of most window managers (GNOME, KDE, LXDE, OpenBox, BusyBox, etc.). Though, honestly, they are only there for organizational purposes and don't reflect the underlying behavior of the actual processes. By this, I mean that each process is not tied to a workspace process.
Say you open Opera in workspace one in GNOME. A partial process tree might look something like this:
Now, let's say that you switch to workspace two and launch Rhythmbox:
So, as you can see, from an underlying process hierarchy standpoint there is no way to separate which applications are running in which workspace. At this point, only the window manager itself knows which applications (actually, application windows) appear on which workspace. So, unless there is a way to query the window manager (in this case, GNOME) as to which windows are on a workspace and which process those windows belong to, there would be no easy way to do this.
There is also the scenario where you might have one process with two windows. For example, you may have two Opera windows with one window on each workspace. Doing such a thing would have the side effect of closing all of your Opera windows, even on the non-troublesome workspace since more than likely (I'm unsure about Opera, but I know Firefox behaves this way) both application windows are tied to the same process. So, even if it were feasible, there may very well be some unintended consequences of this.
So, long story short: no, there really isn't a way to kill processes dependent on which workspace they reside on. In such a case I would do @diEcho described and switch to a virtual terminal (Ctrl-Alt-F1 through F6 usually) and kill the troublesome process with the
kill
command. Of course, this assumes that you know which process is causing the issue which isn't always the case.For your specific problem related to audio, there is another way to accomplish this task:
pavucontrol
(assuming you're using the default PulseAudio and not Jack, ALSA, or OSS). Pavucontrol gives the ability to adjust the volume of or mute individual applications. So, while it wouldn't fix the inability to go to WS1 and directly shot down Opera, it would have solved the audio issue.