Util.killall: add utility for killing unwanted processes

Since we have to use pkill, kludgily, for the right combination of
portability and featurefulness, put the code in one place rather than
duplicating it everywhere.

https://bugzilla.gnome.org/show_bug.cgi?id=635089
This commit is contained in:
Dan Winship
2010-12-17 15:30:12 -05:00
parent 8bdfb8df68
commit 23353fb77a
4 changed files with 31 additions and 15 deletions

View File

@ -6,6 +6,7 @@ const Signals = imports.signals;
const MessageTray = imports.ui.messageTray;
const NotificationDaemon = imports.ui.notificationDaemon;
const Util = imports.misc.util;
const STANDARD_TRAY_ICON_IMPLEMENTATIONS = {
'bluetooth-applet': 'bluetooth',
@ -33,8 +34,7 @@ StatusIconDispatcher.prototype = {
// app-indicators, so that applications fall back to normal
// status icons
// http://bugzilla.gnome.org/show_bug.cgi=id=621382
let p = new Shell.Process({ args: ['pkill', '-f', '^([^ ]*/)?indicator-application-service$']});
p.run();
Util.killall('indicator-application-service');
},
_onTrayIconAdded: function(o, icon) {