     exit = (code, stdout, stderr) ->
       if code is 0
         atom.packages.unloadPackage(name) if atom.packages.isPackageLoaded(name)
-        callback()
+        callback?()
+        if theme
+          @emit 'theme-uninstalled', pack
+        else
+          @emit 'package-uninstalled', pack
       else
         error = new Error("Uninstalling '#{name}' failed.")
         error.stdout = stdout


    @runCommand(command, args, exit)

  uninstall: ({name}, callback) ->
    atom.packages.deactivatePackage(name) if atom.packages.isPackageActive(name)

    command = @apmCommand

async = require 'async'
{BufferedNodeProcess} = require 'atom'
{Emitter} = require 'emissary'

module.exports =
class PackageManager
