chrome: initial add-on

This commit is contained in:
CvH 2018-06-21 10:56:17 +02:00
parent dff2142ce9
commit 6b4eac3ba1
13 changed files with 641 additions and 0 deletions

View File

@ -0,0 +1,2 @@
100
- initial release

View File

@ -0,0 +1 @@
Xft.dpi: 96

View File

@ -0,0 +1,13 @@
/storage/.kodi/addons/browser.chrome/pango-modules/pango-arabic-lang.so ArabicScriptEngineLang PangoEngineLang PangoRenderNone arabic:*
/storage/.kodi/addons/browser.chrome/pango-modules/pango-basic-fc.so BasicScriptEngineFc PangoEngineShape PangoRenderFc common:
/storage/.kodi/addons/browser.chrome/pango-modules/pango-indic-lang.so devaIndicScriptEngineLang PangoEngineLang PangoRenderNone devanagari:*
/storage/.kodi/addons/browser.chrome/pango-modules/pango-indic-lang.so bengIndicScriptEngineLang PangoEngineLang PangoRenderNone bengali:*
/storage/.kodi/addons/browser.chrome/pango-modules/pango-indic-lang.so guruIndicScriptEngineLang PangoEngineLang PangoRenderNone gurmukhi:*
/storage/.kodi/addons/browser.chrome/pango-modules/pango-indic-lang.so gujrIndicScriptEngineLang PangoEngineLang PangoRenderNone gujarati:*
/storage/.kodi/addons/browser.chrome/pango-modules/pango-indic-lang.so oryaIndicScriptEngineLang PangoEngineLang PangoRenderNone oriya:*
/storage/.kodi/addons/browser.chrome/pango-modules/pango-indic-lang.so tamlIndicScriptEngineLang PangoEngineLang PangoRenderNone tamil:*
/storage/.kodi/addons/browser.chrome/pango-modules/pango-indic-lang.so teluIndicScriptEngineLang PangoEngineLang PangoRenderNone telugu:*
/storage/.kodi/addons/browser.chrome/pango-modules/pango-indic-lang.so kndaIndicScriptEngineLang PangoEngineLang PangoRenderNone kannada:*
/storage/.kodi/addons/browser.chrome/pango-modules/pango-indic-lang.so mlymIndicScriptEngineLang PangoEngineLang PangoRenderNone malayalam:*
/storage/.kodi/addons/browser.chrome/pango-modules/pango-indic-lang.so sinhIndicScriptEngineLang PangoEngineLang PangoRenderNone sinhala:*

View File

@ -0,0 +1,10 @@
#
# pangorc file for uninstalled operation. If pango-viewer is run with
# this file in the current directory it will set it as PANGO_RC_FILE
#
[Pango]
ModuleFiles = /storage/.kodi/addons/browser.chrome/config/pango.modules
[PangoX]
AliasFiles = /storage/.kodi/addons/browser.chrome/config/pangx.aliases

View File

