From 53acfc000171f73333907f2ab5209d7124f63499 Mon Sep 17 00:00:00 2001 From: hi80482 <66435094+hi80482@users.noreply.github.com> Date: Fri, 3 Jul 2020 16:34:19 +0800 Subject: [PATCH] Update config.py (Sync Ver.200626) --- sys.py/config.py | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/sys.py/config.py b/sys.py/config.py index a543cdf..d338456 100644 --- a/sys.py/config.py +++ b/sys.py/config.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import os import platform -from UI.util_funcs import FileExists,ArmSystem +from UI.util_funcs import FileExists,ArmSystem,ReadTheFileContent from pyaria2_rpc.pyaria2 import Xmlrpc CurKeySet = "GameShell" ## >>> PC or GameShell <<< @@ -10,16 +10,19 @@ DontLeave = False BackLight = "/proc/driver/backlight" Battery = "/sys/class/power_supply/axp20x-battery/uevent" +FB_Modes = "/sys/class/graphics/fb0/modes" MPD_socket = "/tmp/mpd.socket" -UPDATE_URL="https://raw.githubusercontent.com/clockworkpi/CPI_DEOT/master/version.json" +#UPDATE_URL="https://raw.githubusercontent.com/clockworkpi/CPI_DEOT/master/version.json" +# disable update +UPDATE_URL="" -VERSION="stable 1.25" +VERSION="D.E.O.T. v2+ 200626" SKIN=None -ButtonsLayout="xbox" +ButtonsLayout="snes" RPC = None ## three timer values in seconds: dim screen, close screen,PowerOff @@ -32,8 +35,11 @@ PowerLevels["balance_saving"] = [40,0,0] PowerLevel = "balance_saving" +GlobalCanvas=None +GlobalScale = 1 + def PreparationInAdv(): - global SKIN,ButtonsLayout + global SKIN,ButtonsLayout,FB_Modes,GlobalScale global PowerLevel global RPC if SKIN != None: @@ -73,7 +79,17 @@ def PreparationInAdv(): else: ArmSystem("sudo iw wlan0 set power_save off >/dev/null") - RPC = Xmlrpc('localhost', 6800) + if FileExists(FB_Modes): + modes = ReadTheFileContent(FB_Modes) + if "320x240" in modes: + GlobalScale = 1 + if "640x480" in modes: + GlobalScale = 2 + if "480x640" in modes: + GlobalScale = 2 + else: + GlobalScale = 1 + + RPC = Xmlrpc('localhost', 6800) PreparationInAdv() ##sys.py/.powerlevel -