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"
fi
else
$PYTHON "${NAME}/oml/gtkstatus.py" $@
exit $?
#$PYTHON "${NAME}/oml/gtkstatus.py" $@
#exit $?
"$0" start &
fi
else
$PYTHON "$NAME/oml/gtkstatus.py" $@
exit $?
#$PYTHON "$NAME/oml/gtkstatus.py" $@
#exit $?
"$0" start &
fi
fi
exit 0

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