@ -0,0 +1,104 @@
# How to generate those file
# cd /LE/build.LibreELEC-Generic/gdk-pixbuf-2.36.12/.install_pkg/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders
# cp /LE/build.LibreELEC-Generic/gdk-pixbuf-2.36.12/.install_pkg/usr/bin/gdk-pixbuf-query-loaders .
# ./gdk-pixbuf-query-loaders *.so > pixbuf.loaders.cache
# GdkPixbuf Image Loader Modules file
# Automatically generated file, do not edit
# Created by gdk-pixbuf-query-loaders from gdk-pixbuf-2.36.12
#
"/storage/.kodi/addons/browser.chrome/gdk-pixbuf-modules/libpixbufloader-ani.so"
"ani" 4 "gdk-pixbuf" "Windows animated cursor" "LGPL"
"application/x-navi-animation" ""
"ani" ""
"RIFF ACON" " xxxx " 100
"/storage/.kodi/addons/browser.chrome/gdk-pixbuf-modules/libpixbufloader-bmp.so"
"bmp" 5 "gdk-pixbuf" "BMP" "LGPL"
"image/bmp" "image/x-bmp" "image/x-MS-bmp" ""
"bmp" ""
"BM" "" 100
"/storage/.kodi/addons/browser.chrome/gdk-pixbuf-modules/libpixbufloader-gif.so"
"gif" 4 "gdk-pixbuf" "GIF" "LGPL"
"image/gif" ""
"gif" ""
"GIF8" "" 100
"/storage/.kodi/addons/browser.chrome/gdk-pixbuf-modules/libpixbufloader-icns.so"
"icns" 4 "gdk-pixbuf" "MacOS X icon" "GPL"
"image/x-icns" ""
"icns" ""
"icns" "" 100
"/storage/.kodi/addons/browser.chrome/gdk-pixbuf-modules/libpixbufloader-ico.so"
"ico" 5 "gdk-pixbuf" "Windows icon" "LGPL"
"image/x-icon" "image/x-ico" "image/x-win-bitmap" "image/vnd.microsoft.icon" "application/ico" "image/ico" "image/icon" "text/ico" ""
"ico" "cur" ""
" \001 " "zz znz" 100
" \002 " "zz znz" 100
"/storage/.kodi/addons/browser.chrome/gdk-pixbuf-modules/libpixbufloader-jpeg.so"
"jpeg" 5 "gdk-pixbuf" "JPEG" "LGPL"
"image/jpeg" ""
"jpeg" "jpe" "jpg" ""
"\377\330" "" 100
"/storage/.kodi/addons/browser.chrome/gdk-pixbuf-modules/libpixbufloader-png.so"
"png" 5 "gdk-pixbuf" "PNG" "LGPL"
"image/png" ""
"png" ""
"\211PNG\r\n\032\n" "" 100
"/storage/.kodi/addons/browser.chrome/gdk-pixbuf-modules/libpixbufloader-pnm.so"
"pnm" 4 "gdk-pixbuf" "PNM/PBM/PGM/PPM" "LGPL"
"image/x-portable-anymap" "image/x-portable-bitmap" "image/x-portable-graymap" "image/x-portable-pixmap" ""
"pnm" "pbm" "pgm" "ppm" ""
"P1" "" 100
"P2" "" 100
"P3" "" 100
"P4" "" 100
"P5" "" 100
"P6" "" 100
"/storage/.kodi/addons/browser.chrome/gdk-pixbuf-modules/libpixbufloader-qtif.so"
"qtif" 4 "gdk-pixbuf" "QuickTime" "LGPL"
"image/x-quicktime" "image/qtif" ""
"qtif" "qif" ""
"abcdidsc" "xxxx " 100
"abcdidat" "xxxx " 100
"/storage/.kodi/addons/browser.chrome/gdk-pixbuf-modules/libpixbufloader-tga.so"
"tga" 4 "gdk-pixbuf" "Targa" "LGPL"
"image/x-tga" ""
"tga" "targa" ""
" \001\001" "x " 100
" \001\t" "x " 100
" \002" "xz " 99
" \003" "xz " 100
" \n" "xz " 100
" \v" "xz " 100
"/storage/.kodi/addons/browser.chrome/gdk-pixbuf-modules/libpixbufloader-tiff.so"
"tiff" 5 "gdk-pixbuf" "TIFF" "LGPL"
"image/tiff" ""
"tiff" "tif" ""
"MM *" " z " 100
"II* " " z" 100
"II* \020 CR\002 " " z zzz z" 0
"/storage/.kodi/addons/browser.chrome/gdk-pixbuf-modules/libpixbufloader-xbm.so"
"xbm" 4 "gdk-pixbuf" "XBM" "LGPL"
"image/x-xbitmap" ""
"xbm" ""
"#define " "" 100
"/*" "" 50
"/storage/.kodi/addons/browser.chrome/gdk-pixbuf-modules/libpixbufloader-xpm.so"
"xpm" 4 "gdk-pixbuf" "XPM" "LGPL"
"image/x-xpixmap" ""
"xpm" ""
"/* XPM */" "" 100

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -0,0 +1,117 @@
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2016-present Team LibreELEC
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
PKG_NAME="chrome"
PKG_VERSION="1.0"
PKG_REV="100"
PKG_ARCH="x86_64"
PKG_LICENSE="Custom"
PKG_SITE="http://www.google.com/chrome"
PKG_DEPENDS_TARGET="toolchain at-spi2-atk atk cairo chrome-libXcomposite \
chrome-libXdamage chrome-libXfixes chrome-libXi chrome-libXrender \
chrome-libXtst chrome-libxcb cups gdk-pixbuf gtk3 harfbuzz \
libXcursor libxss nss pango scrnsaverproto unclutter"
PKG_SECTION="browser"
PKG_SHORTDESC="Google Chrome Browser"
PKG_LONGDESC="Google Chrome Browser"
PKG_TOOLCHAIN="manual"
PKG_IS_ADDON="yes"
PKG_ADDON_NAME="Chrome"
PKG_ADDON_TYPE="xbmc.python.script"
PKG_ADDON_PROVIDES="executable"
make_target() {
:
}
addon() {
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/bin \
$ADDON_BUILD/$PKG_ADDON_ID/config \
$ADDON_BUILD/$PKG_ADDON_ID/gdk-pixbuf-modules \
$ADDON_BUILD/$PKG_ADDON_ID/lib
# config
cp -P $PKG_DIR/config/* $ADDON_BUILD/$PKG_ADDON_ID/config
# atk
cp -PL $(get_build_dir atk)/.install_pkg/usr/lib/libatk-1.0.so.0 $ADDON_BUILD/$PKG_ADDON_ID/lib
# cairo
cp -PL $(get_build_dir cairo)/.install_pkg/usr/lib/libcairo-gobject.so.2 $ADDON_BUILD/$PKG_ADDON_ID/lib
cp -PL $(get_build_dir cairo)/.install_pkg/usr/lib/libcairo.so.2 $ADDON_BUILD/$PKG_ADDON_ID/lib
# gdk-pixbuf
cp -PL $(get_build_dir gdk-pixbuf)/.install_pkg/usr/lib/libgdk_pixbuf-2.0.so.0 $ADDON_BUILD/$PKG_ADDON_ID/lib
# gdk-pixbuf modules
cp -PL $(get_build_dir gdk-pixbuf)/.install_pkg/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders/* $ADDON_BUILD/$PKG_ADDON_ID/gdk-pixbuf-modules
# gtk3 gdk3
cp -PL $(get_build_dir gtk3)/.install_pkg/usr/lib/libgtk-3.so.0 $ADDON_BUILD/$PKG_ADDON_ID/lib
cp -PL $(get_build_dir gtk3)/.install_pkg/usr/lib/libgdk-3.so.0 $ADDON_BUILD/$PKG_ADDON_ID/lib
# harfbuzz
cp -PL $(get_build_dir harfbuzz)/.install_pkg/usr/lib/libharfbuzz.so.0 $ADDON_BUILD/$PKG_ADDON_ID/lib
cp -PL $(get_build_dir harfbuzz)/.install_pkg/usr/lib/libharfbuzz-icu.so* $ADDON_BUILD/$PKG_ADDON_ID/lib
# libatk-bridge
cp -PL $(get_build_dir at-spi2-atk)/.install_pkg/usr/lib/libatk-bridge-2.0.so.0 $ADDON_BUILD/$PKG_ADDON_ID/lib
# libatspi
cp -PL $(get_build_dir at-spi2-core)/.install_pkg/usr/lib/libatspi.so.0 $ADDON_BUILD/$PKG_ADDON_ID/lib
# libcups
cp -PL $(get_build_dir cups)/cups/libcups.so.2 $ADDON_BUILD/$PKG_ADDON_ID/lib
# libxcb
cp -PL $(get_build_dir chrome-libxcb)/.install_pkg/usr/lib/libxcb.so.1 $ADDON_BUILD/$PKG_ADDON_ID/lib
# libXcomposite
cp -PL $(get_build_dir chrome-libXcomposite)/.install_pkg/usr/lib/libXcomposite.so.1 $ADDON_BUILD/$PKG_ADDON_ID/lib
# libXcursor
cp -PL $(get_build_dir libXcursor)/.install_pkg/usr/lib/libXcursor.so.1 $ADDON_BUILD/$PKG_ADDON_ID/lib
# libXdamage
cp -PL $(get_build_dir chrome-libXdamage)/.install_pkg/usr/lib/libXdamage.so.1 $ADDON_BUILD/$PKG_ADDON_ID/lib
# libXfixes
cp -PL $(get_build_dir chrome-libXfixes)/.install_pkg/usr/lib/libXfixes.so.3 $ADDON_BUILD/$PKG_ADDON_ID/lib
# libXi
cp -PL $(get_build_dir chrome-libXi)/.install_pkg/usr/lib/libXi.so.6 $ADDON_BUILD/$PKG_ADDON_ID/lib
# libXrender
cp -PL $(get_build_dir chrome-libXrender)/.install_pkg/usr/lib/libXrender.so.1 $ADDON_BUILD/$PKG_ADDON_ID/lib
# libxss
cp -PL $(get_build_dir libxss)/.install_pkg/usr/lib/libXss.so.1 $ADDON_BUILD/$PKG_ADDON_ID/lib
# libXtst
cp -PL $(get_build_dir chrome-libXtst)/.install_pkg/usr/lib/libXtst.so.6 $ADDON_BUILD/$PKG_ADDON_ID/lib
# pango
cp -PL $(get_build_dir pango)/.install_pkg/usr/lib/libpangocairo-1.0.so.0 $ADDON_BUILD/$PKG_ADDON_ID/lib
cp -PL $(get_build_dir pango)/.install_pkg/usr/lib/libpango-1.0.so.0 $ADDON_BUILD/$PKG_ADDON_ID/lib
cp -PL $(get_build_dir pango)/.install_pkg/usr/lib/libpangoft2-1.0.so.0 $ADDON_BUILD/$PKG_ADDON_ID/lib
# unclutter
cp -P $(get_build_dir unclutter)/.install_pkg/usr/bin/unclutter $ADDON_BUILD/$PKG_ADDON_ID/bin
}

View File

@ -0,0 +1,94 @@
#!/bin/bash
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2018-present Team LibreELEC
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
. /etc/profile
oe_setup_addon browser.chrome
ICON=$ADDON_DIR/resources/icon.png
CONTROL_FILE=/tmp/curl.done
DATA_FILE=/tmp/curl.data
# check chrome version
case "$1" in
'latest')
CHROME_VER="$(curl -s https://dl.google.com/linux/chrome/rpm/stable/x86_64/repodata/other.xml.gz | \
gzip -df | awk -F\" '/pkgid.*-stable/{ print $10 }')"
;;
'repo')
CHROME_VER="67.0.3396.87"
;;
*)
echo "Usage $0 { latest | repo }"
exit 0;
;;
esac
# check for enough free disk space
if [ $(df . | awk 'END {print $4}') -lt 400000 ]; then
kodi-send --action="Notification(Not enough disk space, at least 400mb are required,30000,${ICON})" >/dev/null
exit 0;
fi
# remove install status and folders
if [ -f $ADDON_DIR/extract.ok ]; then
rm $ADDON_DIR/extract.ok
fi
if [ -d $ADDON_DIR/chrome-bin ]; then
rm -rf $ADDON_DIR/chrome-bin
fi
if [ -d $ADDON_DIR/tmp_download ]; then
rm -rf $ADDON_DIR/tmp_download
fi
# create tmp download dir
mkdir -p $ADDON_DIR/tmp_download
cd $ADDON_DIR/tmp_download
echo "Downloading Chrome version $CHROME_VER"
# download chrome
rm -f ${CONTROL_FILE} ${DATA_FILE}
(
curl -# -O -C - http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_$CHROME_VER-1_amd64.deb 2>${DATA_FILE}
touch ${CONTROL_FILE}
) | \
while [ : ]; do
[ -f ${DATA_FILE} ] && prog="$(tr '\r' '\n' < ${DATA_FILE} | tail -n 1 | sed -r 's/^[# ]+/#/;s/^[^0-9]*//g')" || prog=
kodi-send --action="Notification(Downloading Chrome,"${prog:-0.0%}",3000,${ICON})" >/dev/null
[ -f ${CONTROL_FILE} ] && break
sleep 4
done
rm -f ${CONTROL_FILE} ${DATA_FILE}
## extract chrome
# extrat chrome.deb
kodi-send --action="Notification(Extracting Chrome,starting,1000,${ICON})" >/dev/null
ar -x google-chrome-stable_$CHROME_VER-1_amd64.deb
# extract data.tar.xz to chrome-bin directory
mkdir $ADDON_DIR/chrome-bin
tar xf data.tar.xz --strip-components=4 -C $ADDON_DIR/chrome-bin ./opt/google/chrome
# cleanup
rm -rf $ADDON_DIR/tmp_download
touch $ADDON_DIR/extract.ok
kodi-send --action="Notification(Extracting Chrome,finished,1000,${ICON})" >/dev/null

View File

@ -0,0 +1,113 @@
#!/bin/sh
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2016-present Team LibreELEC
# Copyright (C) 2009-2014 Stephan Raue (stephan@openelec.tv)
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
. /etc/profile
oe_setup_addon browser.chrome
# check if chrome is already successful installed
if [ ! -f "$ADDON_DIR/extract.ok" ]; then
cd $ADDON_DIR
chrome-downloader repo
fi
if [ -e $ADDON_HOME/env ]
then
. $ADDON_HOME/env
fi
# fix file permissons (zip packaging)
chmod +x $ADDON_DIR/chrome-bin/chrome
chmod 4755 $ADDON_DIR/chrome-bin/chrome-sandbox
# make sure we use "own" gtk/pango/nss/etc
export LD_LIBRARY_PATH=$ADDON_DIR/lib
# configure pango/pixbuf
export PANGO_RC_FILE=$ADDON_DIR/config/pangorc
export GDK_PIXBUF_MODULE_FILE=$ADDON_DIR/config/pixbuf.loaders.cache
# font rendering in gtk widgets is brokeen with nvidia blob. use our Xdefaults
export XENVIRONMENT=$ADDON_DIR/config/Xdefaults
# start unclutter
if [ "$HIDE_CURSOR" == "true" ]
then
unclutter &
UNCLUTTER_PID=$!
fi
# vaapi
LIBVA_DRIVERS_PATH="/usr/lib/dri:$ADDON_DIR/lib"
LIBVA_DRIVER_NAME=''
case $VAAPI_MODE in
'intel')
LIBVA_DRIVER_NAME='i965'
chrome_OPTS="$chrome_OPTS --enable-accelerated-video"
;;
'amd')
LIBVA_DRIVER_NAME='vdpau'
chrome_OPTS="$chrome_OPTS --enable-accelerated-video"
;;
'nvidia')
LIBVA_DRIVER_NAME='vdpau'
chrome_OPTS="$chrome_OPTS --enable-accelerated-video --allow-no-sandbox-job --disable-gpu-sandbox"
;;
*)
LIBGL_ALWAYS_SOFTWARE='1'
export LIBGL_ALWAYS_SOFTWARE
esac
export LIBVA_DRIVER_NAME LIBVA_DRIVERS_PATH
# windowed
case $WINDOW_MODE in
'maximized') chrome_OPTS="$chrome_OPTS --start-maximized";;
'kiosk') chrome_OPTS="$chrome_OPTS --kiosk";;
esac
# rasterization
case $RASTER_MODE in
'off') chrome_OPTS="$chrome_OPTS --disable-accelerated-2d-canvas --disable-gpu-compositing";;
'force') chrome_OPTS="$chrome_OPTS --enable-gpu-rasterization --enable-accelerated-2d-canvas --ignore-gpu-blacklist";;
esac
# alsa
if [ ! -z $ALSA_DEVICE ]; then
chrome_OPTS="$chrome_OPTS --alsa-output-device=$ALSA_DEVICE"
fi
# HACK!!! to get sound at Chrome stop pulseaudio
systemctl stop pulseaudio
# start chrome
LD_PRELOAD=/usr/lib/libGL.so $ADDON_DIR/chrome-bin/chrome \
$chrome_OPTS \
--no-sandbox \
--user-data-dir=$ADDON_HOME/profile \
--test-type $@ \
2>&1 | tee $ADDON_LOG_FILE
# kill unclutter
if [ "$HIDE_CURSOR" == "true" ]
then
kill $UNCLUTTER_PID
fi
# HACK!!! to get sound at Kodi start pulseaudio
sleep 5
systemctl start pulseaudio

