close status icon on quit(linux)

This commit is contained in:
j 2016-01-09 15:41:42 +05:30
parent 6e8d78c595
commit 6ade6c0928
1 changed files with 7 additions and 2 deletions

View File

@ -2,8 +2,8 @@
import os
from os.path import dirname, abspath
import subprocess
import time
import webbrowser
import _thread
import gi
gi.require_version('Gtk', '3.0')
@ -23,8 +23,13 @@ class OMLIcon:
self.icon.set_title(title)
self.icon.connect("activate", self._click)
self.icon.connect("popup-menu", self._click)
p = subprocess.Popen([ctl, 'start'])
self._p = subprocess.Popen([ctl, 'start'])
GLib.timeout_add_seconds(1, self._open, None)
_thread.start_new_thread(self._wait, ())
def _wait(self):
self._p.wait()
self._quit(None)
def _click(self, icon, button=None, time=None):
if self.menu: