Files
Arch-R/packages/addons/tools/system-tools/source/default.py

15 lines
591 B
Python
Raw Normal View History

# SPDX-License-Identifier: GPL-2.0
2018-07-16 20:45:36 +02:00
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
2016-04-25 10:37:15 -07:00
2020-12-25 16:15:10 +01:00
import xbmcaddon
2016-04-25 10:37:15 -07:00
import xbmcgui
import subprocess
2020-12-25 16:15:10 +01:00
import os.path
2020-12-25 16:15:10 +01:00
if os.path.exists(os.path.join(xbmcaddon.Addon().getAddonInfo('path'), 'bin/st')):
yes = xbmcgui.Dialog().yesno('System Tools', 'This is a console-only addon.[CR][CR]Open a terminal window?',nolabel='No',yeslabel='Yes')
if yes:
subprocess.Popen(["systemd-run","sh","-c",". /etc/profile;cd;exec st -e sh -l"], shell=False, close_fds=True)
else:
xbmcgui.Dialog().ok('System Tools', 'This is a console-only addon')