View File

@ -0,0 +1,116 @@
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2018-present Team LibreELEC
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
import os
import sys
import time
import xbmcaddon
import subprocess
from xml.dom.minidom import parse
sys.path.append('/usr/share/kodi/addons/service.libreelec.settings')
import oe
__addon__ = xbmcaddon.Addon();
__path__ = os.path.join(__addon__.getAddonInfo('path'), 'bin') + '/'
pauseXBMC = __addon__.getSetting("PAUSE_XBMC")
def pauseXbmc():
if pauseXBMC == "true":
xbmc.executebuiltin("PlayerControl(Stop)")
xbmc.audioSuspend()
xbmc.enableNavSounds(False)
def resumeXbmc():
if pauseXBMC == "true":
xbmc.audioResume()
xbmc.enableNavSounds(True)
def startchrome(args):
try:
new_env = os.environ.copy()
new_env['VAAPI_MODE'] = __addon__.getSetting('VAAPI_MODE')
new_env['WINDOW_MODE'] = __addon__.getSetting('WINDOW_MODE')
new_env['RASTER_MODE'] = __addon__.getSetting('RASTER_MODE')
new_env['ALSA_DEVICE'] = ''
if __addon__.getSetting('USE_CUST_AUDIODEVICE') == 'true':
alsa_device = __addon__.getSetting('CUST_AUDIODEVICE_STR')
else:
alsa_device = getAudioDevice()
if not alsa_device == None and not alsa_device == '':
new_env['ALSA_DEVICE'] = alsa_device
chrome_params = args + ' ' + \
__addon__.getSetting('HOMEPAGE')
subprocess.call(__path__ + 'chrome-start ' + chrome_params, shell=True, env=new_env)
except Exception, e:
oe.dbg_log('chrome', unicode(e))
def isRuning(pname):
tmp = os.popen("ps -Af").read()
pcount = tmp.count(pname)
if pcount > 0:
return True
return False
def getAudioDevice():
try:
dom = parse("/storage/.kodi/userdata/guisettings.xml")
audiooutput=dom.getElementsByTagName('audiooutput')
for node in audiooutput:
dev = node.getElementsByTagName('audiodevice')[0].childNodes[0].nodeValue
if dev.startswith("ALSA:"):
dev = dev.split("ALSA:")[1]
if dev == "@":
return None
if dev.startswith("@:"):
dev = dev.split("@:")[1]
else:
# not ALSA
return None
except:
return None
if dev.startswith("CARD="):
dev = "plughw:" + dev
return dev
if (not __addon__.getSetting("firstrun")):
__addon__.setSetting("firstrun", "1")
__addon__.openSettings()
try:
args = ' '.join(sys.argv[1:])
except:
args = ""
if args == 'widevine':
install_widevine()
elif args == 'flash':
install_flash()
else:
if not isRuning('chrome'):
pauseXbmc()
startchrome(args)
while isRuning('chrome'):
time.sleep(1)
resumeXbmc()

