use gio open if available
This commit is contained in:
parent
216b880151
commit
ee586ee194
2 changed files with 13 additions and 3 deletions
4
ctl
4
ctl
|
@ -147,7 +147,11 @@ if [ "$1" == "open" ]; then
|
||||||
if [ $SYSTEM == "Linux" ]; then
|
if [ $SYSTEM == "Linux" ]; then
|
||||||
if [ -e "$PID" ]; then
|
if [ -e "$PID" ]; then
|
||||||
if ps -p `cat "$PID"` > /dev/null; then
|
if ps -p `cat "$PID"` > /dev/null; then
|
||||||
|
if [ -e /usr/bin/gio ]; then
|
||||||
|
gio open "file://${BASE}/openmedialibrary/static/html/load.html"
|
||||||
|
else
|
||||||
xdg-open "file://${BASE}/openmedialibrary/static/html/load.html"
|
xdg-open "file://${BASE}/openmedialibrary/static/html/load.html"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
$PYTHON "${NAME}/oml/gtkstatus.py" $@
|
$PYTHON "${NAME}/oml/gtkstatus.py" $@
|
||||||
exit $?
|
exit $?
|
||||||
|
|
|
@ -264,6 +264,9 @@ def open_file(path=None):
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
cmd += ['open', path]
|
cmd += ['open', path]
|
||||||
elif sys.platform.startswith('linux'):
|
elif sys.platform.startswith('linux'):
|
||||||
|
if os.path.exists('/usr/bin/gio'):
|
||||||
|
cmd += ['gio', 'open', path]
|
||||||
|
else:
|
||||||
cmd += ['xdg-open', path]
|
cmd += ['xdg-open', path]
|
||||||
elif sys.platform == 'win32':
|
elif sys.platform == 'win32':
|
||||||
path = '\\'.join(path.split('/'))
|
path = '\\'.join(path.split('/'))
|
||||||
|
@ -285,6 +288,9 @@ def open_folder(folder=None, path=None):
|
||||||
path = folder
|
path = folder
|
||||||
cmd += ['open', '-R', path]
|
cmd += ['open', '-R', path]
|
||||||
elif sys.platform.startswith('linux'):
|
elif sys.platform.startswith('linux'):
|
||||||
|
if os.path.exists('/usr/bin/gio'):
|
||||||
|
cmd += ['gio', 'open', folder]
|
||||||
|
else:
|
||||||
cmd += ['xdg-open', folder]
|
cmd += ['xdg-open', folder]
|
||||||
elif sys.platform == 'win32':
|
elif sys.platform == 'win32':
|
||||||
path = '\\'.join(path.split('/'))
|
path = '\\'.join(path.split('/'))
|
||||||
|
|
Loading…
Reference in a new issue