Killing only selected Chrome windows from the CLI ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


--
Philip Rhoades

PO Box 896
Cowra  NSW  2794
Australia
E-mail:  phil@xxxxxxxxxxxxx
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux