gtkstatus is broken, just launch oml for now

This commit is contained in:
j 2019-01-25 16:36:54 +05:30
commit 0bfbebb21d
2 changed files with 19 additions and 5 deletions

View file

@ -22,6 +22,18 @@ title = "Open Media Library"
ctl = base + '/ctl'
def check_pid(pid):
if not os.path.exists(pid):
return False
try:
with open(pid, 'r') as fd:
pid = int(fd.read().strip())
os.kill(pid, 0)
except OSError:
return False
else:
return True
class OMLIcon:
menu = None
icon = None
@ -81,7 +93,7 @@ class OMLIcon:
@classmethod
def is_running(cls):
pid = cls.get_pid()
if pid and os.path.exists(pid):
if pid and check_pid(pid):
return True
else:
return False