JD,
On 2018-03-27 12:10, JD wrote:
On 03/26/2018 06:59 PM, Philip Rhoades wrote:
> People,
>
> This command exits the chrome process tree gracefully, in all window
> managers:
>
> pkill --oldest chrome
>
> but it is not what I want to do - when Chrome goes mad and the whole
> system starts grinding to a halt (I know from experience it is Chrome)
> I want to try and work out what specific Chrome tab or window is the
> problem. Chrome has its own task manager:
>
> SHIFT ESC
>
> but you can't kill a window with all its tabs from there.
>
> Using:
>
> ps aux | grep "beta\/chrome"
>
> seems to indicate individual tabs?
>
> Using:
>
> xprop _NET_WM_PID
>
> and clicking on the different windows always give the same id.
>
> I wrote the script below using wmctrl and xkill to allow me to kill
> the Chrome windows in reverse order of creation but killing the first
> Chrome window kills all Chrome windows. The xkill man page says the
> "program is very dangerous" and:
>
> -id resource
>
> This option specifies the X identifier for the resource whose creator
> is to be aborted.
>
> - so it looks like aborting "creator" gets rid of everything.
>
> Any suggestions about fixing my script to selectively kill single
> Chrome windows?
>
> Thanks,
>
> Phil.
>
>
> #!/bin/bash
>
> wins=`wmctrl -l | sort -r`
> IFS=$'\n' # bash 4
> readarray -t winsarr <<< "$wins"
>
> for win in "${winsarr[@]}"
> do
> IFS=' ' read id junk1 junk2 name <<< $win
> echo "$id $name"
> echo -n "Kill?: "
> read junk
> if [ "$junk" == "Y" ]; then
> xkill -frame -id "$id"
> fi
> done
>
>
You cannot kill specific windows of an app using general purpose CLI
commands.
You need a command that talks directly to chrome and, for example, ask
it for
the window id's of all of it's windows.
And the you might tell chrome to kill some specific set of window id's.
So, it all has to be under the direct control of chrome main process.
I am not sure that such an interface exists.
Damn . .
If enought people scream
at google for such an interface, then google /might/ provide such a
cli.
I won't be holding my breath - there are so many other common-sense app
things that Google has not done for years, I wouldn't even bother asking
for this . .
Thanks,
Phil.
--
Philip Rhoades
PO Box 896
Cowra NSW 2794
Australia
E-mail: phil(a)pricom.com.au