gtkstatus is broken, just launch oml for now

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

10
ctl
View file

@ -162,12 +162,14 @@ if [ "$1" == "open" ]; then
xdg-open "file://${BASE}/openmedialibrary/static/html/load.html" xdg-open "file://${BASE}/openmedialibrary/static/html/load.html"
fi fi
else else
$PYTHON "${NAME}/oml/gtkstatus.py" $@ #$PYTHON "${NAME}/oml/gtkstatus.py" $@
exit $? #exit $?
"$0" start &
fi fi
else else
$PYTHON "$NAME/oml/gtkstatus.py" $@ #$PYTHON "$NAME/oml/gtkstatus.py" $@
exit $? #exit $?
"$0" start &
fi fi
fi fi
exit 0 exit 0

View file

@ -22,6 +22,18 @@ title = "Open Media Library"
ctl = base + '/ctl' 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: class OMLIcon:
menu = None menu = None
icon = None icon = None
@ -81,7 +93,7 @@ class OMLIcon:
@classmethod @classmethod
def is_running(cls): def is_running(cls):
pid = cls.get_pid() pid = cls.get_pid()
if pid and os.path.exists(pid): if pid and check_pid(pid):
return True return True
else: else:
return False return False