close status icon on quit(linux)
This commit is contained in:
parent
6e8d78c595
commit
6ade6c0928
1 changed files with 7 additions and 2 deletions
|
@ -2,8 +2,8 @@
|
||||||
import os
|
import os
|
||||||
from os.path import dirname, abspath
|
from os.path import dirname, abspath
|
||||||
import subprocess
|
import subprocess
|
||||||
import time
|
|
||||||
import webbrowser
|
import webbrowser
|
||||||
|
import _thread
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
gi.require_version('Gtk', '3.0')
|
gi.require_version('Gtk', '3.0')
|
||||||
|
@ -23,8 +23,13 @@ class OMLIcon:
|
||||||
self.icon.set_title(title)
|
self.icon.set_title(title)
|
||||||
self.icon.connect("activate", self._click)
|
self.icon.connect("activate", self._click)
|
||||||
self.icon.connect("popup-menu", 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)
|
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):
|
def _click(self, icon, button=None, time=None):
|
||||||
if self.menu:
|
if self.menu:
|
||||||
|
|
Loading…
Reference in a new issue