View File

@ -0,0 +1,46 @@
# Kodi Media Center language file
# Addon Name: chrome
# Addon id: browser.chrome
# Addon Provider: Team LibreELEC
msgid ""
msgstr ""
msgctxt "#30000"
msgid "General"
msgstr ""
msgctxt "#30001"
msgid "Chrome Configuration"
msgstr ""
msgctxt "#30002"
msgid "Stop Kodi Player and Suspend AudioEngine"
msgstr ""
msgctxt "#30003"
msgid "HW Acceleration Mode"
msgstr ""
msgctxt "#30004"
msgid "Rasterization Mode"
msgstr ""
msgctxt "#30005"
msgid "Window Mode"
msgstr ""
msgctxt "#30006"
msgid "Default Homepage"
msgstr ""
msgctxt "#30007"
msgid "Use Custom Audio Device"
msgstr ""
msgctxt "#30008"
msgid "Audio Device"
msgstr ""
msgctxt "#30009"
msgid "Hide Cursor"
msgstr ""

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<settings>
<category label="30000">
<setting label="30001" type="lsep"/>
<setting type="sep" />
<setting id="PAUSE_XBMC" type="bool" label="30002" default="true" />
<setting id="VAAPI_MODE" type="labelenum" label="30003" values="off|intel|amd|nvidia" default="intel"/>
<setting id="RASTER_MODE" type="labelenum" label="30004" values="default|off|force" default="default" subsetting="true" enable="!eq(-1,0)"/>
<setting id="WINDOW_MODE" type="labelenum" label="30005" values="maximized|kiosk|none" default="maximized" />
<setting id="HOMEPAGE" type="text" label="30006" default="https://libreelec.tv" />
<setting id="USE_CUST_AUDIODEVICE" type="bool" label="30007" default="false" />
<setting id="CUST_AUDIODEVICE_STR" type="text" label="30008" visible="eq(-1,true)" subsetting="true" default="" />
<setting id="HIDE_CURSOR" type="bool" label="30009" default="false" />
</category>
</settings>

View File

@ -0,0 +1,10 @@
<settings version="2">
<setting id="CUST_AUDIODEVICE_STR" default="true"></setting>
<setting id="HIDE_CURSOR" default="true">false</setting>
<setting id="HOMEPAGE" default="true">https://libreelec.tv</setting>
<setting id="PAUSE_XBMC">true</setting>
<setting id="RASTER_MODE" default="true">default</setting>
<setting id="USE_CUST_AUDIODEVICE" default="true">false</setting>
<setting id="VAAPI_MODE" default="true">intel</setting>
<setting id="WINDOW_MODE" default="true">maximized</setting>
</settings>