├── .gitignore ├── LICENSE ├── Menu └── GameShell │ ├── 11_Terminal.sh │ ├── 12_PICO-8.sh │ ├── 13_Make Music.sh │ ├── 14_Write.sh │ ├── 15_Browse Files.sh │ ├── 16_Get Help.sh │ ├── 90_Software.sh │ ├── 97_Reload UI.sh │ ├── 98_Settings │ ├── About │ │ └── __init__.py │ ├── Airplane │ │ └── __init__.py │ ├── Bluetooth │ │ ├── __init__.py │ │ ├── agent.py │ │ └── net_item.py │ ├── Brightness │ │ ├── __init__.py │ │ ├── brightness_page.py │ │ ├── myvars.py │ │ └── pages.py │ ├── ButtonsLayout │ │ └── __init__.py │ ├── GateWay │ │ └── __init__.py │ ├── Languages │ │ └── __init__.py │ ├── PowerOFF │ │ └── __init__.py │ ├── PowerOptions │ │ └── __init__.py │ ├── Sound │ │ ├── __init__.py │ │ ├── myvars.py │ │ ├── pages.py │ │ └── sound_page.py │ ├── Storage │ │ └── __init__.py │ ├── Time │ │ ├── __init__.py │ │ ├── list_item.py │ │ ├── logger.py │ │ ├── myvars.py │ │ ├── pages.py │ │ └── timezone_lib_list_page.py │ ├── Update │ │ └── __init__.py │ ├── Wifi │ │ ├── __init__.py │ │ ├── myvars.py │ │ ├── net_item.py │ │ ├── pages.py │ │ └── wifi_list.py │ ├── __init__.py │ ├── list_item.py │ ├── list_page.py │ ├── myvars.py │ └── pages.py │ └── 99_PowerOFF │ └── __init__.py ├── README.md ├── awesome ├── rc.lua └── themes │ └── default │ ├── README │ ├── background.png │ ├── background_white.png │ ├── layouts │ ├── cornerne.png │ ├── cornernew.png │ ├── cornernw.png │ ├── cornernww.png │ ├── cornerse.png │ ├── cornersew.png │ ├── cornersw.png │ ├── cornersww.png │ ├── dwindle.png │ ├── dwindlew.png │ ├── fairh.png │ ├── fairhw.png │ ├── fairv.png │ ├── fairvw.png │ ├── floating.png │ ├── floatingw.png │ ├── fullscreen.png │ ├── fullscreenw.png │ ├── magnifier.png │ ├── magnifierw.png │ ├── max.png │ ├── maxw.png │ ├── spiral.png │ ├── spiralw.png │ ├── tile.png │ ├── tilebottom.png │ ├── tilebottomw.png │ ├── tileleft.png │ ├── tileleftw.png │ ├── tiletop.png │ ├── tiletopw.png │ └── tilew.png │ ├── submenu.png │ ├── taglist │ ├── squarefw.png │ └── squarew.png │ ├── theme.lua │ └── titlebar │ ├── close_focus.png │ ├── close_normal.png │ ├── floating_focus_active.png │ ├── floating_focus_inactive.png │ ├── floating_normal_active.png │ ├── floating_normal_inactive.png │ ├── maximized_focus_active.png │ ├── maximized_focus_inactive.png │ ├── maximized_normal_active.png │ ├── maximized_normal_inactive.png │ ├── minimize_focus.png │ ├── minimize_normal.png │ ├── ontop_focus_active.png │ ├── ontop_focus_inactive.png │ ├── ontop_normal_active.png │ ├── ontop_normal_inactive.png │ ├── sticky_focus_active.png │ ├── sticky_focus_inactive.png │ ├── sticky_normal_active.png │ └── sticky_normal_inactive.png ├── install.sh ├── load.sh ├── skin ├── default │ ├── Menu │ │ └── GameShell │ │ │ ├── 20_Retro Games │ │ │ ├── MAME.png │ │ │ ├── MGBA.png │ │ │ └── NESTOPIA.png │ │ │ ├── CaveStory.png │ │ │ ├── Music Player.png │ │ │ ├── PICO-8.png │ │ │ ├── PowerOFF.png │ │ │ ├── Reload UI.png │ │ │ ├── Retro Games.png │ │ │ ├── RetroArch.png │ │ │ ├── Settings.png │ │ │ ├── Sleep.png │ │ │ ├── Terminal.png │ │ │ ├── TinyCloud.png │ │ │ └── freeDM.png │ ├── sys.py │ │ └── gameshell │ │ │ ├── blank.png │ │ │ ├── footbar_icons │ │ │ └── footbar.png │ │ │ ├── icons │ │ │ ├── DialogBoxs.png │ │ │ ├── GS.png │ │ │ ├── _L.png │ │ │ ├── _R.png │ │ │ ├── about_bg.png │ │ │ ├── airwire.png │ │ │ ├── blueselector.png │ │ │ ├── buttonslayout.png │ │ │ ├── done.png │ │ │ ├── empty.png │ │ │ ├── heart.png │ │ │ ├── icon_sd.png │ │ │ ├── light.png │ │ │ ├── lock.png │ │ │ ├── needwifi_bg.png │ │ │ ├── online.png │ │ │ ├── pico8_md5_err.png │ │ │ ├── pico8_notfound.png │ │ │ ├── rom_download.png │ │ │ ├── roundcorners.png │ │ │ ├── scale.png │ │ │ ├── sheep_bg.png │ │ │ ├── sheep_body.png │ │ │ ├── sheep_head.png │ │ │ ├── star.png │ │ │ ├── sys.png │ │ │ ├── tape.png │ │ │ └── vol.png │ │ │ └── titlebar_icons │ │ │ ├── battery_unknown.png │ │ │ ├── bluetooth.png │ │ │ ├── soundvolume.png │ │ │ ├── wifi.png │ │ │ ├── withcharging.png │ │ │ └── without_charging.png │ └── truetype │ │ ├── NotoSansCJK-Regular.ttf │ │ ├── NotoSansMono-Regular.ttf │ │ ├── VarelaRound-Regular.ttf │ │ └── VeraMono.ttf └── pocket │ ├── Menu │ └── GameShell │ │ ├── Browse Files.png │ │ ├── Get Help.png │ │ ├── Make Music.png │ │ ├── PICO-8.png │ │ ├── PowerOFF.png │ │ ├── Reload UI.png │ │ ├── Settings.png │ │ ├── Software.png │ │ ├── Terminal.png │ │ └── Write.png │ ├── config.ini │ ├── sys.py │ └── gameshell │ │ ├── blank.png │ │ ├── folder.png │ │ ├── footbar_icons │ │ └── footbar.png │ │ ├── icons │ │ ├── DialogBoxs.png │ │ ├── GS.png │ │ ├── _L.png │ │ ├── _R.png │ │ ├── about_bg.png │ │ ├── airwire.png │ │ ├── blueselector.png │ │ ├── buttonslayout.png │ │ ├── done.png │ │ ├── empty.png │ │ ├── heart.png │ │ ├── icon_sd.png │ │ ├── light.png │ │ ├── lock.png │ │ ├── needwifi_bg.png │ │ ├── online.png │ │ ├── pico8_md5_err.png │ │ ├── pico8_notfound.png │ │ ├── rom_download.png │ │ ├── roundcorners.png │ │ ├── scale.png │ │ ├── sheep_bg.png │ │ ├── sheep_body.png │ │ ├── sheep_head.png │ │ ├── star.png │ │ ├── sys.png │ │ ├── tape.png │ │ └── vol.png │ │ └── titlebar_icons │ │ ├── battery_unknown.png │ │ ├── bluetooth.png │ │ ├── soundvolume.png │ │ ├── wifi.png │ │ ├── withcharging.png │ │ └── without_charging.png │ └── truetype │ ├── NotoSansCJK-Regular.ttf │ ├── NotoSansMono-Regular.ttf │ ├── VarelaRound-Regular.ttf │ └── VeraMono.ttf └── sys.py ├── UI ├── CommercialSoftwarePackage │ └── __init__.py ├── Emulator │ ├── __init__.py │ ├── fav_list_page.py │ ├── list_item.py │ ├── rom_list_page.py │ └── rom_so_confirm_page.py ├── __init__.py ├── above_all_patch.py ├── confirm_page.py ├── constants.py ├── counter_screen.py ├── createby_screen.py ├── delete_confirm_page.py ├── download.py ├── download_process_page.py ├── egg.png ├── foot_bar.py ├── full_screen.py ├── icon_item.py ├── icon_pool.py ├── info_page_list_item.py ├── info_page_selector.py ├── keyboard.py ├── keyboard_keys.layout ├── keys_def.py ├── label.py ├── lang_manager.py ├── main_screen.py ├── multi_icon_item.py ├── multilabel.py ├── page.py ├── scroller.py ├── simple_name_space.py ├── skin_manager.py ├── slider.py ├── text_bulletinboard.py ├── text_item.py ├── textarea.py ├── title_bar.py ├── untitled_icon.py ├── util_funcs.py └── widget.py ├── battery.py ├── config.py ├── gameshell └── wallpaper │ ├── desktopbg.jpg │ ├── gameover.png │ ├── loading.png │ ├── seeyou.png │ └── updating.png ├── langs ├── 00_English.ini ├── 01_日本語.ini ├── 03_简体中文.ini ├── 04_繁体中文.ini ├── 05_Spanish.ini └── 06_French.ini ├── libs ├── DBUS │ └── __init__.py ├── __init__.py ├── bluezutils │ └── __init__.py ├── easing.py └── roundrects │ ├── __init__.py │ └── roundrects.py └── run.py /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | sys.py/.powerlevel 3 | sys.py/.buttonslayout 4 | sys.py/.lang 5 | *.cfg 6 | **/Jobs/* 7 | !**/Jobs/.gitkeep 8 | !**/Jobs/00_lowpower.sh 9 | !**/Jobs/00_lowpower.alias 10 | -------------------------------------------------------------------------------- /Menu/GameShell/11_Terminal.sh: -------------------------------------------------------------------------------- 1 | DISPLAY=":0" vala-terminal -fs 8 -v --fullscreen -------------------------------------------------------------------------------- /Menu/GameShell/12_PICO-8.sh: -------------------------------------------------------------------------------- 1 | pico8 -------------------------------------------------------------------------------- /Menu/GameShell/13_Make Music.sh: -------------------------------------------------------------------------------- 1 | DISPLAY=":0" sunvox -------------------------------------------------------------------------------- /Menu/GameShell/14_Write.sh: -------------------------------------------------------------------------------- 1 | DISPLAY=":0" leafpad 2 | -------------------------------------------------------------------------------- /Menu/GameShell/15_Browse Files.sh: -------------------------------------------------------------------------------- 1 | DISPLAY=":0" pcmanfm ~ 2 | -------------------------------------------------------------------------------- /Menu/GameShell/16_Get Help.sh: -------------------------------------------------------------------------------- 1 | DISPLAY=":0" surf /usr/share/pocketchip-localdoc/index.html 2 | -------------------------------------------------------------------------------- /Menu/GameShell/90_Software.sh: -------------------------------------------------------------------------------- 1 | DISPLAY=":0" gksudo synaptic-pkexec 2 | -------------------------------------------------------------------------------- /Menu/GameShell/97_Reload UI.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exit 0 4 | -------------------------------------------------------------------------------- /Menu/GameShell/98_Settings/Bluetooth/net_item.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | 5 | ## local UI import 6 | from UI.page import Page 7 | from UI.label import Label 8 | from UI.icon_item import IconItem 9 | from UI.multi_icon_item import MultiIconItem 10 | from UI.icon_pool import MyIconPool 11 | from UI.skin_manager import MySkinManager 12 | 13 | 14 | class NetItemMultiIcon(MultiIconItem): 15 | _CanvasHWND = None 16 | _Parent = None 17 | _Width = 18 18 | _Height = 18 19 | 20 | def Draw(self): 21 | self._CanvasHWND.blit(self._ImgSurf,(self._PosX,self._PosY+(self._Parent._Height-self._Height)/2,self._Width,self._Height), 22 | (0,self._IconIndex*self._IconHeight,self._IconWidth,self._IconHeight)) 23 | 24 | class NetItemIcon(IconItem): 25 | 26 | _CanvasHWND = None 27 | _Parent = None 28 | _Width = 18 29 | _Height = 18 30 | 31 | def Draw(self): 32 | self._CanvasHWND.blit(self._ImgSurf,(self._PosX,self._PosY+(self._Parent._Height-self._Height)/2,self._Width,self._Height)) 33 | 34 | 35 | class NetItem(object): 36 | _PosX = 0 37 | _PosY = 0 38 | _Width = 0 39 | _Height = 30 40 | 41 | _Atts = {} 42 | 43 | _Channel="" # '10' 44 | _Stren = "" ## 19% 45 | 46 | _Parent = None 47 | _IsActive = False 48 | 49 | _Icons = {} ## wifi strength and security icons 50 | _Labels = {} 51 | _FontObj = None 52 | 53 | _RSSI = 0 54 | _MacAddr="" 55 | _Path = "" #/org/bluez/hci0/dev_34_88_5D_97_FF_26 56 | 57 | def __init__(self): 58 | self._Labels = {} 59 | self._Icons = {} 60 | 61 | def SetActive(self,act): 62 | self._IsActive = act 63 | 64 | def Init(self, path, object): 65 | self._Path = path 66 | self._Atts = object 67 | 68 | is_active=False 69 | if "Address" in object: 70 | self._MacAddr = object["Address"] 71 | 72 | if "Connected" in object: 73 | if object["Connected"] == 1: 74 | is_active=True 75 | 76 | if is_active: 77 | self.SetActive(is_active) 78 | 79 | 80 | name_label = Label() 81 | name_label._PosX = 12 82 | name_label._CanvasHWND = self._Parent._CanvasHWND 83 | 84 | mac_addr = self._MacAddr 85 | 86 | if "Name" in object: 87 | if len(object["Name"]) > 3: 88 | mac_addr = object["Name"] 89 | 90 | if "RSSI" in object: 91 | print(object["RSSI"]) 92 | self._RSSI = int(object["RSSI"]) 93 | 94 | mac_addr = mac_addr[:34] 95 | 96 | name_label.Init(mac_addr,self._FontObj) 97 | 98 | self._Labels["mac_addr"] = name_label 99 | 100 | done_icon = NetItemIcon() 101 | done_icon._ImgSurf = MyIconPool._Icons["done"] 102 | done_icon._CanvasHWND = self._Parent._CanvasHWND 103 | done_icon._Parent = self 104 | 105 | self._Icons["done"] = done_icon 106 | ## reuse the resource from TitleBar 107 | #pp(theString) 108 | 109 | 110 | def Connect(self,notworkentry=None): 111 | """ Execute connection. """ 112 | #dev = dbus.Interface(bus.get_object("org.bluez", "/org/bluez/hci0/dev_"+"34_88_5D_97_FF_26"), "org.bluez.Device1") 113 | proxy_obj = self._Parent._Dbus.get_object("org.bluez",self._Path) 114 | dev = self._Parent._Dbus.Interface(proxy_obj, "org.bluez.Device1") 115 | dev.Connect() 116 | 117 | def Draw(self): 118 | #pygame.draw.line(self._Parent._CanvasHWND,(169,169,169),(self._PosX,self._PosY),(self._PosX+self._Width,self._PosY),1) 119 | for i in self._Labels: 120 | self._Labels[i]._PosY = self._PosY + (self._Height - self._Labels[i]._Height)/2 121 | self._Labels[i].Draw() 122 | 123 | if self._IsActive: 124 | self._Icons["done"].NewCoord(480-22,self._PosY) 125 | self._Icons["done"].Draw() 126 | 127 | pygame.draw.line(self._Parent._CanvasHWND,MySkinManager.GiveColor('Line'), 128 | (self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1) 129 | -------------------------------------------------------------------------------- /Menu/GameShell/98_Settings/Brightness/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | ## local UI import 4 | import pages 5 | import myvars 6 | 7 | def Init(main_screen): 8 | pages.InitBrightnessPage(main_screen) 9 | 10 | def API(main_screen): 11 | 12 | if main_screen !=None: 13 | main_screen.PushCurPage() 14 | main_screen.SetCurPage(myvars.BrightnessPage) 15 | main_screen.Draw() 16 | main_screen.SwapAndShow() 17 | 18 | -------------------------------------------------------------------------------- /Menu/GameShell/98_Settings/Brightness/brightness_page.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | 5 | 6 | #import math 7 | 8 | ## local UI import 9 | from UI.constants import Width,Height,ICON_TYPES 10 | from UI.page import Page,PageSelector 11 | from UI.label import Label 12 | from UI.icon_item import IconItem 13 | from UI.util_funcs import midRect 14 | from UI.keys_def import CurKeys, IsKeyMenuOrB 15 | from UI.slider import Slider 16 | from UI.icon_pool import MyIconPool 17 | from UI.multi_icon_item import MultiIconItem 18 | from config import BackLight 19 | import myvars 20 | 21 | class BSlider(Slider): 22 | 23 | 24 | OnChangeCB = None 25 | _BGpng = None 26 | _BGwidth = 179 27 | _BGheight = 153 28 | 29 | _NeedleSurf = None 30 | _Scale = None 31 | _Parent = None 32 | _Icons = {} 33 | 34 | def __init__(self): 35 | Slider.__init__(self) 36 | self._Icons = {} 37 | def Init(self): 38 | self._Width = self._Parent._Width 39 | self._Height = self._Parent._Height 40 | 41 | bgpng = IconItem() 42 | bgpng._ImgSurf = MyIconPool._Icons["light"] 43 | bgpng._MyType = ICON_TYPES["STAT"] 44 | bgpng._Parent = self 45 | bgpng.Adjust(0,0,self._BGwidth,self._BGheight,0) 46 | self._Icons["bg"] = bgpng 47 | ##self._NeedleSurf = pygame.Surface( (38,12),pygame.SRCALPHA ) 48 | 49 | scale = MultiIconItem() 50 | scale._MyType = ICON_TYPES["STAT"] 51 | scale._Parent = self 52 | scale._ImgSurf = MyIconPool._Icons["scale"] 53 | scale._IconWidth = 82 54 | scale._IconHeight = 63 55 | scale.Adjust(0,0,82,63,0) 56 | self._Icons["scale"] = scale 57 | 58 | def SetValue(self,brt): 59 | self._Value = brt 60 | 61 | def Further(self): 62 | self._Value+=1 63 | if self._Value > 9: 64 | self._Value = 9 65 | 66 | if self.OnChangeCB != None: 67 | if callable(self.OnChangeCB): 68 | self.OnChangeCB(self._Value) 69 | 70 | def StepBack(self): 71 | self._Value-=1 72 | 73 | if self._Value < 1: 74 | self._Value = 1 75 | 76 | if self.OnChangeCB != None: 77 | if callable(self.OnChangeCB): 78 | self.OnChangeCB(self._Value) 79 | 80 | def Draw(self): 81 | 82 | self._Icons["bg"].NewCoord(self._Width/2,self._Height/2 +11 ) 83 | self._Icons["bg"].Draw() 84 | 85 | self._Icons["scale"].NewCoord(self._Width/2,self._Height/2 ) 86 | 87 | icon_idx = self._Value - 1 88 | if icon_idx < 0: 89 | icon_idx = 0 90 | 91 | self._Icons["scale"]._IconIndex = icon_idx 92 | self._Icons["scale"].Draw() 93 | """ 94 | pygame.draw.line(self._CanvasHWND,(255,0,0), (posx,self._PosY),(self._Width,self._PosY),3) ## range line 95 | pygame.draw.line(self._CanvasHWND,(0,0,255), (self._PosX,self._PosY),(posx,self._PosY),3) ## range line 96 | 97 | pygame.draw.circle(self._CanvasHWND,(255,255,255),( posx, self._PosY),7,0) 98 | pygame.draw.circle(self._CanvasHWND,(0,0,0) ,( posx, self._PosY),7,1)## outer border 99 | """ 100 | 101 | 102 | 103 | class BrightnessPage(Page): 104 | 105 | _MySlider = None 106 | _FootMsg = ["Nav","","","Back","Enter"] 107 | 108 | 109 | def Init(self): 110 | self._CanvasHWND = self._Screen._CanvasHWND 111 | self._Width = self._Screen._Width 112 | self._Height = self._Screen._Height 113 | 114 | self._MySlider = BSlider() 115 | # self._MySlider._Width = Width - 20 116 | # self._MySlider._Height = 30 117 | # self._MySlider._PosX = (self._Width - self._MySlider._Width)/2 118 | # self._MySlider._PosY = 40 119 | self._MySlider._Parent = self 120 | self._MySlider.SetCanvasHWND(self._CanvasHWND) 121 | self._MySlider.OnChangeCB = self.WhenSliderDrag 122 | self._MySlider.Init() 123 | 124 | brt = self.ReadBackLight() 125 | 126 | self._MySlider.SetValue( brt) 127 | 128 | 129 | def ReadBackLight(self): 130 | try: 131 | f = open(BackLight) 132 | except IOError: 133 | return 0 134 | else: 135 | with f: 136 | content = f.readlines() 137 | content = [x.strip() for x in content] 138 | return int(content[0]) 139 | 140 | return 0 141 | 142 | def OnLoadCb(self): 143 | brt = self.ReadBackLight() 144 | 145 | self._MySlider.SetValue( brt) 146 | 147 | def SetBackLight(self,newbrt): 148 | try: 149 | f = open(BackLight,'w') 150 | except IOError: 151 | print("Open write %s failed %d" % (BackLight,newbrt)) 152 | return False 153 | else: 154 | with f: 155 | f.write(str(newbrt)) 156 | return True 157 | 158 | def WhenSliderDrag(self,value): ##value 159 | self.SetBackLight(value) 160 | 161 | def KeyDown(self,event): 162 | 163 | if IsKeyMenuOrB(event.key): 164 | self.ReturnToUpLevelPage() 165 | self._Screen.Draw() 166 | self._Screen.SwapAndShow() 167 | 168 | if event.key == CurKeys["Right"]: 169 | self._MySlider.Further() 170 | self._Screen.Draw() 171 | self._Screen.SwapAndShow() 172 | 173 | if event.key == CurKeys["Left"]: 174 | self._MySlider.StepBack() 175 | self._Screen.Draw() 176 | self._Screen.SwapAndShow() 177 | 178 | def Draw(self): 179 | self.ClearCanvas() 180 | 181 | self._MySlider.Draw() 182 | 183 | 184 | 185 | 186 | 187 | -------------------------------------------------------------------------------- /Menu/GameShell/98_Settings/Brightness/myvars.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import os 4 | import sys 5 | 6 | SoundPage = None 7 | -------------------------------------------------------------------------------- /Menu/GameShell/98_Settings/Brightness/pages.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from brightness_page import BrightnessPage 4 | 5 | import myvars 6 | 7 | def InitBrightnessPage(main_screen): 8 | 9 | myvars.BrightnessPage = BrightnessPage() 10 | 11 | myvars.BrightnessPage._Screen = main_screen 12 | myvars.BrightnessPage._Name = "Brightness" 13 | myvars.BrightnessPage.Init() 14 | -------------------------------------------------------------------------------- /Menu/GameShell/98_Settings/PowerOFF/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | 5 | #UI lib 6 | from UI.constants import RUNSYS 7 | from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB 8 | from UI.confirm_page import ConfirmPage 9 | from UI.lang_manager import MyLangManager 10 | import config 11 | from battery import BatteryAbstraction 12 | 13 | class PowerOffConfirmPage(ConfirmPage): 14 | 15 | _ConfirmText = MyLangManager.Tr("Confirm Power OFF?") 16 | 17 | def CheckBattery(self): 18 | return BatteryAbstraction.AsPercentage() 19 | 20 | def KeyDown(self,event): 21 | 22 | if IsKeyMenuOrB(event.key): 23 | 24 | self.ReturnToUpLevelPage() 25 | self._Screen.Draw() 26 | self._Screen.SwapAndShow() 27 | 28 | if IsKeyStartOrA(event.key): 29 | if self.CheckBattery() < 20: 30 | cmdpath = "feh --bg-center gameshell/wallpaper/gameover.png;" 31 | else: 32 | cmdpath = "feh --bg-center gameshell/wallpaper/seeyou.png;" 33 | 34 | cmdpath += "sleep 3;" 35 | 36 | #cmdpath += "echo 'halt -p' > /tmp/halt_cmd" 37 | 38 | cmdpath += "shutdown -h -t 0" 39 | pygame.event.post( pygame.event.Event(RUNSYS, message=cmdpath)) 40 | 41 | 42 | 43 | class APIOBJ(object): 44 | 45 | _StoragePage = None 46 | def __init__(self): 47 | pass 48 | def Init(self,main_screen): 49 | self._Page = PowerOffConfirmPage() 50 | 51 | self._Page._Screen = main_screen 52 | self._Page._Name ="Power OFF" 53 | self._Page.Init() 54 | 55 | 56 | def API(self,main_screen): 57 | if main_screen !=None: 58 | main_screen.PushPage(self._Page) 59 | main_screen.Draw() 60 | main_screen.SwapAndShow() 61 | 62 | OBJ = APIOBJ() 63 | def Init(main_screen): 64 | OBJ.Init(main_screen) 65 | def API(main_screen): 66 | OBJ.API(main_screen) 67 | 68 | -------------------------------------------------------------------------------- /Menu/GameShell/98_Settings/Sound/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | ## local UI import 4 | import pages 5 | import myvars 6 | 7 | def Init(main_screen): 8 | pages.InitSoundPage(main_screen) 9 | 10 | def API(main_screen): 11 | 12 | if main_screen !=None: 13 | main_screen.PushCurPage() 14 | main_screen.SetCurPage(myvars.SoundPage) 15 | main_screen.Draw() 16 | main_screen.SwapAndShow() 17 | 18 | -------------------------------------------------------------------------------- /Menu/GameShell/98_Settings/Sound/myvars.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import os 4 | import sys 5 | 6 | SoundPage = None 7 | -------------------------------------------------------------------------------- /Menu/GameShell/98_Settings/Sound/pages.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from sound_page import SoundPage 4 | 5 | import myvars 6 | 7 | def InitSoundPage(main_screen): 8 | 9 | myvars.SoundPage = SoundPage() 10 | 11 | myvars.SoundPage._Screen = main_screen 12 | myvars.SoundPage._Name = "Sound volume" 13 | myvars.SoundPage.Init() 14 | -------------------------------------------------------------------------------- /Menu/GameShell/98_Settings/Sound/sound_page.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | 5 | #from libs.roundrects import aa_round_rect 6 | 7 | import alsaaudio 8 | 9 | ## local UI import 10 | from UI.constants import Width,Height,ICON_TYPES 11 | from UI.page import Page,PageSelector 12 | from UI.icon_item import IconItem 13 | from UI.label import Label 14 | from UI.util_funcs import midRect 15 | from UI.keys_def import CurKeys, IsKeyMenuOrB 16 | from UI.slider import Slider 17 | from UI.multi_icon_item import MultiIconItem 18 | from config import AudioControl 19 | 20 | 21 | from UI.icon_pool import MyIconPool 22 | 23 | import myvars 24 | 25 | class SoundSlider(Slider): 26 | OnChangeCB = None 27 | 28 | _BGpng = None 29 | _BGwidth = 192 30 | _BGheight = 173 31 | 32 | _NeedleSurf = None 33 | _Scale = None 34 | _Parent = None 35 | 36 | snd_segs = [ [0,20],[21,40],[41,50],[51,60],[61,70],[71,85],[86,90],[91,95],[96,100] ] 37 | 38 | 39 | def __init__(self): 40 | Slider.__init__(self) 41 | 42 | def Init(self): 43 | self._Width = self._Parent._Width 44 | self._Height = self._Parent._Height 45 | 46 | self._BGpng = IconItem() 47 | self._BGpng._ImgSurf = MyIconPool._Icons["vol"] 48 | self._BGpng._MyType = ICON_TYPES["STAT"] 49 | self._BGpng._Parent = self 50 | self._BGpng.Adjust(0,0,self._BGwidth,self._BGheight,0) 51 | 52 | ##self._NeedleSurf = pygame.Surface( (38,12),pygame.SRCALPHA ) 53 | 54 | self._Scale = MultiIconItem() 55 | self._Scale._MyType = ICON_TYPES["STAT"] 56 | self._Scale._Parent = self 57 | self._Scale._ImgSurf = MyIconPool._Icons["scale"] 58 | self._Scale._IconWidth = 82 59 | self._Scale._IconHeight = 63 60 | self._Scale.Adjust(0,0,82,63,0) 61 | 62 | def SetValue(self,vol):#pct 0-100 63 | for i,v in enumerate(self.snd_segs): 64 | if vol >= v[0] and vol <= v[1]: 65 | self._Value = i # self._Value : 0 - 8 66 | break 67 | 68 | def Further(self): 69 | self._Value+=1 70 | 71 | if self._Value > len(self.snd_segs)-1: 72 | self._Value = len(self.snd_segs) -1 73 | 74 | vol = self.snd_segs[self._Value][0] + (self.snd_segs[self._Value][1] - self.snd_segs[self._Value][0])/2 75 | 76 | if self.OnChangeCB != None: 77 | if callable(self.OnChangeCB): 78 | self.OnChangeCB( vol ) 79 | 80 | def StepBack(self): 81 | self._Value-=1 82 | 83 | if self._Value < 0: 84 | self._Value = 0 85 | 86 | vol = self.snd_segs[self._Value][0] + (self.snd_segs[self._Value][1] - self.snd_segs[self._Value][0])/2 87 | 88 | if self.OnChangeCB != None: 89 | if callable(self.OnChangeCB): 90 | self.OnChangeCB( vol ) 91 | 92 | def Draw(self): 93 | 94 | self._BGpng.NewCoord(self._Width/2,self._Height/2 ) 95 | self._BGpng.Draw() 96 | 97 | self._Scale.NewCoord(self._Width/2,self._Height/2) 98 | 99 | self._Scale._IconIndex = self._Value 100 | 101 | self._Scale.Draw() 102 | 103 | 104 | 105 | class SoundPage(Page): 106 | 107 | _MySlider = None 108 | _FootMsg = ["Nav","","","Back","Enter"] 109 | 110 | def Init(self): 111 | self._CanvasHWND = self._Screen._CanvasHWND 112 | self._Width = self._Screen._Width 113 | self._Height = self._Screen._Height 114 | 115 | self._MySlider = SoundSlider() 116 | 117 | self._MySlider._Parent = self 118 | self._MySlider.SetCanvasHWND(self._CanvasHWND) 119 | 120 | self._MySlider.OnChangeCB = self.WhenSliderDrag 121 | 122 | self._MySlider.Init() 123 | 124 | try: 125 | m = alsaaudio.Mixer(AudioControl) 126 | self._MySlider.SetValue(m.getvolume()[0]) 127 | except Exception,e: 128 | print(str(e)) 129 | self._MySlider.SetValue(0) 130 | 131 | 132 | def OnLoadCb(self): 133 | try: 134 | m = alsaaudio.Mixer(AudioControl) 135 | self._MySlider.SetValue(m.getvolume()[0]) 136 | except Exception,e: 137 | print(str(e)) 138 | 139 | def WhenSliderDrag(self,value): ##value 0-100 140 | if value < 0 or value > 100: 141 | return 142 | 143 | m = alsaaudio.Mixer(AudioControl) 144 | m.setvolume(int(value)) 145 | 146 | def KeyDown(self,event): 147 | 148 | if IsKeyMenuOrB(event.key): 149 | self.ReturnToUpLevelPage() 150 | self._Screen.Draw() 151 | self._Screen.SwapAndShow() 152 | 153 | if event.key == CurKeys["Right"]: 154 | self._MySlider.Further() 155 | self._Screen.Draw() 156 | self._Screen.SwapAndShow() 157 | 158 | if event.key == CurKeys["Left"]: 159 | self._MySlider.StepBack() 160 | self._Screen.Draw() 161 | self._Screen.SwapAndShow() 162 | 163 | def Draw(self): 164 | self.ClearCanvas() 165 | 166 | self._MySlider.Draw() 167 | 168 | 169 | 170 | 171 | 172 | -------------------------------------------------------------------------------- /Menu/GameShell/98_Settings/Storage/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | import os 5 | 6 | 7 | ## local UI import 8 | from UI.page import Page 9 | from UI.skin_manager import MySkinManager 10 | from UI.constants import ICON_TYPES,Width,Height 11 | from UI.icon_item import IconItem 12 | from UI.icon_pool import MyIconPool 13 | from UI.label import Label 14 | from UI.util_funcs import midRect 15 | 16 | from libs.roundrects import aa_round_rect 17 | 18 | class StoragePage(Page): 19 | 20 | _Icons = {} 21 | _BGpng = None 22 | _BGwidth = 96 23 | _BGheight = 73 24 | _BGlabel = None 25 | _FreeLabel = None 26 | 27 | _BGmsg = "%.1fGB of %.1fGB Used" 28 | _DskUsg = None 29 | 30 | _HighColor = MySkinManager.GiveColor('High') 31 | _FootMsg = ["Nav.","","","Back",""] 32 | 33 | def __init__(self): 34 | Page.__init__(self) 35 | 36 | self._Icons = {} 37 | 38 | 39 | def DiskUsage(self): 40 | statvfs = os.statvfs('/') 41 | 42 | total_space = (statvfs.f_frsize * statvfs.f_blocks)/1024.0/1024.0/1024.0 43 | 44 | avail_space = ( statvfs.f_frsize * statvfs.f_bavail) / 1024.0 / 1024.0/ 1024.0 45 | 46 | return avail_space,total_space 47 | 48 | def Init(self): 49 | 50 | self._DskUsg = self.DiskUsage() 51 | 52 | self._CanvasHWND = self._Screen._CanvasHWND 53 | self._Width = self._Screen._Width 54 | self._Height = self._Screen._Height 55 | 56 | self._BGpng = IconItem() 57 | self._BGpng._ImgSurf = MyIconPool._Icons["icon_sd"] 58 | self._BGpng._MyType = ICON_TYPES["STAT"] 59 | self._BGpng._Parent = self 60 | 61 | self._BGpng.AddLabel(self._BGmsg % (self._DskUsg[1]-self._DskUsg[0], self._DskUsg[1]), MySkinManager.GiveFont("varela15")) 62 | self._BGpng.Adjust(0,0,self._BGwidth,self._BGheight,0) 63 | 64 | 65 | self._BGlabel = Label() 66 | self._BGlabel.SetCanvasHWND(self._CanvasHWND) 67 | 68 | usage_percent = (self._DskUsg[0]/self._DskUsg[1] )*100.0 69 | 70 | self._BGlabel.Init("%d%%"% int(usage_percent),MySkinManager.GiveFont("varela25")) 71 | self._BGlabel.SetColor( self._HighColor ) 72 | 73 | self._FreeLabel = Label() 74 | self._FreeLabel.SetCanvasHWND(self._CanvasHWND) 75 | self._FreeLabel.Init("Free",MySkinManager.GiveFont("varela13")) 76 | self._FreeLabel.SetColor(self._BGlabel._Color) 77 | 78 | 79 | def OnLoadCb(self): 80 | pass 81 | 82 | def Draw(self): 83 | self.ClearCanvas() 84 | 85 | self._BGpng.NewCoord(self._Width/2,self._Height/2-10) 86 | self._BGpng.Draw() 87 | self._BGlabel.NewCoord(self._Width/2-28,self._Height/2-30) 88 | self._BGlabel.Draw() 89 | 90 | self._FreeLabel.NewCoord(self._BGlabel._PosX+10 ,self._Height/2) 91 | self._FreeLabel.Draw() 92 | 93 | #bgcolor = (238,238,238), fgcolor = (126,206,244) 94 | #aa_round_rect 95 | usage_percent = (self._DskUsg[0]/self._DskUsg[1] ) 96 | if usage_percent < 0.1: 97 | usage_percent = 0.1 98 | 99 | rect_ = midRect(self._Width/2,self._Height-30,170,17, Width,Height) 100 | 101 | aa_round_rect(self._CanvasHWND, rect_, MySkinManager.GiveColor('Line'), 5, 0, MySkinManager.GiveColor('Line')) 102 | 103 | 104 | rect2 = midRect(self._Width/2,self._Height-30,int(170*(1.0-usage_percent)),17, Width,Height) 105 | 106 | rect2.left = rect_.left 107 | rect2.top = rect_.top 108 | 109 | aa_round_rect(self._CanvasHWND,rect2, MySkinManager.GiveColor('Front'),5,0,MySkinManager.GiveColor('Front')) 110 | 111 | class APIOBJ(object): 112 | 113 | _StoragePage = None 114 | def __init__(self): 115 | pass 116 | def Init(self,main_screen): 117 | self._StoragePage = StoragePage() 118 | 119 | self._StoragePage._Screen = main_screen 120 | self._StoragePage._Name ="Storage" 121 | self._StoragePage.Init() 122 | 123 | 124 | def API(self,main_screen): 125 | if main_screen !=None: 126 | main_screen.PushPage(self._StoragePage) 127 | main_screen.Draw() 128 | main_screen.SwapAndShow() 129 | 130 | 131 | 132 | OBJ = APIOBJ() 133 | def Init(main_screen): 134 | OBJ.Init(main_screen) 135 | def API(main_screen): 136 | OBJ.API(main_screen) 137 | 138 | 139 | -------------------------------------------------------------------------------- /Menu/GameShell/98_Settings/Time/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | 5 | ## local UI import 6 | import pages 7 | import myvars 8 | 9 | def Init(main_screen): 10 | pages.InitTimezoneListPage(main_screen) 11 | 12 | def API(main_screen): 13 | if main_screen !=None: 14 | main_screen.PushCurPage() 15 | main_screen.SetCurPage(myvars.TimezoneListPage) 16 | main_screen.Draw() 17 | main_screen.SwapAndShow() 18 | 19 | 20 | -------------------------------------------------------------------------------- /Menu/GameShell/98_Settings/Time/list_item.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | from libs.roundrects import aa_round_rect 5 | 6 | ## local UI import 7 | from UI.constants import ICON_TYPES 8 | from UI.page import Page 9 | from UI.label import Label 10 | from UI.icon_item import IconItem 11 | from UI.util_funcs import midRect 12 | from UI.skin_manager import MySkinManager 13 | 14 | # a item for List 15 | # - - - - - - - - - - - -- 16 | # | Icon Text..... > | 17 | # ------------------------ 18 | 19 | import myvars # icons_path 20 | 21 | class ListItemIcon(IconItem): 22 | 23 | _CanvasHWND = None 24 | _Parent = None 25 | _Width = 18 26 | _Height = 18 27 | 28 | def Draw(self): 29 | self._CanvasHWND.blit(self._ImgSurf,(self._PosX,self._PosY+(self._Parent._Height-self._Height)/2,self._Width,self._Height)) 30 | 31 | 32 | class ListItemLabel(Label): 33 | 34 | _ActiveColor = MySkinManager.GiveColor('Active') 35 | _Active = False 36 | def Draw(self): 37 | 38 | self._FontObj.set_bold(self._Active) 39 | 40 | my_text = self._FontObj.render( self._Text,True,self._Color) 41 | self._CanvasHWND.blit(my_text,(self._PosX,self._PosY,self._Width,self._Height)) 42 | 43 | 44 | class ListItem(object): 45 | _PosX = 0 46 | _PosY = 0 47 | _Width = 0 48 | _Height = 30 49 | 50 | _Labels = {} 51 | _Icons = {} 52 | _Fonts = {} 53 | _MyType = ICON_TYPES["EXE"] 54 | _LinkObj = None 55 | _Path = "" 56 | _Active = False 57 | _Parent = None 58 | 59 | _Text = "" 60 | def __init__(self): 61 | self._Labels = {} 62 | self._Icons = {} 63 | self._Fonts = {} 64 | 65 | 66 | def Init(self,text): 67 | 68 | self._Text = text 69 | 70 | l = ListItemLabel() 71 | l._PosX = 22 72 | l.SetCanvasHWND(self._Parent._CanvasHWND) 73 | 74 | if self._MyType == ICON_TYPES["DIR"]: 75 | l.Init(text,self._Fonts["normal"]) 76 | self._Path = text 77 | else: 78 | l.Init(text,self._Fonts["normal"]) 79 | self._Path = text 80 | 81 | 82 | self._Labels["Text"] = l 83 | 84 | 85 | def NewCoord(self,x,y): 86 | self._PosX = x 87 | self._PosY = y 88 | 89 | def Draw(self): 90 | 91 | if self._MyType == ICON_TYPES["DIR"] and self._Path != "[..]": 92 | self._Parent._Icons["sys"]._IconIndex = 0 93 | self._Parent._Icons["sys"].NewCoord(self._PosX+12,self._PosY+ (self._Height - self._Parent._Icons["sys"]._Height)/2+self._Parent._Icons["sys"]._Height/2) 94 | self._Parent._Icons["sys"].Draw() 95 | 96 | if self._MyType == ICON_TYPES["FILE"]: 97 | self._Parent._Icons["sys"]._IconIndex = 1 98 | self._Parent._Icons["sys"].NewCoord(self._PosX+12,self._PosY+ (self._Height - self._Parent._Icons["sys"]._Height)/2+self._Parent._Icons["sys"]._Height/2) 99 | self._Parent._Icons["sys"].Draw() 100 | 101 | if self._Active == True: 102 | self._Labels["Text"]._Active = True 103 | else: 104 | self._Labels["Text"]._Active = False 105 | 106 | 107 | self._Labels["Text"]._PosY = self._PosY + (self._Height - self._Labels["Text"]._Height)/2 108 | 109 | pygame.draw.line(self._Parent._CanvasHWND,MySkinManager.GiveColor('Line'),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1) 110 | 111 | self._Labels["Text"].Draw() 112 | 113 | -------------------------------------------------------------------------------- /Menu/GameShell/98_Settings/Time/logger.py: -------------------------------------------------------------------------------- 1 | import logzero 2 | 3 | def get_logger(): 4 | # Set a custom formatter 5 | log_format = '%(color)s[%(levelname)1.1s ' \ 6 | '%(asctime)s.%(msecs)03d %(module)s:%(lineno)d]' \ 7 | '%(end_color)s %(message)s' 8 | formatter = logzero.LogFormatter(fmt=log_format) 9 | logzero.setup_default_logger(formatter=formatter) 10 | 11 | logzero.logfile( 12 | 'logzero.log', 13 | maxBytes=1e6, 14 | backupCount=3 15 | ) 16 | return logzero.logger -------------------------------------------------------------------------------- /Menu/GameShell/98_Settings/Time/myvars.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | TimePage = None 4 | TimezoneListPage = None 5 | 6 | -------------------------------------------------------------------------------- /Menu/GameShell/98_Settings/Time/pages.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from timezone_lib_list_page import TimezoneListPage 4 | import myvars 5 | 6 | def InitTimePage(main_screen): 7 | myvars.TimePage = None 8 | 9 | def InitTimezoneListPage(main_screen): 10 | myvars.TimezoneListPage = TimezoneListPage() 11 | myvars.TimezoneListPage._Screen = main_screen 12 | myvars.TimezoneListPage._Name = "Timezone Selection" 13 | myvars.TimezoneListPage.Init() 14 | -------------------------------------------------------------------------------- /Menu/GameShell/98_Settings/Wifi/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | ## local UI import 4 | import pages 5 | import myvars 6 | """ 7 | try: 8 | from icons import preload 9 | except: 10 | print("No icons package") 11 | """ 12 | 13 | def Init(main_screen): 14 | pages.InitPasswordPage(main_screen) 15 | pages.InitScanPage(main_screen) 16 | myvars.PasswordPage._Caller = myvars.ScanPage 17 | 18 | def API(main_screen): 19 | 20 | if main_screen != None: 21 | main_screen.PushCurPage() 22 | main_screen.SetCurPage(myvars.ScanPage) 23 | main_screen.Draw() 24 | main_screen.SwapAndShow() 25 | 26 | 27 | -------------------------------------------------------------------------------- /Menu/GameShell/98_Settings/Wifi/myvars.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | 4 | ScanPage = None 5 | PasswordPage = None 6 | -------------------------------------------------------------------------------- /Menu/GameShell/98_Settings/Wifi/pages.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | 4 | #import dbus 5 | #import dbus.service 6 | #from wicd import misc 7 | ##misc.to_bool 8 | ##misc.misc.noneToString 9 | ##misc.to_unicode 10 | ##misc.Noneify 11 | #from wicd.translations import _ 12 | #from wicd import wpath 13 | #from wicd import dbusmanager 14 | 15 | 16 | ## local UI import 17 | from libs.DBUS import bus,daemon,wireless,wired 18 | 19 | from UI.keyboard import Keyboard 20 | from wifi_list import WifiList 21 | 22 | import myvars 23 | 24 | 25 | def InitScanPage(main_screen): 26 | global wireless 27 | global daemon 28 | global bus 29 | 30 | myvars.ScanPage = WifiList() 31 | myvars.ScanPage._Name = "Scan wifi" 32 | 33 | myvars.ScanPage._Wireless = wireless 34 | myvars.ScanPage._Daemon = daemon 35 | myvars.ScanPage._Dbus = bus 36 | 37 | 38 | myvars.ScanPage._Screen = main_screen 39 | myvars.ScanPage.Init() 40 | 41 | 42 | if daemon != None: 43 | #Bind signals 44 | myvars.ScanPage._Dbus.add_signal_receiver(myvars.ScanPage.DbusScanFinishedSig, 'SendEndScanSignal', 45 | 'org.wicd.daemon.wireless') 46 | myvars.ScanPage._Dbus.add_signal_receiver(myvars.ScanPage.DbusScanStarted, 'SendStartScanSignal', 47 | 'org.wicd.daemon.wireless') 48 | # 49 | myvars.ScanPage._Dbus.add_signal_receiver(myvars.ScanPage.DbusDaemonStatusChangedSig, 'StatusChanged', 50 | 'org.wicd.daemon') 51 | myvars.ScanPage._Dbus.add_signal_receiver(myvars.ScanPage.DbusConnectResultsSent, 'ConnectResultsSent', 52 | 'org.wicd.daemon') 53 | 54 | def InitPasswordPage(main_screen): 55 | 56 | myvars.PasswordPage = Keyboard() 57 | myvars.PasswordPage._Name = "Enter wifi password" 58 | 59 | myvars.PasswordPage._Screen = main_screen 60 | myvars.PasswordPage.Init() 61 | 62 | -------------------------------------------------------------------------------- /Menu/GameShell/98_Settings/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | from pygame.locals import * 5 | from sys import exit 6 | import os 7 | import sys 8 | 9 | from datetime import datetime 10 | 11 | import base64 12 | from beeprint import pp 13 | 14 | 15 | ## local UI import 16 | import pages 17 | import myvars 18 | 19 | def Init(main_screen): 20 | pages.InitListPage(main_screen) 21 | 22 | def API(main_screen): 23 | 24 | if main_screen !=None: 25 | main_screen.PushCurPage() 26 | main_screen.SetCurPage(myvars.ListPage) 27 | main_screen.Draw() 28 | main_screen.SwapAndShow() 29 | 30 | -------------------------------------------------------------------------------- /Menu/GameShell/98_Settings/list_item.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | 5 | 6 | 7 | ## local UI import 8 | from UI.page import Page 9 | from UI.label import Label 10 | from UI.lang_manager import MyLangManager 11 | # a item for List 12 | # - - - - - - - - - - - -- 13 | # | Icon Text..... > | 14 | # ------------------------ 15 | 16 | import myvars # icons_path 17 | 18 | 19 | class ListItem(object): 20 | _PosX = 0 21 | _PosY = 0 22 | _Width = 0 23 | _Height = 30 24 | 25 | _Labels = {} 26 | _Icons = {} 27 | _Fonts = {} 28 | 29 | _LinkObj = None 30 | 31 | def __init__(self): 32 | self._Labels = {} 33 | self._Icons = {} 34 | self._Fonts = {} 35 | 36 | def Init(self,text): 37 | 38 | #self._Fonts["normal"] = fonts["veramono12"] 39 | 40 | l = Label() 41 | l._PosX = 16 42 | l.SetCanvasHWND(self._Parent._CanvasHWND) 43 | text = MyLangManager.Tr(text) 44 | l.Init(text,self._Fonts["normal"]) 45 | self._Labels["Text"] = l 46 | 47 | 48 | def Draw(self): 49 | 50 | self._Labels["Text"]._PosY = self._PosY + (self._Height - self._Labels["Text"]._Height)/2 51 | self._Labels["Text"].Draw() 52 | 53 | pygame.draw.line(self._Parent._CanvasHWND,(169,169,169),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1) 54 | 55 | 56 | -------------------------------------------------------------------------------- /Menu/GameShell/98_Settings/myvars.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from sys import exit 4 | import os 5 | import sys 6 | 7 | 8 | basepath = os.path.dirname(os.path.realpath(__file__)) 9 | 10 | icons_path = basepath+"/icons" 11 | 12 | ListPage = None 13 | -------------------------------------------------------------------------------- /Menu/GameShell/98_Settings/pages.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from list_page import ListPage 4 | 5 | import myvars 6 | 7 | def InitListPage(main_screen): 8 | 9 | myvars.ListPage = ListPage() 10 | 11 | myvars.ListPage._Screen = main_screen 12 | myvars.ListPage._Name = "Setting List" 13 | myvars.ListPage.Init() 14 | -------------------------------------------------------------------------------- /Menu/GameShell/99_PowerOFF/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | 5 | #UI lib 6 | from UI.constants import RUNSYS 7 | from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB 8 | from UI.confirm_page import ConfirmPage 9 | from UI.lang_manager import MyLangManager 10 | 11 | import config 12 | from battery import BatteryAbstraction 13 | 14 | class PowerOffConfirmPage(ConfirmPage): 15 | 16 | _ConfirmText = MyLangManager.Tr("Awaiting Input") 17 | _FootMsg = ["Nav","","Reboot","Cancel","Shutdown"] 18 | 19 | def CheckBattery(self): 20 | return BatteryAbstraction.AsPercentage() 21 | 22 | def KeyDown(self,event): 23 | 24 | if IsKeyMenuOrB(event.key): 25 | self.ReturnToUpLevelPage() 26 | self._Screen.Draw() 27 | self._Screen.SwapAndShow() 28 | 29 | if IsKeyStartOrA(event.key): 30 | if self.CheckBattery() < 20: 31 | cmdpath = "feh --bg-center gameshell/wallpaper/gameover.png;" 32 | else: 33 | cmdpath = "feh --bg-center gameshell/wallpaper/seeyou.png;" 34 | 35 | cmdpath += "sleep 3;" 36 | 37 | #cmdpath += "echo 'halt -p' > /tmp/halt_cmd" 38 | 39 | cmdpath += "sudo shutdown -h -t 0" 40 | pygame.event.post( pygame.event.Event(RUNSYS, message=cmdpath)) 41 | 42 | if event.key == CurKeys["X"]: 43 | cmdpath = "feh --bg-center gameshell/wallpaper/seeyou.png;" 44 | cmdpath += "sleep 3;" 45 | cmdpath += "sudo reboot" 46 | pygame.event.post( pygame.event.Event(RUNSYS, message=cmdpath)) 47 | 48 | 49 | class APIOBJ(object): 50 | 51 | _StoragePage = None 52 | def __init__(self): 53 | pass 54 | def Init(self,main_screen): 55 | self._Page = PowerOffConfirmPage() 56 | 57 | self._Page._Screen = main_screen 58 | self._Page._Name ="Power OFF" 59 | self._Page.Init() 60 | 61 | 62 | def API(self,main_screen): 63 | if main_screen !=None: 64 | main_screen.PushPage(self._Page) 65 | main_screen.Draw() 66 | main_screen.SwapAndShow() 67 | 68 | OBJ = APIOBJ() 69 | def Init(main_screen): 70 | OBJ.Init(main_screen) 71 | def API(main_screen): 72 | OBJ.API(main_screen) 73 | 74 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GameShell launcher for PocketCHIP 2 | 3 | This is the Launcher from the Gameshell, ported over to the PocketCHIP. 4 | 5 | ![](https://media.discordapp.net/attachments/422472890441793539/585821529913425923/2019-06-05-132318_480x272_scrot.png) 6 | 7 | ### Note 8 | 9 | This is has been tested on my own PocketCHIP to ensure repeatability a couple of times, but you might encounter your own probems if you don't have a working `apt` for example. 10 | 11 | ## Installation 12 | 13 | ``` 14 | cd ~ 15 | git clone https://github.com/omgmog/launcher.git 16 | cd launcher 17 | chmod +x install.sh 18 | bash ./install.sh 19 | ``` 20 | 21 | ## Uninstallation 22 | 23 | Uninstallation is quite lazy, it just restores the awesomewm config, and re-installs `pocket-home`. 24 | 25 | ``` 26 | bash ./install.sh -u 27 | ``` 28 | 29 | ## Button configuration 30 | 31 | The button layout is as follows: 32 | 33 | - A/OK - `8` 34 | - B/Back - `0` 35 | - X - `7` 36 | - Y - `9` 37 | - D-pad - d-pad 38 | 39 | - Volume control: `Ctrl` + `-` or `+`, Then `0` (back) to close/confirm 40 | 41 | This should be the most consistent with what you're used to on PocketCHIP, while also providing the additional buttons that the launcher uses. 42 | 43 | You can also use `enter` to select things, and `escape` to go back. 44 | 45 | The usual `ctrl`+`tab` and `ctrl`+`q` shortcuts from `pocket-home` will work everywhere too. 46 | 47 | ## Adding new shortcuts 48 | 49 | To add a new shortcut, create a `.sh` file in the `~/launcher/Menu/GameShell` directory (you can copy one of the others) or `~/apps/Menu` directory. 50 | 51 | The filename indicates the order, and must start with a number and underscore: 52 | 53 | ``` 54 | NN_Name Of Shortcut.sh 55 | ``` 56 | 57 | To set an icon for the shortcut, you need to add an 80x80 png in `~/launcher/skin/pocket/Menu/GameShell` with a filename that matches the app shortcut, but without the number and underscore prefix: 58 | 59 | ``` 60 | Name Of Shortcut.png 61 | ``` 62 | 63 | If you don't have an icon, the launcher will use the first letters of the shortcut and the blank icon found at `~/launcher/skin/pocket/sys.py/gameshell/blank.png` 64 | 65 | If you have problems with applications not using the whole screen, or failing to start, you can try specifying the display at the start of your command, e.g.: 66 | 67 | ``` 68 | DISPLAY=:0 leafpad 69 | ``` 70 | 71 | Other than that, you can follow the instructions from the Gameshell wiki for launching games in emulators directly, if you have `retroarch` installed on your PocketCHIP: https://github.com/clockworkpi/GameShellDocs/wiki/New-ICONS-that-start-games-in-one-click-from-the-MENU 72 | 73 | Or you can grab any of the game launchers that have bene collected here: https://github.com/omgmog/launcher-community-apps 74 | 75 | ## Known problems and missing features 76 | 77 | I've raised [issues](https://github.com/omgmog/launcher/issues) for everything I'm aware of. If you notice something else, please raise an issue! 78 | 79 | ## Help! 80 | 81 | Having problems with anything? Check these common problems below, or raise an [issue](https://github.com/omgmog/launcher/issues/new) 82 | -------------------------------------------------------------------------------- /awesome/rc.lua: -------------------------------------------------------------------------------- 1 | require("awful") 2 | require("awful.autofocus") 3 | require("awful.rules") 4 | require("beautiful") 5 | require("naughty") 6 | local USE_DBG = false 7 | dbg = function (msg) 8 | if USE_DBG then 9 | naughty.notify({ preset = naughty.config.presets.critical, 10 | title = "DBG MSG:", 11 | text = msg }) 12 | end 13 | end 14 | 15 | dbgclient = function (event_name, c) 16 | dbg(event_name.." "..tostring(c.pid).." "..tostring(c.window).." "..(c.class or "_c").." "..(c.name or "_n")) 17 | end 18 | if awesome.startup_errors then 19 | if USE_DBG then 20 | naughty.notify({ preset = naughty.config.presets.critical, 21 | title = "Oops, there were errors during startup!", 22 | text = awesome.startup_errors }) 23 | end 24 | end 25 | do 26 | local in_error = false 27 | awesome.add_signal("debug::error", function (err) 28 | if USE_DBG then 29 | if in_error then return end 30 | in_error = true 31 | 32 | naughty.notify({ preset = naughty.config.presets.critical, 33 | title = "Oops, an error happened!", 34 | text = err }) 35 | in_error = false 36 | end 37 | end) 38 | end 39 | onboard = {} 40 | home_screen = {} 41 | 42 | focus_next_client = function () 43 | if awful.client.next(1) == home_screen.client then 44 | awful.client.focus.byidx( 2 ) 45 | else 46 | awful.client.focus.byidx( 1 ) 47 | end 48 | 49 | if client.focus then 50 | client.focus:raise() 51 | end 52 | end 53 | 54 | focus_client_by_window_id = function (window_id) 55 | for _, c in ipairs(client.get()) do 56 | if c.window == window_id then 57 | client.focus = c 58 | if client.focus then 59 | client.focus:raise() 60 | end 61 | end 62 | end 63 | end 64 | 65 | launch_home_screen = function () 66 | if home_screen.client then 67 | client:kill() 68 | home_screen = {} 69 | end 70 | awful.util.spawn_with_shell("/home/chip/launcher/load.sh") 71 | end 72 | 73 | focus_home_screen = function () 74 | if home_screen.client then 75 | client.focus = home_screen.client 76 | if client.focus then 77 | client.focus:raise() 78 | end 79 | else 80 | launch_home_screen() 81 | end 82 | end 83 | 84 | hide_mouse_cursor = function () 85 | awful.util.spawn_with_shell("xsetroot -cursor $HOME/.config/awesome/blank_ptr.xbm $HOME/.config/awesome/blank_ptr.xbm") 86 | end 87 | 88 | beautiful.init("/home/chip/launcher/awesome/themes/default/theme.lua") 89 | 90 | local terminal = "xterm" 91 | local editor = os.getenv("EDITOR") or "editor" 92 | local editor_cmd = terminal .. " -e " .. editor 93 | local modkey = "Mod1" 94 | 95 | local layouts = 96 | { 97 | awful.layout.suit.max.fullscreen, 98 | } 99 | local tags = {} 100 | for s = 1, screen.count() do 101 | tags[s] = awful.tag({ 1 }, s, layouts[1]) 102 | end 103 | root.buttons(awful.util.table.join( 104 | awful.button({ }, 4, awful.tag.viewnext), 105 | awful.button({ }, 5, awful.tag.viewprev) 106 | )) 107 | local globalkeys = awful.util.table.join( 108 | awful.key({ } , "XF86PowerOff", focus_home_screen), 109 | awful.key({ modkey, }, "Tab", focus_next_client), 110 | awful.key({ "Control", }, "Tab", focus_next_client), 111 | awful.key({ modkey, }, "Return", function () awful.util.spawn("dmenu_run", false) end) 112 | ) 113 | 114 | local clientkeys = awful.util.table.join( 115 | awful.key({ "Control" }, "q", 116 | function (c) 117 | if c ~= home_screen.client then 118 | c:kill() 119 | end 120 | end) 121 | ) 122 | local keynumber = 0 123 | for s = 1, screen.count() do 124 | keynumber = math.min(9, math.max(#tags[s], keynumber)); 125 | end 126 | 127 | local clientbuttons = awful.util.table.join( 128 | awful.button({ }, 1, function (c) client.focus = c; c:raise() end), 129 | awful.button({ modkey }, 1, awful.mouse.client.move), 130 | awful.button({ "Control" }, 1, function (c) awful.util.spawn("xdotool click 3", false) end)) 131 | 132 | root.keys(globalkeys) 133 | 134 | awful.rules.rules = { 135 | { rule = { }, 136 | properties = { border_width = 0, 137 | border_color = beautiful.border_normal, 138 | focus = true, 139 | keys = clientkeys, 140 | buttons = clientbuttons } } 141 | } 142 | 143 | client.add_signal("focus", function (c) 144 | hide_mouse_cursor() 145 | end) 146 | 147 | client.add_signal("unfocus", function (c) 148 | if c == onboard.client then 149 | awful.util.spawn("xdotool search --name ahoy windowactivate", false) 150 | end 151 | end) 152 | 153 | client.add_signal("manage", function (c, startup) 154 | if c.name == "Launcher" then 155 | home_screen.client = c 156 | elseif c.class == "ahoy" then 157 | onboard.client = c 158 | c.ontop = true 159 | end 160 | 161 | if not startup then 162 | if not c.size_hints.user_position and not c.size_hints.program_position then 163 | awful.placement.no_overlap(c) 164 | awful.placement.no_offscreen(c) 165 | end 166 | end 167 | end) 168 | client.add_signal("unmanage", function (c) 169 | if c.name == "Launcher" then 170 | home_screen = {} 171 | elseif c.class == "ahoy" then 172 | onboard = {} 173 | end 174 | end) 175 | 176 | 177 | hide_mouse_cursor() 178 | awful.util.spawn_with_shell("/usr/sbin/pocketchip-load") 179 | awful.util.spawn_with_shell("onboard $HOME/.config/onboard /usr/share/pocketchip-onboard/") 180 | launch_home_screen() 181 | -------------------------------------------------------------------------------- /awesome/themes/default/README: -------------------------------------------------------------------------------- 1 | Background images: 2 | Mikael Eriksson 3 | Licensed under CC-BY-SA-3.0 4 | -------------------------------------------------------------------------------- /awesome/themes/default/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/background.png -------------------------------------------------------------------------------- /awesome/themes/default/background_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/background_white.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/cornerne.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/cornerne.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/cornernew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/cornernew.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/cornernw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/cornernw.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/cornernww.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/cornernww.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/cornerse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/cornerse.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/cornersew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/cornersew.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/cornersw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/cornersw.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/cornersww.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/cornersww.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/dwindle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/dwindle.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/dwindlew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/dwindlew.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/fairh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/fairh.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/fairhw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/fairhw.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/fairv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/fairv.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/fairvw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/fairvw.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/floating.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/floating.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/floatingw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/floatingw.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/fullscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/fullscreen.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/fullscreenw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/fullscreenw.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/magnifier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/magnifier.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/magnifierw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/magnifierw.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/max.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/max.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/maxw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/maxw.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/spiral.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/spiral.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/spiralw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/spiralw.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/tile.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/tilebottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/tilebottom.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/tilebottomw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/tilebottomw.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/tileleft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/tileleft.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/tileleftw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/tileleftw.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/tiletop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/tiletop.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/tiletopw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/tiletopw.png -------------------------------------------------------------------------------- /awesome/themes/default/layouts/tilew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/layouts/tilew.png -------------------------------------------------------------------------------- /awesome/themes/default/submenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/submenu.png -------------------------------------------------------------------------------- /awesome/themes/default/taglist/squarefw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/taglist/squarefw.png -------------------------------------------------------------------------------- /awesome/themes/default/taglist/squarew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/taglist/squarew.png -------------------------------------------------------------------------------- /awesome/themes/default/theme.lua: -------------------------------------------------------------------------------- 1 | --------------------------- 2 | -- Default awesome theme -- 3 | --------------------------- 4 | 5 | local theme = {} 6 | 7 | theme.font = "sans 8" 8 | 9 | theme.bg_normal = "#222222" 10 | theme.bg_focus = "#535d6c" 11 | theme.bg_urgent = "#ff0000" 12 | theme.bg_minimize = "#444444" 13 | theme.bg_systray = theme.bg_normal 14 | 15 | theme.fg_normal = "#aaaaaa" 16 | theme.fg_focus = "#ffffff" 17 | theme.fg_urgent = "#ffffff" 18 | theme.fg_minimize = "#ffffff" 19 | 20 | theme.useless_gap = 0 21 | theme.border_width = 1 22 | theme.border_normal = "#000000" 23 | theme.border_focus = "#535d6c" 24 | theme.border_marked = "#91231c" 25 | 26 | -- There are other variable sets 27 | -- overriding the default one when 28 | -- defined, the sets are: 29 | -- taglist_[bg|fg]_[focus|urgent|occupied|empty] 30 | -- tasklist_[bg|fg]_[focus|urgent] 31 | -- titlebar_[bg|fg]_[normal|focus] 32 | -- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color] 33 | -- mouse_finder_[color|timeout|animate_timeout|radius|factor] 34 | -- Example: 35 | --theme.taglist_bg_focus = "#ff0000" 36 | 37 | -- Display the taglist squares 38 | theme.taglist_squares_sel = "/usr/share/awesome/themes/default/taglist/squarefw.png" 39 | theme.taglist_squares_unsel = "/usr/share/awesome/themes/default/taglist/squarew.png" 40 | 41 | -- Variables set for theming the menu: 42 | -- menu_[bg|fg]_[normal|focus] 43 | -- menu_[border_color|border_width] 44 | theme.menu_submenu_icon = "/usr/share/awesome/themes/default/submenu.png" 45 | theme.menu_height = 15 46 | theme.menu_width = 100 47 | 48 | -- You can add as many variables as 49 | -- you wish and access them by using 50 | -- beautiful.variable in your rc.lua 51 | --theme.bg_widget = "#cc0000" 52 | 53 | -- Define the image to load 54 | theme.titlebar_close_button_normal = "/usr/share/awesome/themes/default/titlebar/close_normal.png" 55 | theme.titlebar_close_button_focus = "/usr/share/awesome/themes/default/titlebar/close_focus.png" 56 | 57 | theme.titlebar_minimize_button_normal = "/usr/share/awesome/themes/default/titlebar/minimize_normal.png" 58 | theme.titlebar_minimize_button_focus = "/usr/share/awesome/themes/default/titlebar/minimize_focus.png" 59 | 60 | theme.titlebar_ontop_button_normal_inactive = "/usr/share/awesome/themes/default/titlebar/ontop_normal_inactive.png" 61 | theme.titlebar_ontop_button_focus_inactive = "/usr/share/awesome/themes/default/titlebar/ontop_focus_inactive.png" 62 | theme.titlebar_ontop_button_normal_active = "/usr/share/awesome/themes/default/titlebar/ontop_normal_active.png" 63 | theme.titlebar_ontop_button_focus_active = "/usr/share/awesome/themes/default/titlebar/ontop_focus_active.png" 64 | 65 | theme.titlebar_sticky_button_normal_inactive = "/usr/share/awesome/themes/default/titlebar/sticky_normal_inactive.png" 66 | theme.titlebar_sticky_button_focus_inactive = "/usr/share/awesome/themes/default/titlebar/sticky_focus_inactive.png" 67 | theme.titlebar_sticky_button_normal_active = "/usr/share/awesome/themes/default/titlebar/sticky_normal_active.png" 68 | theme.titlebar_sticky_button_focus_active = "/usr/share/awesome/themes/default/titlebar/sticky_focus_active.png" 69 | 70 | theme.titlebar_floating_button_normal_inactive = "/usr/share/awesome/themes/default/titlebar/floating_normal_inactive.png" 71 | theme.titlebar_floating_button_focus_inactive = "/usr/share/awesome/themes/default/titlebar/floating_focus_inactive.png" 72 | theme.titlebar_floating_button_normal_active = "/usr/share/awesome/themes/default/titlebar/floating_normal_active.png" 73 | theme.titlebar_floating_button_focus_active = "/usr/share/awesome/themes/default/titlebar/floating_focus_active.png" 74 | 75 | theme.titlebar_maximized_button_normal_inactive = "/usr/share/awesome/themes/default/titlebar/maximized_normal_inactive.png" 76 | theme.titlebar_maximized_button_focus_inactive = "/usr/share/awesome/themes/default/titlebar/maximized_focus_inactive.png" 77 | theme.titlebar_maximized_button_normal_active = "/usr/share/awesome/themes/default/titlebar/maximized_normal_active.png" 78 | theme.titlebar_maximized_button_focus_active = "/usr/share/awesome/themes/default/titlebar/maximized_focus_active.png" 79 | 80 | theme.wallpaper = "~/launcher/sys.py/gameshell/wallpaper/loading.png" 81 | theme.wallpaperpc = "~/launcher/sys.py/gameshell/wallpaper/desktopbg.jpg" 82 | 83 | -- You can use your own layout icons like this: 84 | theme.layout_fairh = "/usr/share/awesome/themes/default/layouts/fairhw.png" 85 | theme.layout_fairv = "/usr/share/awesome/themes/default/layouts/fairvw.png" 86 | theme.layout_floating = "/usr/share/awesome/themes/default/layouts/floatingw.png" 87 | theme.layout_magnifier = "/usr/share/awesome/themes/default/layouts/magnifierw.png" 88 | theme.layout_max = "/usr/share/awesome/themes/default/layouts/maxw.png" 89 | theme.layout_fullscreen = "/usr/share/awesome/themes/default/layouts/fullscreenw.png" 90 | theme.layout_tilebottom = "/usr/share/awesome/themes/default/layouts/tilebottomw.png" 91 | theme.layout_tileleft = "/usr/share/awesome/themes/default/layouts/tileleftw.png" 92 | theme.layout_tile = "/usr/share/awesome/themes/default/layouts/tilew.png" 93 | theme.layout_tiletop = "/usr/share/awesome/themes/default/layouts/tiletopw.png" 94 | theme.layout_spiral = "/usr/share/awesome/themes/default/layouts/spiralw.png" 95 | theme.layout_dwindle = "/usr/share/awesome/themes/default/layouts/dwindlew.png" 96 | theme.layout_cornernw = "/usr/share/awesome/themes/default/layouts/cornernww.png" 97 | theme.layout_cornerne = "/usr/share/awesome/themes/default/layouts/cornernew.png" 98 | theme.layout_cornersw = "/usr/share/awesome/themes/default/layouts/cornersww.png" 99 | theme.layout_cornerse = "/usr/share/awesome/themes/default/layouts/cornersew.png" 100 | 101 | theme.awesome_icon = "/usr/share/awesome/icons/awesome16.png" 102 | 103 | -- Define the icon theme for application icons. If not set then the icons 104 | -- from /usr/share/icons and /usr/share/icons/hicolor will be used. 105 | theme.icon_theme = nil 106 | 107 | return theme 108 | 109 | -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 110 | -------------------------------------------------------------------------------- /awesome/themes/default/titlebar/close_focus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/titlebar/close_focus.png -------------------------------------------------------------------------------- /awesome/themes/default/titlebar/close_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/titlebar/close_normal.png -------------------------------------------------------------------------------- /awesome/themes/default/titlebar/floating_focus_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/titlebar/floating_focus_active.png -------------------------------------------------------------------------------- /awesome/themes/default/titlebar/floating_focus_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/titlebar/floating_focus_inactive.png -------------------------------------------------------------------------------- /awesome/themes/default/titlebar/floating_normal_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/titlebar/floating_normal_active.png -------------------------------------------------------------------------------- /awesome/themes/default/titlebar/floating_normal_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/titlebar/floating_normal_inactive.png -------------------------------------------------------------------------------- /awesome/themes/default/titlebar/maximized_focus_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/titlebar/maximized_focus_active.png -------------------------------------------------------------------------------- /awesome/themes/default/titlebar/maximized_focus_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/titlebar/maximized_focus_inactive.png -------------------------------------------------------------------------------- /awesome/themes/default/titlebar/maximized_normal_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/titlebar/maximized_normal_active.png -------------------------------------------------------------------------------- /awesome/themes/default/titlebar/maximized_normal_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/titlebar/maximized_normal_inactive.png -------------------------------------------------------------------------------- /awesome/themes/default/titlebar/minimize_focus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/titlebar/minimize_focus.png -------------------------------------------------------------------------------- /awesome/themes/default/titlebar/minimize_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/titlebar/minimize_normal.png -------------------------------------------------------------------------------- /awesome/themes/default/titlebar/ontop_focus_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/titlebar/ontop_focus_active.png -------------------------------------------------------------------------------- /awesome/themes/default/titlebar/ontop_focus_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/titlebar/ontop_focus_inactive.png -------------------------------------------------------------------------------- /awesome/themes/default/titlebar/ontop_normal_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/titlebar/ontop_normal_active.png -------------------------------------------------------------------------------- /awesome/themes/default/titlebar/ontop_normal_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/titlebar/ontop_normal_inactive.png -------------------------------------------------------------------------------- /awesome/themes/default/titlebar/sticky_focus_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/titlebar/sticky_focus_active.png -------------------------------------------------------------------------------- /awesome/themes/default/titlebar/sticky_focus_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/titlebar/sticky_focus_inactive.png -------------------------------------------------------------------------------- /awesome/themes/default/titlebar/sticky_normal_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/titlebar/sticky_normal_active.png -------------------------------------------------------------------------------- /awesome/themes/default/titlebar/sticky_normal_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/awesome/themes/default/titlebar/sticky_normal_inactive.png -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | exit1() { 3 | exit 1 4 | } 5 | tYEL="\e[33m" 6 | tRED="\e[91m" 7 | tGRE="\e[92m" 8 | tRST="\e[39m" 9 | tBLD="\e[1m" 10 | tTICK="✔" 11 | tELLIP="⋯" 12 | e_red() { echo -e "${tRED}${1}${tRST}";} 13 | e_green() { echo -e "${tGRE}${1}${tRST}";} 14 | e_yellow() { echo -e "${tYEL}${1}${tRST}";} 15 | noop() { 16 | echo "noop" > /dev/null 17 | } 18 | OPT_CHECK_BASE=true 19 | OPT_UNINSTALL=false 20 | OPTIND=1 21 | while getopts ":n:u" opt; do 22 | case ${opt} in 23 | n ) 24 | OPT_CHECK_BASE=false 25 | e_green "Skipping check of base directory" 26 | ;; 27 | u ) 28 | e_red "This is where the uninstall would be called probably" 29 | OPT_UNINSTALL=true 30 | ;; 31 | \?) 32 | e_red "Invalid option: -$OPTARG" 1>&2 33 | exit1 34 | ;; 35 | esac 36 | done 37 | shift $((OPTIND -1)) 38 | 39 | 40 | ## yesno 41 | yesno() { 42 | e_yellow "${1} [Y/n]" 43 | local choice_made=0 44 | read user_choice 45 | while [[ "${choice_made}" < 1 ]]; do 46 | case "$(echo ${user_choice} | tr '[:upper:]' '[:lower:]')" in 47 | "y" | "yes" | "") 48 | choice_made=1 49 | e_green "${tELLIP} ${2}" 50 | ${3} 51 | ;; 52 | "n" | "no") 53 | choice_made=1 54 | e_yellow "${tELLIP} ${4}" 55 | ${5} 56 | ;; 57 | *) 58 | e_red "Please enter 'y' or 'n'." 59 | read user_choice 60 | ;; 61 | esac 62 | done 63 | } 64 | CURRENT_BASE=$(cd "$(dirname "${0}")"; pwd -P) 65 | EXPECTED_BASE="${HOME}/launcher" 66 | 67 | delete_existing_base () { 68 | rm -r "${EXPECTED_BASE}" 69 | } 70 | check_base () { 71 | if [ "$EXPECTED_BASE" != "$CURRENT_BASE" ]; then 72 | e_yellow "Not running Launcher install from the right place. I'll attempt to move it..." 73 | if [ -d "$EXPECTED_BASE" ]; then 74 | e_red "You already have a '${EXPECTED_BASE}' directory!" 75 | yesno "Do you want me to delete it?" "Deleting '${EXPECTED_BASE}'" delete_existing_base "Okay go and sort your files out and try the install again" exit1 76 | fi 77 | e_green "${tELLIP} Creating '${EXPECTED_BASE}' directory" 78 | mkdir -p "${EXPECTED_BASE}" 79 | e_green "${tELLIP} Copying files from '${CURRENT_BASE}' to '${EXPECTED_BASE}'" 80 | cd "${CURRENT_BASE}" 81 | cp -R ./* "${EXPECTED_BASE}" 82 | if [[ -d "${EXPECTED_BASE}" ]]; then 83 | e_green "${tELLIP} Deleting '${CURRENT_BASE}'" 84 | rm -r "${CURRENT_BASE}" 85 | CURRENT_BASE="${EXPECTED_BASE}" 86 | cd "${CURRENT_BASE}" 87 | exec "./install.sh" -n 88 | else 89 | e_red "Something went wrong!" 90 | fi 91 | exit1 92 | fi 93 | } 94 | do_backup_awesome() { 95 | cp -R "${HOME}/.config/awesome" "${HOME}/.config/awesome.bak" 96 | e_green "${tTICK} Backup created!" 97 | e_yellow "You can run the install script with -u to restore the backup" 98 | } 99 | check_backup_awesome () { 100 | yesno "Do you want to backup the default config for awesome? (~/.config/awesome)" "Creating a backup in ~/.config/awesome.bak" do_backup_awesome "Overwriting ~/.config/awesome with new config" noop 101 | } 102 | do_install_awesome () { 103 | echo "Installing awesome config" 104 | cd "${CURRENT_BASE}/awesome" 105 | cp -R ./* "${HOME}/.config/awesome" 106 | } 107 | check_running_root () { 108 | if [[ $(id -u) -eq 0 ]]; then 109 | e_red "Don't run this script as root/sudo, parts of the script depend on you" 110 | e_red "being the correct non-root user. You will be prompted for your sudo" 111 | e_red "password when it is needed..." 112 | exit1 113 | fi 114 | } 115 | do_install_deps () { 116 | sudo apt update 117 | sudo apt install git libuser synaptic -y 118 | sudo apt install python-wicd wicd wicd-curses python-pycurl python-alsaaudio python-pygame python-gobject python-xlib -y 119 | sudo apt install python-pip -y 120 | sudo pip install validators numpy requests python-mpd2 beeprint 121 | 122 | chmod +x load.sh 123 | } 124 | do_make_usergroup () { 125 | sudo groupadd cpifav -g 31415 126 | sudo adduser chip cpifav 127 | } 128 | do_add_sudoers () { 129 | printf "chip ALL = (root) NOPASSWD: /sbin/reboot\nchip ALL = (root) NOPASSWD: /sbin/shutdown\nchip ALL = (root) NOPASSWD: /usr/sbin/rfkill\n" | sudo tee /etc/sudoers.d/launcher 130 | sudo chmod 0440 /etc/sudoers.d/launcher 131 | } 132 | do_remove_pockethome () { 133 | sudo apt -y remove pocket-home 134 | } 135 | do_restart () { 136 | sudo reboot 137 | } 138 | do_complete () { 139 | e_green "Installation complete!" 140 | yesno "Do you want to restart your PocketCHIP now?" "Restarting" do_restart "Alright, but you need to restart to start using the new launcher" noop 141 | } 142 | do_uninstall() { 143 | echo "Uninstall would be here" 144 | if [[ -d "${HOME}/.config/awesome.bak" ]]; then 145 | e_green "Restoring awesome config" 146 | cd "${HOME}/.config/awesome.bak" 147 | cp -R ./* "${HOME}/.config/awesome" 148 | fi 149 | sudo apt -y install pocket-home 150 | e_green "pocket-home launcher is now reinstalled." 151 | } 152 | 153 | check_running_root 154 | if [[ "$OPT_UNINSTALL" == true ]]; then 155 | do_uninstall 156 | else 157 | if [[ "$OPT_CHECK_BASE" == true ]]; then check_base; fi 158 | check_backup_awesome 159 | do_install_awesome 160 | do_install_deps 161 | do_make_usergroup 162 | do_remove_pockethome 163 | do_add_sudoers 164 | fi 165 | do_complete 166 | -------------------------------------------------------------------------------- /load.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BASENAME=`dirname "$0"` 4 | 5 | cd $BASENAME/sys.py 6 | 7 | python run.py 8 | 9 | 10 | -------------------------------------------------------------------------------- /skin/default/Menu/GameShell/20_Retro Games/MAME.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/Menu/GameShell/20_Retro Games/MAME.png -------------------------------------------------------------------------------- /skin/default/Menu/GameShell/20_Retro Games/MGBA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/Menu/GameShell/20_Retro Games/MGBA.png -------------------------------------------------------------------------------- /skin/default/Menu/GameShell/20_Retro Games/NESTOPIA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/Menu/GameShell/20_Retro Games/NESTOPIA.png -------------------------------------------------------------------------------- /skin/default/Menu/GameShell/CaveStory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/Menu/GameShell/CaveStory.png -------------------------------------------------------------------------------- /skin/default/Menu/GameShell/Music Player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/Menu/GameShell/Music Player.png -------------------------------------------------------------------------------- /skin/default/Menu/GameShell/PICO-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/Menu/GameShell/PICO-8.png -------------------------------------------------------------------------------- /skin/default/Menu/GameShell/PowerOFF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/Menu/GameShell/PowerOFF.png -------------------------------------------------------------------------------- /skin/default/Menu/GameShell/Reload UI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/Menu/GameShell/Reload UI.png -------------------------------------------------------------------------------- /skin/default/Menu/GameShell/Retro Games.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/Menu/GameShell/Retro Games.png -------------------------------------------------------------------------------- /skin/default/Menu/GameShell/RetroArch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/Menu/GameShell/RetroArch.png -------------------------------------------------------------------------------- /skin/default/Menu/GameShell/Settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/Menu/GameShell/Settings.png -------------------------------------------------------------------------------- /skin/default/Menu/GameShell/Sleep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/Menu/GameShell/Sleep.png -------------------------------------------------------------------------------- /skin/default/Menu/GameShell/Terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/Menu/GameShell/Terminal.png -------------------------------------------------------------------------------- /skin/default/Menu/GameShell/TinyCloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/Menu/GameShell/TinyCloud.png -------------------------------------------------------------------------------- /skin/default/Menu/GameShell/freeDM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/Menu/GameShell/freeDM.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/blank.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/footbar_icons/footbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/footbar_icons/footbar.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/icons/DialogBoxs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/icons/DialogBoxs.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/icons/GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/icons/GS.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/icons/_L.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/icons/_L.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/icons/_R.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/icons/_R.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/icons/about_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/icons/about_bg.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/icons/airwire.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/icons/airwire.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/icons/blueselector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/icons/blueselector.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/icons/buttonslayout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/icons/buttonslayout.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/icons/done.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/icons/done.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/icons/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/icons/empty.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/icons/heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/icons/heart.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/icons/icon_sd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/icons/icon_sd.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/icons/light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/icons/light.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/icons/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/icons/lock.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/icons/needwifi_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/icons/needwifi_bg.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/icons/online.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/icons/online.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/icons/pico8_md5_err.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/icons/pico8_md5_err.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/icons/pico8_notfound.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/icons/pico8_notfound.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/icons/rom_download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/icons/rom_download.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/icons/roundcorners.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/icons/roundcorners.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/icons/scale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/icons/scale.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/icons/sheep_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/icons/sheep_bg.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/icons/sheep_body.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/icons/sheep_body.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/icons/sheep_head.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/icons/sheep_head.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/icons/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/icons/star.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/icons/sys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/icons/sys.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/icons/tape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/icons/tape.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/icons/vol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/icons/vol.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/titlebar_icons/battery_unknown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/titlebar_icons/battery_unknown.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/titlebar_icons/bluetooth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/titlebar_icons/bluetooth.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/titlebar_icons/soundvolume.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/titlebar_icons/soundvolume.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/titlebar_icons/wifi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/titlebar_icons/wifi.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/titlebar_icons/withcharging.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/titlebar_icons/withcharging.png -------------------------------------------------------------------------------- /skin/default/sys.py/gameshell/titlebar_icons/without_charging.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/sys.py/gameshell/titlebar_icons/without_charging.png -------------------------------------------------------------------------------- /skin/default/truetype/NotoSansCJK-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/truetype/NotoSansCJK-Regular.ttf -------------------------------------------------------------------------------- /skin/default/truetype/NotoSansMono-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/truetype/NotoSansMono-Regular.ttf -------------------------------------------------------------------------------- /skin/default/truetype/VarelaRound-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/truetype/VarelaRound-Regular.ttf -------------------------------------------------------------------------------- /skin/default/truetype/VeraMono.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/default/truetype/VeraMono.ttf -------------------------------------------------------------------------------- /skin/pocket/Menu/GameShell/Browse Files.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/Menu/GameShell/Browse Files.png -------------------------------------------------------------------------------- /skin/pocket/Menu/GameShell/Get Help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/Menu/GameShell/Get Help.png -------------------------------------------------------------------------------- /skin/pocket/Menu/GameShell/Make Music.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/Menu/GameShell/Make Music.png -------------------------------------------------------------------------------- /skin/pocket/Menu/GameShell/PICO-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/Menu/GameShell/PICO-8.png -------------------------------------------------------------------------------- /skin/pocket/Menu/GameShell/PowerOFF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/Menu/GameShell/PowerOFF.png -------------------------------------------------------------------------------- /skin/pocket/Menu/GameShell/Reload UI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/Menu/GameShell/Reload UI.png -------------------------------------------------------------------------------- /skin/pocket/Menu/GameShell/Settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/Menu/GameShell/Settings.png -------------------------------------------------------------------------------- /skin/pocket/Menu/GameShell/Software.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/Menu/GameShell/Software.png -------------------------------------------------------------------------------- /skin/pocket/Menu/GameShell/Terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/Menu/GameShell/Terminal.png -------------------------------------------------------------------------------- /skin/pocket/Menu/GameShell/Write.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/Menu/GameShell/Write.png -------------------------------------------------------------------------------- /skin/pocket/config.ini: -------------------------------------------------------------------------------- 1 | [Colors] 2 | High = #eb008b # Font color of free space display in Settins -> Storage 3 | Text = #ffffff # Title bar text color (current selection and clock) 4 | Front = #eb008b # Scrollbar color everywhere, active list item background color in Retro Games 5 | URL = #eb008b # ??? 6 | Line = #4d4d4d # border color of top and bottom title bar (and maybe separator in game list?) 7 | TitleBg = #4d4d4d # background color of top title bar 8 | Active = #ff9900 # ??? 9 | Disabled = #ff0000 # ??? 10 | White = #4d4d4d # launcher background color 11 | Black = #3d3d3d # ??? 12 | 13 | # New colors introduced 14 | UI_Base = #d3d3d3 15 | UI_Background = #ffffff 16 | UI_Foreground = #eb008b -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/blank.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/folder.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/footbar_icons/footbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/footbar_icons/footbar.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/icons/DialogBoxs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/icons/DialogBoxs.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/icons/GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/icons/GS.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/icons/_L.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/icons/_L.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/icons/_R.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/icons/_R.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/icons/about_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/icons/about_bg.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/icons/airwire.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/icons/airwire.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/icons/blueselector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/icons/blueselector.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/icons/buttonslayout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/icons/buttonslayout.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/icons/done.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/icons/done.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/icons/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/icons/empty.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/icons/heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/icons/heart.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/icons/icon_sd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/icons/icon_sd.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/icons/light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/icons/light.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/icons/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/icons/lock.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/icons/needwifi_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/icons/needwifi_bg.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/icons/online.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/icons/online.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/icons/pico8_md5_err.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/icons/pico8_md5_err.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/icons/pico8_notfound.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/icons/pico8_notfound.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/icons/rom_download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/icons/rom_download.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/icons/roundcorners.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/icons/roundcorners.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/icons/scale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/icons/scale.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/icons/sheep_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/icons/sheep_bg.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/icons/sheep_body.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/icons/sheep_body.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/icons/sheep_head.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/icons/sheep_head.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/icons/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/icons/star.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/icons/sys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/icons/sys.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/icons/tape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/icons/tape.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/icons/vol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/icons/vol.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/titlebar_icons/battery_unknown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/titlebar_icons/battery_unknown.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/titlebar_icons/bluetooth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/titlebar_icons/bluetooth.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/titlebar_icons/soundvolume.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/titlebar_icons/soundvolume.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/titlebar_icons/wifi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/titlebar_icons/wifi.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/titlebar_icons/withcharging.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/titlebar_icons/withcharging.png -------------------------------------------------------------------------------- /skin/pocket/sys.py/gameshell/titlebar_icons/without_charging.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/sys.py/gameshell/titlebar_icons/without_charging.png -------------------------------------------------------------------------------- /skin/pocket/truetype/NotoSansCJK-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/truetype/NotoSansCJK-Regular.ttf -------------------------------------------------------------------------------- /skin/pocket/truetype/NotoSansMono-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/truetype/NotoSansMono-Regular.ttf -------------------------------------------------------------------------------- /skin/pocket/truetype/VarelaRound-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/truetype/VarelaRound-Regular.ttf -------------------------------------------------------------------------------- /skin/pocket/truetype/VeraMono.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/skin/pocket/truetype/VeraMono.ttf -------------------------------------------------------------------------------- /sys.py/UI/Emulator/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | from pygame.locals import * 5 | from sys import exit 6 | import os 7 | import sys 8 | 9 | 10 | ## local UI import 11 | from UI.delete_confirm_page import DeleteConfirmPage 12 | from UI.icon_pool import MyIconPool 13 | from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB 14 | from UI.lang_manager import MyLangManager 15 | 16 | from rom_list_page import RomListPage 17 | from fav_list_page import FavListPage 18 | 19 | class FavDeleteConfirmPage(DeleteConfirmPage): 20 | 21 | def KeyDown(self,event): 22 | 23 | if IsKeyMenuOrB(event.key): 24 | 25 | self.ReturnToUpLevelPage() 26 | self._Screen.Draw() 27 | self._Screen.SwapAndShow() 28 | 29 | 30 | if IsKeyStartOrA(event.key): 31 | try: 32 | #self._FileName 33 | stats = os.stat(self._FileName) 34 | os.chown(self._FileName, stats.st_uid,stats.st_uid) ## normally uid and gid should be the same 35 | except: 36 | print("error in FavDeleteConfirmPage chown ") 37 | 38 | self.SnapMsg(MyLangManager.Tr("Deleteing")) 39 | self._Screen.Draw() 40 | self._Screen.SwapAndShow() 41 | self.Reset() 42 | 43 | pygame.time.delay(300) 44 | self.ReturnToUpLevelPage() 45 | self._Screen.Draw() 46 | self._Screen.SwapAndShow() 47 | 48 | print(self._FileName) 49 | 50 | 51 | class MyEmulator(object): 52 | 53 | _Icons = {} 54 | RomListPage = None 55 | FavListPage = None 56 | _Emulator = None 57 | 58 | _FavGID = 31415 59 | _FavGname = "cpifav" 60 | 61 | def __init__(self): 62 | self._Icons = {} 63 | 64 | def load_icons(self): 65 | """ 66 | basepath = os.path.dirname(os.path.realpath(__file__)) 67 | files = os.listdir(basepath+"/icons") 68 | for i in files: 69 | if os.path.isfile(basepath+"/"+i) and i.endswith(".png"): 70 | keyname = i.split(".")[0] 71 | self._Icons[keyname] = pygame.image.load(basepath+"/"+i).convert_alpha() 72 | """ 73 | self._Icons["sys"] = MyIconPool._Icons["sys"] 74 | 75 | 76 | def InitDeleteConfirmPage(self,main_screen): 77 | self.DeleteConfirmPage = DeleteConfirmPage() 78 | self.DeleteConfirmPage._Screen = main_screen 79 | self.DeleteConfirmPage._Name = "DeleteConfirm" 80 | self.DeleteConfirmPage.Init() 81 | 82 | self.FavDeleteConfirmPage = FavDeleteConfirmPage() 83 | self.FavDeleteConfirmPage._Screen = main_screen 84 | self.FavDeleteConfirmPage._Name = "DeleteConfirm" 85 | self.FavDeleteConfirmPage.Init() 86 | 87 | def InitFavListPage(self,main_screen): 88 | self.FavListPage = FavListPage() 89 | self.FavListPage._Screen = main_screen 90 | self.FavListPage._Name = "FavouriteGames" 91 | self.FavListPage._Emulator = self._Emulator 92 | self.FavListPage._Parent = self 93 | 94 | self.FavListPage.Init() 95 | 96 | def InitRomListPage(self,main_screen): 97 | self.RomListPage = RomListPage() 98 | self.RomListPage._Screen = main_screen 99 | self.RomListPage._Name = self._Emulator["TITLE"] 100 | self.RomListPage._Emulator = self._Emulator 101 | self.RomListPage._Parent = self 102 | self.RomListPage.Init() 103 | 104 | def Init(self,main_screen): 105 | self.load_icons() 106 | self.InitDeleteConfirmPage(main_screen) 107 | self.InitRomListPage(main_screen) 108 | self.InitFavListPage(main_screen) 109 | 110 | def API(self,main_screen): 111 | if main_screen !=None: 112 | main_screen.PushCurPage() 113 | main_screen.SetCurPage(self.RomListPage) 114 | main_screen.Draw() 115 | main_screen.SwapAndShow() 116 | -------------------------------------------------------------------------------- /sys.py/UI/Emulator/list_item.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | #from beeprint import pp 5 | import os 6 | 7 | ## local UI import 8 | from UI.constants import ICON_TYPES 9 | from UI.page import Page 10 | from UI.label import Label 11 | from UI.icon_item import IconItem 12 | from UI.util_funcs import midRect 13 | from UI.skin_manager import MySkinManager 14 | 15 | # a item for List 16 | # - - - - - - - - - - - -- 17 | # | Icon Text..... > | 18 | # ------------------------ 19 | 20 | 21 | class ListItemIcon(IconItem): 22 | 23 | _CanvasHWND = None 24 | _Parent = None 25 | _Width = 18 26 | _Height = 18 27 | 28 | def Draw(self): 29 | self._CanvasHWND.blit(self._ImgSurf,(self._PosX,self._PosY+(self._Parent._Height-self._Height)/2,self._Width,self._Height)) 30 | 31 | class ListItem(object): 32 | _PosX = 0 33 | _PosY = 0 34 | _Width = 0 35 | _Height = 32 36 | 37 | _Labels = {} 38 | _Icons = {} 39 | _Fonts = {} 40 | _MyType = ICON_TYPES["EXE"] 41 | _LinkObj = None 42 | _Path = "" 43 | _Active = False 44 | _Playing = False ## play or pause 45 | _Parent = None 46 | 47 | def __init__(self): 48 | self._Labels = {} 49 | self._Icons = {} 50 | self._Fonts = {} 51 | 52 | def IsFile(self): 53 | if self._MyType == ICON_TYPES["FILE"]: 54 | return True 55 | 56 | return False 57 | def IsDir(self): 58 | if self._MyType == ICON_TYPES["DIR"]: 59 | return True 60 | 61 | return False 62 | 63 | def Init(self,text): 64 | 65 | #self._Fonts["normal"] = fonts["veramono12"] 66 | 67 | l = Label() 68 | l._PosX = 20 69 | l.SetCanvasHWND(self._Parent._CanvasHWND) 70 | 71 | if self._MyType == ICON_TYPES["DIR"] or self._MyType == ICON_TYPES["FILE"]: 72 | self._Path = text 73 | 74 | label_text = os.path.basename(text) 75 | alias_file = os.path.splitext(text)[0] + ".alias" 76 | if os.path.isfile(alias_file): 77 | fp = open(alias_file, "r") 78 | alias = fp.read() 79 | fp.close() 80 | label_text = alias.decode("utf8") 81 | 82 | if self._MyType == ICON_TYPES["DIR"]: 83 | l.Init(label_text,self._Fonts["normal"]) 84 | else: 85 | l.Init(label_text,self._Fonts["normal"]) 86 | 87 | 88 | self._Labels["Text"] = l 89 | 90 | 91 | 92 | def Draw(self): 93 | if self._Path != "[..]": 94 | self._Labels["Text"]._PosX = 23 95 | else: 96 | self._Labels["Text"]._PosX = 3 97 | 98 | self._Labels["Text"]._PosY = self._PosY + (self._Height - self._Labels["Text"]._Height)/2 99 | self._Labels["Text"].Draw() 100 | 101 | """ 102 | if self._Active == True: 103 | pass 104 | """ 105 | if self._MyType == ICON_TYPES["DIR"] and self._Path != "[..]": 106 | self._Parent._Icons["sys"]._IconIndex = 0 107 | self._Parent._Icons["sys"].NewCoord(self._PosX+12,self._PosY+ (self._Height - self._Parent._Icons["sys"]._Height)/2+self._Parent._Icons["sys"]._Height/2) 108 | self._Parent._Icons["sys"].Draw() 109 | 110 | if self._MyType == ICON_TYPES["FILE"]: 111 | self._Parent._Icons["sys"]._IconIndex = 1 112 | self._Parent._Icons["sys"].NewCoord(self._PosX+12,self._PosY+ (self._Height - self._Parent._Icons["sys"]._Height)/2+self._Parent._Icons["sys"]._Height/2) 113 | self._Parent._Icons["sys"].Draw() 114 | 115 | pygame.draw.line(self._Parent._CanvasHWND,MySkinManager.GiveColor('Line'),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1) 116 | 117 | 118 | -------------------------------------------------------------------------------- /sys.py/UI/Emulator/rom_so_confirm_page.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | 4 | import os 5 | import pygame 6 | 7 | import glob 8 | import shutil 9 | import gobject 10 | import validators 11 | #from pySmartDL import SmartDL 12 | 13 | from libs.roundrects import aa_round_rect 14 | 15 | from UI.confirm_page import ConfirmPage 16 | from UI.download_process_page import DownloadProcessPage 17 | from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB 18 | from UI.multilabel import MultiLabel 19 | from UI.lang_manager import MyLangManager 20 | 21 | import config 22 | 23 | class RomSoConfirmPage(ConfirmPage): 24 | _ListFont = MyLangManager.TrFont("veramono18") 25 | 26 | _ConfirmText = MyLangManager.Tr("SetupGameEngineAutoQ") 27 | 28 | _MyDownloadPage = None 29 | 30 | def CheckBattery(self): 31 | try: 32 | f = open(config.Battery) 33 | except IOError: 34 | print( "RomSoConfirmPage open %s failed" % config.Battery) 35 | return 6 36 | else: 37 | with f: 38 | bat_uevent = {} 39 | content = f.readlines() 40 | content = [x.strip() for x in content] 41 | for i in content: 42 | pis = i.split("=") 43 | if len(pis) > 1: 44 | bat_uevent[pis[0]] = pis[1] 45 | 46 | if "POWER_SUPPLY_CAPACITY" in bat_uevent: 47 | cur_cap = int(bat_uevent["POWER_SUPPLY_CAPACITY"]) 48 | else: 49 | cur_cap = 0 50 | 51 | return cur_cap 52 | 53 | return 0 54 | 55 | def Init(self): 56 | self._PosX = self._Index * self._Screen._Width 57 | self._Width = self._Screen._Width 58 | self._Height = self._Screen._Height 59 | 60 | self._CanvasHWND = self._Screen._CanvasHWND 61 | 62 | li = MultiLabel() 63 | li.SetCanvasHWND(self._CanvasHWND) 64 | li._Width = 160 65 | li.Init(self._ConfirmText,self._ListFont) 66 | 67 | li._PosX = (self._Width - li._Width)/2 68 | li._PosY = (self._Height - li._Height)/2 69 | 70 | self._BGPosX = li._PosX-20 71 | self._BGPosY = li._PosY-20 72 | self._BGWidth = li._Width+40 73 | self._BGHeight = li._Height+40 74 | 75 | self._MyList.append(li) 76 | 77 | def SnapMsg(self,msg): 78 | self._MyList[0].SetText(msg) 79 | self._Screen.Draw() 80 | self._Screen.SwapAndShow() 81 | self._MyList[0].SetText(self._ConfirmText) 82 | 83 | def OnReturnBackCb(self): 84 | self.ReturnToUpLevelPage() 85 | self._Screen.Draw() 86 | self._Screen.SwapAndShow() 87 | 88 | def KeyDown(self,event): 89 | if IsKeyMenuOrB(event.key): 90 | self.ReturnToUpLevelPage() 91 | self._Screen.Draw() 92 | self._Screen.SwapAndShow() 93 | 94 | if IsKeyStartOrA(event.key): 95 | if self.CheckBattery() < 5: 96 | self.SnapMsg(MyLangManager.Tr("BATOver5Pct")) 97 | else: 98 | if self._MyDownloadPage == None: 99 | self._MyDownloadPage = DownloadProcessPage() 100 | self._MyDownloadPage._Screen = self._Screen 101 | self._MyDownloadPage._Name = "Downloading" 102 | self._MyDownloadPage.Init() 103 | 104 | self._Screen.PushPage(self._MyDownloadPage) 105 | self._Screen.Draw() 106 | self._Screen.SwapAndShow() 107 | 108 | if config.CurKeySet == "PC": 109 | so_url = self._Parent._Emulator["SO_URL"] ## [rom/fav]_list_page is _Parent 110 | so_url = so_url.replace("armhf","x86_64") 111 | print(so_url) 112 | self._MyDownloadPage.StartDownload(so_url,os.path.dirname(self._Parent._Emulator["ROM_SO"])) 113 | else: 114 | self._MyDownloadPage.StartDownload(self._Parent._Emulator["SO_URL"], 115 | os.path.dirname(self._Parent._Emulator["ROM_SO"])) 116 | 117 | 118 | def Draw(self): 119 | self.ClearCanvas() 120 | self.DrawBG() 121 | for i in self._MyList: 122 | i.Draw() 123 | -------------------------------------------------------------------------------- /sys.py/UI/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/sys.py/UI/__init__.py -------------------------------------------------------------------------------- /sys.py/UI/above_all_patch.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | 5 | from libs.roundrects import aa_round_rect 6 | 7 | import alsaaudio 8 | 9 | ## local package import 10 | from constants import ICON_TYPES,icon_ext,icon_width,icon_height,RUNEVT 11 | from icon_item import IconItem 12 | from page import Page,PageStack 13 | from title_bar import TitleBar 14 | from foot_bar import FootBar 15 | from constants import Width,Height,bg_color 16 | from util_funcs import midRect 17 | from keys_def import CurKeys 18 | from label import Label 19 | from skin_manager import MySkinManager 20 | from lang_manager import MyLangManager 21 | from widget import Widget 22 | from config import AudioControl 23 | 24 | 25 | class AboveAllPatch(Widget): 26 | _PosX =Width/2 27 | _PosY =Height/2 28 | _Width =50 29 | _Height=120 30 | 31 | _Text ="" 32 | _FontObj= MyLangManager.TrFont("veramono20") 33 | _Parent =None 34 | _Color = MySkinManager.GiveColor('Text') 35 | _ValColor = MySkinManager.GiveColor('URL') 36 | _CanvasHWND = None 37 | _TextSurf = None 38 | _Icons = {} 39 | _Value = 0 40 | 41 | def __init__(self): 42 | self._Icons = {} 43 | 44 | def Init(self): 45 | pass 46 | 47 | def SetCanvasHWND(self,_canvashwnd): 48 | self._CanvasHWND = _canvashwnd 49 | 50 | def Draw(self): 51 | start_rect = midRect(self._PosX,self._PosY,self._Width,self._Height,Width,Height) 52 | aa_round_rect(self._CanvasHWND,start_rect, self._Color,3,0, self._Color) 53 | 54 | if self._Value > 10: 55 | vol_height = int(self._Height * (float( self._Value)/100.0)) 56 | dheight = self._Height - vol_height 57 | 58 | vol_rect = pygame.Rect(self._PosX-self._Width/2, self._PosY-self._Height/2+dheight, self._Width, vol_height) 59 | 60 | aa_round_rect(self._CanvasHWND,vol_rect, self._ValColor,3,0, self._ValColor) 61 | 62 | else: 63 | vol_height = 10 64 | dheight = self._Height - vol_height 65 | vol_rect = pygame.Rect(self._PosX-self._Width/2, self._PosY-self._Height/2+dheight, self._Width, vol_height) 66 | 67 | aa_round_rect(self._CanvasHWND,vol_rect, self._ValColor,3,0, self._ValColor) 68 | 69 | 70 | class SoundPatch(AboveAllPatch): 71 | 72 | # _Segs = [0,15,29, 45,55,65, 75,90,100] 73 | snd_segs = [ [0,20],[21,40],[41,50],[51,60],[61,70],[71,85],[86,90],[91,95],[96,100] ] 74 | _Needle = 0 75 | 76 | def Init(self): 77 | self.SetCanvasHWND(self._Parent._CanvasHWND) 78 | 79 | def VolumeUp(self): 80 | m = alsaaudio.Mixer(AudioControl) 81 | vol = m.getvolume()[0] 82 | 83 | # Get current volume level 84 | for i,v in enumerate(self.snd_segs): 85 | if vol >= v[0] and vol <= v[1]: 86 | self._Needle = i 87 | break 88 | 89 | # Increment volume 90 | self._Needle += 1 91 | if self._Needle > len(self.snd_segs) -1: 92 | self._Needle = len(self.snd_segs) -1 93 | 94 | # Get upper of two segments 95 | vol = self.snd_segs[self._Needle][0] + (self.snd_segs[self._Needle][1] - self.snd_segs[self._Needle][0])/2 96 | 97 | m.setvolume(vol) 98 | 99 | self._Value = vol 100 | return self._Value 101 | 102 | def VolumeDown(self): 103 | m = alsaaudio.Mixer(AudioControl) 104 | vol = m.getvolume()[0] 105 | 106 | # Get current volume level 107 | for i,v in enumerate(self.snd_segs): 108 | if vol >= v[0] and vol <= v[1]: 109 | self._Needle = i 110 | break 111 | 112 | # Decrement volume 113 | self._Needle -= 1 114 | if self._Needle < 0: 115 | self._Needle = 0 116 | 117 | # Get lower of two segments 118 | vol = self.snd_segs[self._Needle][0] 119 | 120 | if vol < 0: 121 | vol = 0 122 | m.setvolume(vol) 123 | 124 | self._Value = vol 125 | return self._Value 126 | 127 | 128 | def Draw(self): 129 | _contWidth = 280 130 | _contHeight = 40 131 | _contRadius = 4 132 | _segWidth = 20 133 | _segHeight = 20 134 | _segSpace = 10 135 | 136 | _contX = (Width - _contWidth) / 2 137 | _contY = Height - (_contHeight * 3) # Offset from bottom 138 | 139 | # Draw the container 140 | container_rect = pygame.Rect(_contX, _contY, _contWidth, _contHeight) 141 | 142 | aa_round_rect( 143 | self._CanvasHWND, 144 | container_rect, 145 | MySkinManager.GiveColor("UI_Base"), 146 | _contRadius 147 | ) 148 | 149 | # Draw the empty segments 150 | for i in range(0, len(self.snd_segs)): 151 | segment_rect = pygame.Rect( 152 | _contX + _segSpace + (i * (_segWidth + _segSpace)), 153 | _contY + _segSpace, 154 | _segWidth, 155 | _segHeight 156 | ) 157 | self._CanvasHWND.fill(MySkinManager.GiveColor("UI_Background"), segment_rect) 158 | 159 | # Draw the segments for the current volume 160 | for i in range(0,self._Needle+1): 161 | segment_rect = pygame.Rect( 162 | _contX + _segSpace + (i * (_segWidth + _segSpace)), 163 | _contY + _segSpace, 164 | _segWidth, 165 | _segHeight 166 | ) 167 | self._CanvasHWND.fill(MySkinManager.GiveColor("UI_Foreground"), segment_rect) 168 | -------------------------------------------------------------------------------- /sys.py/UI/confirm_page.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | import os 5 | 6 | from libs.roundrects import aa_round_rect 7 | 8 | #UI lib 9 | from constants import Width,Height,ICON_TYPES 10 | from page import Page,PageSelector 11 | from label import Label 12 | from util_funcs import midRect 13 | from keys_def import CurKeys 14 | from skin_manager import MySkinManager 15 | from lang_manager import MyLangManager 16 | 17 | 18 | class ListPageSelector(PageSelector): 19 | _BackgroundColor = MySkinManager.GiveColor('Front') 20 | 21 | def __init__(self): 22 | self._Width = Width 23 | 24 | def AnimateDraw(self,x2,y2): 25 | pass 26 | 27 | def Draw(self): 28 | idx = self._Parent._PsIndex 29 | if idx > (len(self._Parent._MyList)-1): 30 | idx = len(self._Parent._MyList) 31 | if idx > 0: 32 | idx -=1 33 | elif idx == 0: #Nothing 34 | return 35 | 36 | x = self._Parent._MyList[idx]._PosX+2 37 | y = self._Parent._MyList[idx]._PosY+1 38 | h = self._Parent._MyList[idx]._Height -3 39 | 40 | self._PosX = x 41 | self._PosY = y 42 | self._Height = h 43 | 44 | aa_round_rect(self._Parent._CanvasHWND, 45 | (x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor) 46 | 47 | 48 | 49 | class ConfirmPage(Page): 50 | 51 | _Icons = {} 52 | _Selector=None 53 | _FootMsg = ["Nav","","","Cancel","Yes"] 54 | _MyList = [] 55 | _ListFont = MyLangManager.TrFont("veramono20") 56 | _MyStack = None 57 | _FileName = "" 58 | _TrashDir = "" 59 | _ConfirmText = MyLangManager.Tr("ConfirmQ") 60 | _BGPosX = 0 61 | _BGPosY = 0 62 | _BGWidth = 0 63 | _BGHeight = 0 64 | _Parent = None 65 | 66 | def __init__(self): 67 | Page.__init__(self) 68 | self._Icons = {} 69 | self._CanvasHWND = None 70 | self._MyList = [] 71 | 72 | def Reset(self): 73 | self._MyList[0].SetText(self._ConfirmText) 74 | self._MyList[0]._PosX = (self._Width - self._MyList[0]._Width)/2 75 | self._MyList[0]._PosY = (self._Height - self._MyList[0]._Height)/2 76 | 77 | self._BGPosX = self._MyList[0]._PosX-10 78 | self._BGPosY = self._MyList[0]._PosY-10 79 | self._BGWidth = self._MyList[0]._Width+20 80 | self._BGHeight = self._MyList[0]._Height+20 81 | 82 | 83 | def SnapMsg(self,msg): 84 | self._MyList[0].SetText(msg) 85 | self._MyList[0]._PosX = (self._Width - self._MyList[0]._Width)/2 86 | self._MyList[0]._PosY = (self._Height - self._MyList[0]._Height)/2 87 | 88 | self._BGPosX = self._MyList[0]._PosX-10 89 | self._BGPosY = self._MyList[0]._PosY-10 90 | self._BGWidth = self._MyList[0]._Width+20 91 | self._BGHeight = self._MyList[0]._Height+20 92 | 93 | def Init(self): 94 | self._PosX = self._Index * self._Screen._Width 95 | self._Width = self._Screen._Width 96 | self._Height = self._Screen._Height 97 | 98 | self._CanvasHWND = self._Screen._CanvasHWND 99 | 100 | ps = ListPageSelector() 101 | ps._Parent = self 102 | self._Ps = ps 103 | self._PsIndex = 0 104 | 105 | li = Label() 106 | li.SetCanvasHWND(self._CanvasHWND) 107 | li.Init(self._ConfirmText,self._ListFont) 108 | 109 | li._PosX = (self._Width - li._Width)/2 110 | li._PosY = (self._Height - li._Height)/2 111 | 112 | self._BGPosX = li._PosX-10 113 | self._BGPosY = li._PosY-10 114 | self._BGWidth = li._Width+20 115 | self._BGHeight = li._Height+20 116 | 117 | self._MyList.append(li) 118 | 119 | def KeyDown(self,event): 120 | 121 | if event.key == CurKeys["Menu"] or event.key == CurKeys["A"]: 122 | self.ReturnToUpLevelPage() 123 | self._Screen.Draw() 124 | self._Screen.SwapAndShow() 125 | 126 | def DrawBG(self): 127 | _rect = pygame.Rect(self._BGPosX,self._BGPosY,self._BGWidth,self._BGHeight) 128 | 129 | pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('White'),_rect,0) 130 | pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),_rect,1) 131 | 132 | def Draw(self): 133 | #self.ClearCanvas() 134 | 135 | self.DrawBG() 136 | for i in self._MyList: 137 | i.Draw() 138 | 139 | self.Reset() 140 | -------------------------------------------------------------------------------- /sys.py/UI/constants.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | from pygame.locals import * 5 | #from sys import exit 6 | #import os 7 | #import sys 8 | 9 | #from datetime import datetime 10 | 11 | #import base64 12 | #from beeprint import pp 13 | 14 | #UI lib 15 | from skin_manager import MySkinManager 16 | 17 | 18 | Width = 480 19 | Height = 272 20 | bg_color = MySkinManager.GiveColor('White') 21 | 22 | icon_width = 80 23 | icon_height = 80 24 | icon_ext = ".sh" 25 | 26 | 27 | ICON_TYPES={"Commercial":8,"Emulator":7,"FILE":6,"STAT":5,"NAV":4,"LETTER":3,"FUNC":2,"DIR":1,"EXE":0,"None":-1} # FUNC is like UI widget's function,DIR contains child page,EXE just execute a binary 28 | 29 | ## H=horizontal ,V=vertical S=Single Line 30 | #SLeft start from left, single line 31 | #SCenter star from center ,single line 32 | ALIGN = {"HLeft":0,"HCenter":1,"HRight":2,"VMiddle":3,"SLeft":4,"VCenter":5,"SCenter":6} 33 | 34 | DT = pygame.time.Clock().tick(30) # fps in ms,eg:50 35 | 36 | RUNSH = pygame.USEREVENT+1 37 | #update_titlebar_event = pygame.event.Event(GMEVT, message="titlebar") 38 | RUNEVT = pygame.USEREVENT+2 39 | RUNSYS = pygame.USEREVENT+3 40 | LOWLIGHT = pygame.USEREVENT+4 ## when dim screen backlight 41 | FOOTMSG = pygame.USEREVENT+5 ## 42 | POWEROPT = pygame.USEREVENT+6 43 | RESTARTUI = pygame.USEREVENT+7 ##restart launcher 44 | -------------------------------------------------------------------------------- /sys.py/UI/counter_screen.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | import gobject 5 | import commands 6 | ## local package import 7 | from constants import Width,Height,RUNSYS 8 | from label import Label 9 | 10 | from full_screen import FullScreen 11 | from skin_manager import MySkinManager 12 | from lang_manager import MyLangManager 13 | 14 | import config 15 | 16 | class CounterScreen(FullScreen): 17 | 18 | _CounterFont = MyLangManager.TrFont("varela120") 19 | _TextFont1 = MyLangManager.TrFont("varela15") 20 | _TextFont2 = MyLangManager.TrFont("varela12") 21 | 22 | _TopLabel = None 23 | _BottomLabel = None 24 | _NumberLabel = None 25 | 26 | _BGColor = MySkinManager.GiveColor('Black') 27 | _FGColor = MySkinManager.GiveColor('White') 28 | 29 | _Counting = False 30 | _Number = 10 31 | _GobjectIntervalId = -1 32 | 33 | _inter_counter = 0 34 | 35 | def GObjectInterval(self): 36 | 37 | self._inter_counter+=1 38 | 39 | if self._Number == 0: 40 | self._Counting = False 41 | print("do the real shutdown") 42 | 43 | if config.CurKeySet != "PC": 44 | cmdpath = "feh --bg-center gameshell/wallpaper/seeyou.png;" 45 | cmdpath += "sleep 3;" 46 | cmdpath += "sudo halt -p" 47 | pygame.event.post( pygame.event.Event(RUNSYS, message=cmdpath))\ 48 | 49 | return False 50 | 51 | if self._inter_counter >=2: 52 | self._Number -= 1 53 | if self._Number < 0: 54 | self._Number = 0 55 | print("sub Number %d " % self._Number) 56 | self._inter_counter = 0 57 | 58 | self.Draw() 59 | self.SwapAndShow() 60 | 61 | 62 | 63 | return self._Counting 64 | 65 | def StartCounter(self): 66 | if self._Counting == True: 67 | return 68 | 69 | self._Number = 10 70 | self._Counting = True 71 | 72 | self._GobjectIntervalId = gobject.timeout_add(500,self.GObjectInterval) 73 | 74 | def StopCounter(self): 75 | if self._Counting == False: 76 | return 77 | self._Counting = False 78 | self._Number = 10 79 | self._inter_counter = 0 80 | 81 | if self._GobjectIntervalId != -1: 82 | gobject.source_remove(self._GobjectIntervalId) 83 | self._GobjectIntervalId = -1 84 | 85 | return 86 | 87 | def Init(self): 88 | self._CanvasHWND = pygame.Surface((self._Width,self._Height)) 89 | self._TopLabel = Label() 90 | self._TopLabel.SetCanvasHWND(self._CanvasHWND) 91 | self._TopLabel.Init("System shutdown in", self._TextFont1, self._FGColor) 92 | 93 | self._BottomLabel = Label() 94 | self._BottomLabel.SetCanvasHWND(self._CanvasHWND) 95 | self._BottomLabel.Init("Press any key to stop countdown", self._TextFont2, self._FGColor) 96 | 97 | self._NumberLabel = Label() 98 | self._NumberLabel.SetCanvasHWND(self._CanvasHWND) 99 | self._NumberLabel.Init(str(self._Number), self._CounterFont, self._FGColor) 100 | 101 | def Draw(self): 102 | self._CanvasHWND.fill( self._BGColor ) 103 | 104 | self._TopLabel.NewCoord(Width/2, 15) 105 | self._TopLabel.DrawCenter() 106 | 107 | self._BottomLabel.NewCoord(Width/2, Height-15) 108 | self._BottomLabel.DrawCenter() 109 | 110 | self._NumberLabel.NewCoord(Width/2,Height/2) 111 | self._NumberLabel.SetText(str(self._Number)) 112 | self._NumberLabel.DrawCenter() 113 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /sys.py/UI/createby_screen.py: -------------------------------------------------------------------------------- 1 | import pygame 2 | import os 3 | 4 | from full_screen import FullScreen 5 | from skin_manager import MySkinManager 6 | from constants import Width,Height 7 | 8 | class CreateByScreen(FullScreen): 9 | _BG = None 10 | _BGColor = MySkinManager.GiveColor('Black') 11 | 12 | def Init(self): 13 | basepath = os.path.dirname(os.path.realpath(__file__)) 14 | self._BG = pygame.image.load(basepath+"/egg.png") 15 | self._CanvasHWND = pygame.Surface((self._Width,self._Height)) 16 | 17 | def Draw(self): 18 | self._CanvasHWND.fill( self._BGColor ) 19 | self._CanvasHWND.blit(self._BG,(0,0,Width,Height)) 20 | -------------------------------------------------------------------------------- /sys.py/UI/delete_confirm_page.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | import os 5 | import shutil 6 | 7 | 8 | #UI lib 9 | from constants import Width,Height,ICON_TYPES 10 | from page import Page,PageSelector 11 | from label import Label 12 | from util_funcs import midRect 13 | from keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB 14 | from confirm_page import ConfirmPage 15 | from lang_manager import MyLangManager 16 | 17 | class DeleteConfirmPage(ConfirmPage): 18 | 19 | _FileName = "" 20 | _TrashDir = "" 21 | _ConfirmText = MyLangManager.Tr("ConfirmDeleteQ") 22 | 23 | def SetTrashDir(self,d): 24 | self._TrashDir = d 25 | 26 | if os.path.isdir(self._TrashDir) == False: 27 | raise IOError("Trash not existed") 28 | 29 | def SetFileName(self,fn): 30 | self._FileName = fn 31 | 32 | def KeyDown(self,event): 33 | 34 | if IsKeyMenuOrB(event.key): 35 | 36 | self.ReturnToUpLevelPage() 37 | self._Screen.Draw() 38 | self._Screen.SwapAndShow() 39 | 40 | 41 | if IsKeyStartOrA(event.key): 42 | try: 43 | os.remove(self._TrashDir+"/"+os.path.basename(self._FileName)) 44 | except: 45 | pass 46 | 47 | try: 48 | shutil.move(self._FileName, self._TrashDir) 49 | except shutil.Error as e: 50 | if "already exists" in str(e): 51 | self._Screen._MsgBox.SetText("AlreadyExisted") 52 | else: 53 | self._Screen._MsgBox.SetText("Error") 54 | 55 | self._Screen._MsgBox.Draw() 56 | self._Screen.SwapAndShow() 57 | else: 58 | self.SnapMsg(MyLangManager.Tr("Deleting")) 59 | self._Screen.Draw() 60 | self._Screen.SwapAndShow() 61 | self.Reset() 62 | 63 | pygame.time.delay(300) 64 | self.ReturnToUpLevelPage() 65 | self._Screen.Draw() 66 | self._Screen.SwapAndShow() 67 | 68 | print(self._FileName) 69 | 70 | 71 | -------------------------------------------------------------------------------- /sys.py/UI/egg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/sys.py/UI/egg.png -------------------------------------------------------------------------------- /sys.py/UI/full_screen.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | #from sys import exit 5 | #import os 6 | #import sys 7 | 8 | #from libs import easing 9 | #from datetime import datetime 10 | 11 | #from beeprint import pp 12 | 13 | ## local package import 14 | from constants import Width,Height 15 | 16 | 17 | class FullScreen(object): 18 | _PosX = 0 19 | _PosY = 0 20 | _Width = Width 21 | _Height = Height 22 | _CanvasHWND = None 23 | _HWND = None 24 | 25 | def __init__(self): 26 | pass 27 | 28 | def Init(self): 29 | pass 30 | 31 | def SwapAndShow(self): 32 | if self._HWND != None: 33 | self._HWND.blit(self._CanvasHWND,(self._PosX,self._PosY,self._Width,self._Height)) 34 | pygame.display.update() 35 | 36 | def Draw(self): 37 | pass 38 | 39 | -------------------------------------------------------------------------------- /sys.py/UI/icon_item.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | 5 | ## local import 6 | from constants import icon_width,icon_height,ICON_TYPES,ALIGN,icon_ext,Width,Height 7 | from util_funcs import color_surface,midRect 8 | from label import Label 9 | from lang_manager import MyLangManager 10 | from widget import Widget 11 | class IconItem(Widget): 12 | _ImageName="" 13 | _ImgSurf = None 14 | _Parent = None 15 | _Index = 0 16 | _MyType = ICON_TYPES["EXE"] 17 | _CmdPath = "" 18 | _LinkPage = None 19 | _Label = None 20 | _Align = ALIGN["VCenter"] # set for the Icon Image and Text Label 21 | 22 | def __init__(self): 23 | self._ImgSurf=None 24 | 25 | 26 | def Init(self,x,y,w,h,at): # the Surface is assigned in Screen 27 | self._PosX = x 28 | self._PosY = y 29 | self._Width = w 30 | self._Height = h 31 | self._AnimationTime = at 32 | 33 | def SetLableColor(self,color): 34 | self._Label.SetColor(color) 35 | 36 | def AddLabel(self,text,fontobj): 37 | if self._Label == None: 38 | self._Label = Label() 39 | self._Label.Init(text,fontobj) 40 | else: 41 | #just replace the text 42 | self._Label._Init(text,fontobj) 43 | 44 | def Adjust(self,x,y,w,h,at): # the Surface is assigned in Screen 45 | self.Init(x,y,w,h,at) 46 | 47 | if self._Label != None: 48 | self._Label.SetCanvasHWND( self._Parent._CanvasHWND) 49 | 50 | self.CreateImageSurf() 51 | self.AdjustLinkPage() 52 | 53 | def AdjustLinkPage(self): 54 | if self._MyType==ICON_TYPES["DIR"] and self._LinkPage != None: 55 | self._LinkPage._Index = 0 56 | self._LinkPage._Align = ALIGN["SLeft"] 57 | self._LinkPage._IconNumbers = len(self._LinkPage._Icons) 58 | self._LinkPage._Screen = self._Parent._Screen 59 | self._LinkPage._CanvasHWND = self._Parent._Screen._CanvasHWND 60 | 61 | self._LinkPage._FootMsg = ["Nav","","","Back","Enter"] ## Default Page Foot info 62 | 63 | if self._LinkPage._Align == ALIGN["HLeft"]: 64 | self._LinkPage.AdjustHLeftAlign() 65 | elif self._LinkPage._Align == ALIGN["SLeft"]: 66 | self._LinkPage.AdjustSAutoLeftAlign() 67 | if self._LinkPage._IconNumbers > 1: 68 | self._LinkPage._PsIndex = 1 69 | self._LinkPage._IconIndex = self._LinkPage._PsIndex 70 | 71 | def CreateImageSurf(self): 72 | 73 | if self._ImgSurf == None and self._ImageName != "": 74 | # print(self._ImageName) 75 | self._ImgSurf = pygame.image.load( self._ImageName ).convert_alpha() 76 | if self._ImgSurf.get_width() > icon_width or self._ImgSurf.get_height() > icon_height: 77 | self._ImgSurf = pygame.transform.scale(self._ImgSurf,(icon_width,icon_height)) 78 | 79 | def ChangeImgSurfColor(self,color): 80 | color_surface(self._ImgSurf,color) 81 | 82 | def Clear(self): 83 | pass 84 | 85 | def DrawTopLeft(self): 86 | if self._Align==ALIGN["VCenter"]: #default 87 | if self._Label != None: 88 | self._Label._PosX = self._PosX - self._Label._Width/2 + self._Parent._PosX 89 | self._Label._PosY = self._PosY + self._Height/2 +6 + self._Parent._PosY 90 | 91 | elif self._Align ==ALIGN["HLeft"]: 92 | if self._Label != None: 93 | self._Label._PosX = self._PosX + self._Width/2 + 3 + self._Parent._PosX 94 | self._Label._PosY = self._PosY - self._Label._Height/2 + self._Parent._PosY 95 | 96 | if self._Label!=None: 97 | self._Label.Draw() 98 | 99 | if self._ImgSurf != None: 100 | self._Parent._CanvasHWND.blit(self._ImgSurf,pygame.Rect(self._PosX+self._Parent._PosX, 101 | self._PosY+self._Parent._PosY, 102 | self._Width, 103 | self._Height)) 104 | def Draw(self): 105 | if self._Align==ALIGN["VCenter"]: #default 106 | if self._Label != None: 107 | self._Label._PosX = self._PosX - self._Label._Width/2 + self._Parent._PosX 108 | self._Label._PosY = self._PosY + self._Height/2 +6 + self._Parent._PosY 109 | 110 | elif self._Align ==ALIGN["HLeft"]: 111 | if self._Label != None: 112 | self._Label._PosX = self._PosX + self._Width/2 + 3 + self._Parent._PosX 113 | self._Label._PosY = self._PosY - self._Label._Height/2 + self._Parent._PosY 114 | 115 | if self._Label!=None: 116 | self._Label.Draw() 117 | 118 | if self._ImgSurf != None: 119 | self._Parent._CanvasHWND.blit(self._ImgSurf,midRect(self._PosX+self._Parent._PosX, 120 | self._PosY+self._Parent._PosY, 121 | self._Width,self._Height,Width,Height)) 122 | -------------------------------------------------------------------------------- /sys.py/UI/icon_pool.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | from pygame.locals import * 5 | from sys import exit 6 | import os 7 | import sys 8 | 9 | from skin_manager import MySkinManager 10 | ##pool only store surfaces 11 | 12 | class IconPool(object): 13 | 14 | _GameShellIconPath = MySkinManager.GiveIcon("gameshell/icons/") 15 | _Icons = {} 16 | _Sizes = {} 17 | def __init__(self): 18 | self._Icons= {} 19 | 20 | def Init(self): 21 | 22 | files = os.listdir(self._GameShellIconPath) 23 | for i in files: 24 | if os.path.isfile(self._GameShellIconPath+"/"+i) and i.endswith(".png"): 25 | keyname = i.split(".")[0] 26 | self._Icons[keyname] = pygame.image.load(self._GameShellIconPath+"/"+i).convert_alpha() 27 | self._Sizes[keyname] = self._Icons[keyname].get_size() 28 | 29 | def Width(self,keyname): 30 | if keyname in self._Sizes: 31 | return self._Sizes[keyname][0] 32 | 33 | def Height(self,keyname): 34 | if keyname in self._Sizes: 35 | return self._Sizes[keyname][1] 36 | 37 | ##global Handler 38 | MyIconPool = None 39 | 40 | def InitMyIconPool(): 41 | global MyIconPool 42 | if MyIconPool == None: 43 | MyIconPool = IconPool() 44 | 45 | InitMyIconPool() 46 | 47 | 48 | -------------------------------------------------------------------------------- /sys.py/UI/info_page_list_item.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | from label import Label 5 | from skin_manager import MySkinManager 6 | from widget import Widget 7 | class InfoPageListItem(Widget): 8 | _Height = 30 9 | 10 | _Labels = {} 11 | _Icons = {} 12 | _Fonts = {} 13 | 14 | _LinkObj = None 15 | _ReadOnly = False 16 | 17 | def __init__(self): 18 | self._Labels = {} 19 | self._Icons = {} 20 | self._Fonts = {} 21 | 22 | def SetSmallText(self,text): 23 | 24 | l = Label() 25 | l._PosX = 40 26 | l.SetCanvasHWND(self._Parent._CanvasHWND) 27 | l.Init(text,self._Fonts["small"]) 28 | self._Labels["Small"] = l 29 | 30 | def Init(self,text): 31 | 32 | #self._Fonts["normal"] = fonts["veramono12"] 33 | 34 | l = Label() 35 | l._PosX = 10 36 | l.SetCanvasHWND(self._Parent._CanvasHWND) 37 | 38 | l.Init(text,self._Fonts["normal"]) 39 | self._Labels["Text"] = l 40 | 41 | def Draw(self): 42 | if self._ReadOnly == True: 43 | self._Labels["Text"].SetColor(MySkinManager.GiveColor("ReadOnlyText")) 44 | else: 45 | self._Labels["Text"].SetColor(MySkinManager.GiveColor("Text")) 46 | 47 | 48 | self._Labels["Text"]._PosX = self._Labels["Text"]._PosX + self._PosX 49 | self._Labels["Text"]._PosY = self._PosY + (self._Height - self._Labels["Text"]._Height)/2 50 | self._Labels["Text"].Draw() 51 | self._Labels["Text"]._PosX = self._Labels["Text"]._PosX - self._PosX 52 | 53 | if "Small" in self._Labels: 54 | self._Labels["Small"]._PosX = self._Width - self._Labels["Small"]._Width-5 55 | 56 | self._Labels["Small"]._PosY = self._PosY + (self._Height - self._Labels["Small"]._Height)/2 57 | self._Labels["Small"].Draw() 58 | 59 | pygame.draw.line(self._Parent._CanvasHWND,MySkinManager.GiveColor('Line'),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1) 60 | -------------------------------------------------------------------------------- /sys.py/UI/info_page_selector.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import pygame 3 | 4 | from libs.roundrects import aa_round_rect 5 | ## local UI import 6 | from UI.constants import Width,Height 7 | from UI.page import Page,PageSelector 8 | from UI.skin_manager import MySkinManager 9 | 10 | class InfoPageSelector(PageSelector): 11 | _BackgroundColor = MySkinManager.GiveColor('Front') 12 | 13 | def __init__(self): 14 | self._Width = Width 15 | 16 | def AnimateDraw(self,x2,y2): 17 | pass 18 | 19 | def Draw(self): 20 | idx = self._Parent._PsIndex 21 | if idx < len(self._Parent._MyList): 22 | y = self._Parent._MyList[idx]._PosY+1 23 | h = self._Parent._MyList[idx]._Height -3 24 | 25 | self._PosY = y 26 | self._Height = h 27 | 28 | aa_round_rect(self._Parent._CanvasHWND, 29 | (self._PosX,self._PosY,self._Width-4,self._Height),self._BackgroundColor,4,0,self._BackgroundColor) 30 | -------------------------------------------------------------------------------- /sys.py/UI/keyboard_keys.layout: -------------------------------------------------------------------------------- 1 | 1 2 3 4 5 6 7 8 9 0 2 | q w e r t y u i o p 3 | a s d f g h j k l 4 | _L z x c v b n m _R 5 | 6 | 1 2 3 4 5 6 7 8 9 0 7 | Q W E R T Y U I O P 8 | A S D F G H J K L 9 | _L Z X C V B N M _R 10 | 11 | ! @ # $ % ^ & * ( ) 12 | - _ + = ~ ` [ ] { } 13 | | \ : ; " ' < > , . 14 | _L ? / _R _S 15 | -------------------------------------------------------------------------------- /sys.py/UI/keys_def.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | from pygame.locals import * 5 | from sys import exit 6 | import os 7 | import sys 8 | 9 | 10 | from config import CurKeySet 11 | 12 | 13 | def GetButtonsLayoutMode(): 14 | lm = "xbox" 15 | try: 16 | with open(".buttonslayout", "r") as f: 17 | lm = f.read() 18 | except: 19 | None 20 | if lm not in ["xbox","snes"]: 21 | lm = "xbox" 22 | return lm 23 | 24 | def SetButtonsLayoutMode(mode): 25 | SetXYABButtons(mode) 26 | with open(".buttonslayout", "w") as f: 27 | f.write(mode) 28 | 29 | def SetXYABButtons(mode): 30 | if mode == "snes": 31 | GameShell["Y"] = pygame.K_7 32 | GameShell["X"] = pygame.K_9 33 | GameShell["B"] = pygame.K_8 34 | GameShell["A"] = pygame.K_0 35 | else: 36 | GameShell["X"] = pygame.K_7 37 | GameShell["Y"] = pygame.K_9 38 | GameShell["A"] = pygame.K_8 39 | GameShell["B"] = pygame.K_0 40 | 41 | 42 | GameShell = {} 43 | GameShell["Up"] = pygame.K_UP 44 | GameShell["Down"] = pygame.K_DOWN 45 | GameShell["Left"] = pygame.K_LEFT 46 | GameShell["Right"]= pygame.K_RIGHT 47 | 48 | GameShell["Menu"] = pygame.K_ESCAPE 49 | 50 | SetXYABButtons(GetButtonsLayoutMode()) 51 | 52 | GameShell["Select"] = pygame.K_RSHIFT 53 | GameShell["Start"] = pygame.K_RETURN 54 | 55 | GameShell["LK1"] = pygame.K_h 56 | GameShell["LK5"] = pygame.K_l 57 | 58 | PC = {} 59 | 60 | PC["Up"] = pygame.K_UP 61 | PC["Down"] = pygame.K_DOWN 62 | PC["Left"] = pygame.K_LEFT 63 | PC["Right"] = pygame.K_RIGHT 64 | PC["Menu"] = pygame.K_ESCAPE 65 | 66 | PC["X"] = pygame.K_7 67 | PC["Y"] = pygame.K_9 68 | PC["A"] = pygame.K_8 69 | PC["B"] = pygame.K_0 70 | PC["Select"] = pygame.K_RSHIFT 71 | PC["Start"] = pygame.K_RETURN 72 | 73 | PC["LK1"] = pygame.K_h 74 | PC["LK5"] = pygame.K_l 75 | 76 | if CurKeySet == "PC": 77 | CurKeys = PC 78 | else: 79 | CurKeys = GameShell 80 | 81 | 82 | def IsKeyStartOrA(key): 83 | return key == CurKeys["Start"] or key == CurKeys["A"] 84 | 85 | def IsKeyMenuOrB(key): 86 | return key == CurKeys["Menu"] or key == CurKeys["B"] 87 | -------------------------------------------------------------------------------- /sys.py/UI/label.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | 5 | #import base64 6 | #from beeprint import pp 7 | from constants import Width,Height 8 | from util_funcs import midRect 9 | 10 | #UI lib 11 | from skin_manager import MySkinManager 12 | from lang_manager import MyLangManager 13 | from widget import Widget 14 | class Label(Widget): 15 | _Text="" 16 | _FontObj=None 17 | _Color = MySkinManager.GiveColor('Text') 18 | _CanvasHWND = None 19 | _TextSurf = None 20 | def __init__(self): 21 | pass 22 | 23 | def Init(self, text, font_obj, color=MySkinManager.GiveColor('Text')): 24 | self._Color = color 25 | self._FontObj = font_obj 26 | self._Text = text 27 | 28 | my_text = self._FontObj.render(self._Text,True,self._Color) 29 | self._Width = my_text.get_width() 30 | self._Height = my_text.get_height() 31 | 32 | def SetColor(self,color): 33 | self._Color = color 34 | 35 | def GetText(self): 36 | return self._Text 37 | 38 | def SetText(self,text): 39 | self._Text = text 40 | 41 | my_text = self._FontObj.render(self._Text,True,self._Color) 42 | self._Width = my_text.get_width() 43 | self._Height = my_text.get_height() 44 | 45 | 46 | def SetCanvasHWND(self,_canvashwnd): 47 | self._CanvasHWND = _canvashwnd 48 | 49 | def DrawCenter(self,bold=False): 50 | self._FontObj.set_bold(bold) ## avoing same font tangling set_bold to others 51 | my_text = self._FontObj.render( self._Text,True,self._Color) 52 | self._CanvasHWND.blit(my_text,midRect(self._PosX,self._PosY,self._Width,self._Height,Width,Height)) 53 | 54 | def Draw(self,bold=False): 55 | self._FontObj.set_bold(bold) ## avoing same font tangling set_bold to others 56 | my_text = self._FontObj.render( self._Text,True,self._Color) 57 | 58 | self._CanvasHWND.blit(my_text,(self._PosX,self._PosY,self._Width,self._Height)) 59 | -------------------------------------------------------------------------------- /sys.py/UI/lang_manager.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import os 3 | import pygame 4 | import config 5 | import ConfigParser 6 | from skin_manager import MySkinManager 7 | from util_funcs import FileExists 8 | 9 | class CaseConfigParser(ConfigParser.SafeConfigParser): 10 | def optionxform(self, optionstr): 11 | return optionstr 12 | 13 | class LangManager(object): 14 | """ 15 | """ 16 | 17 | _Langs = {} 18 | _Config = None 19 | _ConfigFileName = "00_English.ini" ## double % to escape 20 | _CJKMode = False 21 | 22 | def __init__(self): 23 | self.Init() 24 | 25 | def Init(self): 26 | if not self._Langs: 27 | self.SetLangs() 28 | 29 | def UpdateLang(self): 30 | self._Langs = {} 31 | self.SetLangs() 32 | 33 | def IsCJKMode(self):## in MultiLabel, latins seped by white spaces,CJK no needs for that 34 | latins = ["English"] 35 | self._CJKMode = True 36 | 37 | for i in latins: 38 | if i in self._ConfigFileName: 39 | self._CJKMode= False 40 | break 41 | 42 | return self._CJKMode 43 | 44 | def SetLangs(self): 45 | self._Config = CaseConfigParser() 46 | #print("SetLangs") 47 | fname = ".lang" 48 | 49 | try: 50 | with open(fname, "r") as f: 51 | self._ConfigFileName = f.read() 52 | self._ConfigFileName = self._ConfigFileName.strip("\r\n ") 53 | #print(self._ConfigFileName) 54 | except: 55 | os.system("touch .lang") 56 | print("read lang failed") 57 | None 58 | 59 | 60 | if self._ConfigFileName == "" or FileExists("langs/"+self._ConfigFileName) == False: 61 | #print("miss file") 62 | self._ConfigFileName = "00_English.ini" 63 | else: 64 | pass 65 | #print("has file",self._ConfigFileName) 66 | 67 | 68 | try: 69 | self._Config.read("langs/"+self._ConfigFileName) 70 | except Exception, e: 71 | print("read lang ini error %s" % str(e)) 72 | return 73 | else: 74 | if "Langs" in self._Config.sections(): 75 | lang_opts = self._Config.options("Langs") 76 | for i in lang_opts: 77 | try: 78 | self._Langs[i] = self._Config.get("Langs", i) 79 | except Exception, e: 80 | print("error %s" % str(e)) 81 | continue 82 | 83 | def Tr(self,english_key_str): 84 | #print("english_key_str", english_key_str) 85 | if english_key_str in self._Langs: 86 | #print( self._Langs[english_key_str] ) 87 | return self._Langs[english_key_str].decode("utf8") 88 | else: 89 | return english_key_str 90 | 91 | def TrFont(self,orig_font_str): 92 | try: 93 | font_size_number = int(filter(str.isdigit, orig_font_str)) 94 | except TypeError: 95 | font_size_number = int(filter(unicode.isdigit, orig_font_str)) 96 | if font_size_number > 120: 97 | raise Exception('font string format error') 98 | 99 | if "English.ini" in self._ConfigFileName: 100 | return MySkinManager.GiveFont(orig_font_str) 101 | else: 102 | if font_size_number > 28: 103 | # raise Exception('cjk font string format error '+ str(font_size_number)) 104 | return MySkinManager.GiveFont(orig_font_str) 105 | else: 106 | return MySkinManager.GiveFont("notosanscjk%d" % font_size_number) 107 | 108 | ##global MyLangManager Handler 109 | MyLangManager = None 110 | 111 | def InitMyLangManager(): 112 | global MyLangManager 113 | if MyLangManager == None: 114 | MyLangManager = LangManager() 115 | 116 | 117 | InitMyLangManager() 118 | -------------------------------------------------------------------------------- /sys.py/UI/multi_icon_item.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | #from beeprint import pp 5 | 6 | ## local import 7 | from constants import icon_width,icon_height,ICON_TYPES,ALIGN,icon_ext,Width,Height 8 | from util_funcs import color_surface,midRect 9 | from label import Label 10 | from icon_item import IconItem 11 | 12 | ##Resource file contains multi icons in single image 13 | ##usually the Image contains icons in Vertical, convert 1.png 2.png 3.png -append out.png 14 | 15 | class MultiIconItem(IconItem): 16 | _IconWidth=18 17 | _IconHeight=18 18 | _IconIndex = 0 # icon index on the resource Image 19 | 20 | def CreateImageSurf(self): 21 | if self._ImgSurf == None and self._ImageName != "": 22 | # print(self._ImageName) 23 | self._ImgSurf = pygame.image.load( self._ImageName ).convert_alpha() 24 | 25 | 26 | def DrawTopLeft(self): 27 | if self._Align==ALIGN["VCenter"]: #default 28 | if self._Label != None: 29 | self._Label._PosX = self._PosX - self._Label._Width/2 + self._Parent._PosX 30 | self._Label._PosY = self._PosY + self._Height/2 +6 + self._Parent._PosY 31 | 32 | elif self._Align ==ALIGN["HLeft"]: 33 | if self._Label != None: 34 | self._Label._PosX = self._PosX + self._Width/2 + 3 + self._Parent._PosX 35 | self._Label._PosY = self._PosY - self._Label._Height/2 + self._Parent._PosY 36 | 37 | if self._Label!=None: 38 | self._Label.Draw() 39 | 40 | 41 | if self._ImgSurf != None: 42 | self._Parent._CanvasHWND.blit(self._ImgSurf,pygame.Rect(self._PosX+self._Parent._PosX, 43 | self._PosY+self._Parent._PosY, 44 | self._Width,self._Height), 45 | (0,self._IconIndex*self._IconHeight,self._IconWidth,self._IconHeight)) 46 | 47 | def Draw(self): 48 | if self._Align==ALIGN["VCenter"]: #default 49 | if self._Label != None: 50 | self._Label._PosX = self._PosX - self._Label._Width/2 + self._Parent._PosX 51 | self._Label._PosY = self._PosY + self._Height/2 +6 + self._Parent._PosY 52 | 53 | elif self._Align ==ALIGN["HLeft"]: 54 | if self._Label != None: 55 | self._Label._PosX = self._PosX + self._Width/2 + 3 + self._Parent._PosX 56 | self._Label._PosY = self._PosY - self._Label._Height/2 + self._Parent._PosY 57 | 58 | if self._Label!=None: 59 | self._Label.Draw() 60 | 61 | 62 | if self._ImgSurf != None: 63 | self._Parent._CanvasHWND.blit(self._ImgSurf,midRect(self._PosX+self._Parent._PosX, 64 | self._PosY+self._Parent._PosY, 65 | self._Width,self._Height,Width,Height), 66 | (0,self._IconIndex*self._IconHeight,self._IconWidth,self._IconHeight)) 67 | 68 | -------------------------------------------------------------------------------- /sys.py/UI/multilabel.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | 5 | from skin_manager import MySkinManager 6 | from lang_manager import MyLangManager 7 | from widget import Widget 8 | 9 | class MultiLabel(Widget): ##Multi Line Label 10 | _Width=135 11 | _Height=100 12 | _Text="" 13 | _FontObj=None 14 | _Color = MySkinManager.GiveColor('Text') 15 | _CanvasHWND = None 16 | _TextSurf = None 17 | _MaxWidth = 0 18 | 19 | def __init__(self): 20 | pass 21 | 22 | def Init(self,text,font_obj,color=MySkinManager.GiveColor('Text')): 23 | self._Color = color 24 | self._FontObj = font_obj 25 | self._Text = text 26 | 27 | self.blit_text(self._CanvasHWND,self._Text,(self._PosX,self._PosY),self._FontObj) 28 | 29 | 30 | def SetColor(self,color): 31 | self._Color = color 32 | 33 | def GetText(self): 34 | return self._Text 35 | 36 | def SetText(self,text): 37 | self._Text = text 38 | 39 | self.blit_text(self._CanvasHWND,self._Text,(self._PosX,self._PosY),self._FontObj) 40 | 41 | def SetCanvasHWND(self,_canvashwnd): 42 | self._CanvasHWND = _canvashwnd 43 | 44 | def blit_text(self, surface,text, pos, font): 45 | iscjk = MyLangManager.IsCJKMode() 46 | 47 | color = self._Color 48 | words = [word.split(' ') for word in text.splitlines()] 49 | space = font.size(' ')[0] 50 | 51 | if iscjk: 52 | space = 0 53 | words = [list(word.decode("utf8")) for word in text.splitlines()] 54 | 55 | max_width = self._Width 56 | x ,y = pos 57 | row_total_width = 0 58 | lines = 0 59 | line_max = 12 60 | row_max = 4 61 | if iscjk: 62 | line_max = line_max*2 63 | 64 | for i,line in enumerate(words[:row_max]): 65 | for word in line[:line_max]: 66 | word_surface = font.render(word, True, color) 67 | word_width = word_surface.get_width() 68 | word_height = word_surface.get_height() 69 | row_total_width += word_width 70 | if row_total_width+space >= max_width: 71 | x = pos[0] # Reset the x. 72 | y += word_height # Start on new row. 73 | row_total_width = word_width 74 | 75 | if lines == 0: 76 | lines += word_height 77 | else: 78 | lines += word_height 79 | 80 | surface.blit(word_surface, (x, y)) 81 | x += word_width + space 82 | x = pos[0] # Reset the x. 83 | y += word_height # Start on new row. 84 | lines += word_height 85 | self._Height = lines 86 | 87 | 88 | def Draw(self): 89 | #my_text = self._FontObj.render( self._Text,True,self._Color) 90 | self.blit_text(self._CanvasHWND,self._Text,(self._PosX,self._PosY),self._FontObj) 91 | #pygame.draw.rect(self._CanvasHWND,(83,83,83), (self._PosX,self._PosY,self._Width,self._Height) , 1 ) 92 | #self._CanvasHWND.blit(my_text,(self._PosX,self._PosY,self._Width,self._Height)) 93 | -------------------------------------------------------------------------------- /sys.py/UI/scroller.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import pygame 3 | 4 | from util_funcs import midRect 5 | 6 | from libs.roundrects import aa_round_rect 7 | 8 | from skin_manager import MySkinManager 9 | 10 | class ListScroller(object): 11 | _PosX = 0 12 | _PosY = 0 13 | _Width = 7 14 | _Height = 0 15 | _MinHeight = 6 ## tested 16 | _Parent = None 17 | _Color = MySkinManager.GiveColor('Front') 18 | 19 | _StartX = 0 20 | _StartY = 0 21 | _EndX = 0 22 | _EndY = 0 23 | _Value = 0 24 | _CanvasHWND = None 25 | 26 | def __init__(self): 27 | pass 28 | 29 | def Init(self): 30 | self.SetCanvasHWND(self._Parent._CanvasHWND) 31 | 32 | def SetCanvasHWND(self,canvas): 33 | self._CanvasHWND = canvas 34 | 35 | def AnimateDraw(self,x2,y2): 36 | pass 37 | 38 | def UpdateSize(self,bigheight,dirtyheight): 39 | bodyheight = float(self._Parent._Height) / float(bigheight) 40 | if bodyheight > 1: 41 | bodyheight = 1 ## 100% 42 | 43 | margin = 4 44 | self._Height = bodyheight * self._Parent._Height - margin ## Draw body 45 | 46 | if self._Height < self._MinHeight: 47 | self._Height = self._MinHeight 48 | 49 | self._StartX = self._Width/2 50 | self._StartY = margin/2+self._Height/2 51 | 52 | self._EndX = self._Width/2 53 | self._EndY = self._Parent._Height - margin/2 - self._Height/2 54 | 55 | process = float(dirtyheight) / float(bigheight) 56 | value = process* (self._EndY - self._StartY) 57 | 58 | self._Value = int(value) 59 | 60 | def Draw(self): 61 | 62 | start_rect = midRect(self._PosX+self._StartX,self._StartY+self._Value,self._Width,self._Height,self._Parent._Width,self._Parent._Height) 63 | aa_round_rect(self._CanvasHWND,start_rect, self._Color,3,0, self._Color) 64 | -------------------------------------------------------------------------------- /sys.py/UI/simple_name_space.py: -------------------------------------------------------------------------------- 1 | 2 | class SimpleNamespace: 3 | def __init__(self, **kwargs): 4 | self.__dict__.update(kwargs) 5 | 6 | def __repr__(self): 7 | keys = sorted(self.__dict__) 8 | items = ("{}={!r}".format(k, self.__dict__[k]) for k in keys) 9 | return "{}({})".format(type(self).__name__, ", ".join(items)) 10 | 11 | def __eq__(self, other): 12 | return self.__dict__ == other.__dict__ 13 | -------------------------------------------------------------------------------- /sys.py/UI/skin_manager.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | import config 5 | import ConfigParser 6 | 7 | from util_funcs import FileExists 8 | 9 | class CaseConfigParser(ConfigParser.SafeConfigParser): 10 | def optionxform(self, optionstr): 11 | return optionstr 12 | 13 | class SkinManager(object): 14 | """ 15 | _HighColor = pygame.Color(51,166,255) # #33a6ff 16 | _TextColor = pygame.Color(83,83,83) # #535353 17 | _FrontColor = pygame.Color(131,199,219) ## light blue,#83c7db 18 | _URLColor = pygame.Color(51,166,255) ## blue more #33a6ff 19 | _LineColor = pygame.Color(169,169,169) # #a9a9a9 20 | _TitleBgColor = pygame.Color(228,228,228) # #e4e4e4 21 | _ActiveColor = pygame.Color(175,90,0) ## light brown #af5a00 22 | """ 23 | 24 | _Colors = {} 25 | _Config = None 26 | _Fonts = {} 27 | DefaultSkin = "../skin/default" 28 | 29 | def __init__(self): 30 | self.Init() 31 | 32 | def ConvertToRGB(self,hexstr): 33 | 34 | h = hexstr.lstrip('#') 35 | return tuple(int(h[i:i+2], 16) for i in (0, 2 ,4)) 36 | 37 | def Init(self): 38 | if not SkinManager._Colors: 39 | self.SetColors() 40 | if not SkinManager._Fonts: 41 | self.SetFonts() 42 | 43 | def SetFonts(self): 44 | if not pygame.font.get_init(): 45 | pygame.font.init() 46 | 47 | skinpath = config.SKIN+"/truetype" 48 | fonts_path = {} 49 | fonts_path["varela"] = "%s/VarelaRound-Regular.ttf" % skinpath 50 | print(fonts_path["varela"]) 51 | fonts_path["veramono"] = "%s/VeraMono.ttf" % skinpath 52 | fonts_path["noto"] = "%s/NotoSansMono-Regular.ttf" % skinpath 53 | fonts_path["notocjk"] = "%s/NotoSansCJK-Regular.ttf" % skinpath 54 | 55 | for i in range(10,29): 56 | self._Fonts["varela%d"%i] = pygame.font.Font(fonts_path["varela"],i) 57 | 58 | self._Fonts["varela34"] = pygame.font.Font(fonts_path["varela"],34) 59 | self._Fonts["varela40"] = pygame.font.Font(fonts_path["varela"],40) 60 | self._Fonts["varela120"] = pygame.font.Font(fonts_path["varela"],120) 61 | 62 | for i in range(10,26): 63 | self._Fonts["veramono%d"%i] = pygame.font.Font(fonts_path["veramono"],i) 64 | 65 | for i in range(10,28): 66 | self._Fonts["notosansmono%d"%i] = pygame.font.Font(fonts_path["noto"],i) 67 | 68 | for i in range(10,28): 69 | self._Fonts["notosanscjk%d"%i] = pygame.font.Font(fonts_path["notocjk"],i) 70 | 71 | self._Fonts["arial"] = pygame.font.SysFont("arial",16) 72 | 73 | def SetColors(self): 74 | Colors = {} 75 | Colors["High"] = pygame.Color(51, 166, 255) 76 | Colors["Text"] = pygame.Color(83, 83, 83) 77 | Colors["ReadOnlyText"] = pygame.Color(130,130,130) 78 | Colors["Front"] = pygame.Color(131, 199, 219) 79 | Colors["URL"] = pygame.Color(51, 166, 255) 80 | Colors["Line"] = pygame.Color(169, 169, 169) 81 | Colors["TitleBg"] = pygame.Color(228, 228, 228) 82 | Colors["Active"] = pygame.Color(175, 90, 0) 83 | Colors["Disabled"] = pygame.Color(204, 204, 204) 84 | Colors["White"] = pygame.Color(255, 255, 255) 85 | Colors["Black"] = pygame.Color(0, 0, 0) 86 | 87 | 88 | Colors["UI_Base"] = pygame.Color(255,255,255) 89 | Colors["UI_Background"] = pygame.Color(100, 100, 100) 90 | Colors["UI_Foreground"] = pygame.Color(0, 0, 0) 91 | 92 | SkinManager._Colors = Colors 93 | 94 | self._Config = CaseConfigParser() 95 | 96 | fname = config.SKIN+"/config.ini" 97 | 98 | try: 99 | self._Config.read(fname) 100 | except Exception, e: 101 | print("read skin config.ini error %s" % str(e)) 102 | return 103 | else: 104 | if "Colors" in self._Config.sections(): 105 | colour_opts = self._Config.options("Colors") 106 | # print(colour_opts) 107 | for i in SkinManager._Colors: 108 | if i in colour_opts: 109 | try: 110 | SkinManager._Colors[i] = self.ConvertToRGB( 111 | self._Config.get("Colors", i)) 112 | except Exception, e: 113 | print("error in ConvertToRGB %s" % str(e)) 114 | continue 115 | 116 | def GiveFont(self,name): 117 | return SkinManager._Fonts[name] 118 | 119 | def GiveColor(self,name): 120 | if name in SkinManager._Colors: 121 | return SkinManager._Colors[name] 122 | else: 123 | return pygame.Color(255,0,0) 124 | 125 | def GiveIcon(self,orig_file_or_dir): 126 | #doing a wrapper for items under /home/chip/apps/Menu/*, to be like Menu/GameShell/* 127 | if orig_file_or_dir.startswith("/home/chip/apps/Menu"): 128 | orig_file_or_dir = orig_file_or_dir.replace("/home/chip/apps/Menu/","../Menu/GameShell/") 129 | 130 | if orig_file_or_dir.startswith(".."): 131 | ret = orig_file_or_dir.replace("..",config.SKIN) 132 | if FileExists(ret) == False: 133 | ret = orig_file_or_dir.replace("..",self.DefaultSkin) 134 | else: 135 | ret = config.SKIN+"/sys.py/"+orig_file_or_dir 136 | if FileExists(ret) == False: 137 | ret = self.DefaultSkin+"/sys.py/"+orig_file_or_dir 138 | 139 | if FileExists( ret ): 140 | return ret 141 | else: ## if not existed both in default or custom skin ,return where it is 142 | return orig_file_or_dir 143 | 144 | ##global MySkinManager Handler 145 | MySkinManager = None 146 | 147 | def InitMySkinManager(): 148 | global MySkinManager 149 | if MySkinManager == None: 150 | MySkinManager = SkinManager() 151 | 152 | 153 | InitMySkinManager() 154 | 155 | 156 | -------------------------------------------------------------------------------- /sys.py/UI/slider.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | class Slider(object): 4 | _PosX = 0 5 | _PosY = 0 6 | _Width = 0 7 | _Height = 0 8 | 9 | _Value = 0 10 | _CanvasHWND = None 11 | 12 | _Range = [] 13 | 14 | def __init__(self): 15 | self._Range = [0,255] 16 | 17 | def Init(self): 18 | self._Value = 0 19 | 20 | def SetValue(self,v): 21 | self._Value = int(v) 22 | 23 | def SetRange(self,m1,m2): 24 | if m1 >= m2: 25 | return 26 | 27 | self._Range[0] = m1 28 | self._Range[1] = m2 29 | 30 | 31 | def SetCanvasHWND(self,cav): 32 | self._CanvasHWND = cav 33 | 34 | def KeyDown(self): 35 | pass 36 | 37 | def Draw(self): 38 | pass 39 | 40 | 41 | -------------------------------------------------------------------------------- /sys.py/UI/text_item.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | #local import 3 | from UI.constants import Width,Height,ICON_TYPES 4 | from UI.icon_item import IconItem 5 | from UI.util_funcs import midRect 6 | from UI.skin_manager import MySkinManager 7 | 8 | class TextItem(IconItem): 9 | _PosX = 0 10 | _PosY = 0 11 | _Width = 0 12 | _Height = 0 13 | _Str = "" 14 | _Color = MySkinManager.GiveColor('Text') 15 | _FontObj = None 16 | _Bold = False 17 | _MyType = ICON_TYPES["LETTER"] 18 | _Parent = None 19 | 20 | def Draw(self): 21 | self._FontObj.set_bold(self._Bold) 22 | my_text = self._FontObj.render(self._Str,True,self._Color) 23 | if my_text.get_width() != self._Width: 24 | self._Width = my_text.get_width() 25 | if my_text.get_height() != self._Height: 26 | self._Height = my_text.get_height() 27 | 28 | self._Parent._CanvasHWND.blit(my_text, \ 29 | midRect(self._PosX,self._PosY,self._Width,self._Height,Width,Height)) 30 | -------------------------------------------------------------------------------- /sys.py/UI/textarea.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | from libs.roundrects import aa_round_rect 5 | 6 | ## local UI import 7 | from UI.page import Page,PageStack,PageSelector 8 | from UI.label import Label 9 | from UI.skin_manager import MySkinManager 10 | from UI.lang_manager import MyLangManager 11 | from UI.widget import Widget 12 | 13 | class Textarea(Widget): 14 | _BackgroundColor = MySkinManager.GiveColor('TitleBg') 15 | _CanvasHWND = None 16 | _MyWords = [] 17 | _BlitWords = [] 18 | _FontObj = None 19 | _LineNumber = 0 20 | _TextLimit = 63 21 | _TextFull = False 22 | _TextIndex = 0 23 | _BlitIndex = 0 24 | 25 | def __init__(self): 26 | pass 27 | 28 | def Init(self): 29 | self._FontObj = MyLangManager.TrFont("veramono24") 30 | #pygame.font.Font(fonts_path["veramono"],24) 31 | 32 | def SubTextIndex(self): 33 | 34 | self._TextIndex-=1 35 | if self._TextIndex < 0: 36 | self._TextIndex = 0 37 | 38 | def AddTextIndex(self): 39 | self._TextIndex +=1 40 | if self._TextIndex > len(self._MyWords): 41 | self._TextIndex = len(self._MyWords) 42 | 43 | def ResetMyWords(self): 44 | self._MyWords = [] 45 | self._TextIndex = 0 46 | 47 | def RemoveFromLastText(self): 48 | if len(self._MyWords) > 0: 49 | self.SubTextIndex() 50 | 51 | del self._MyWords[self._TextIndex] 52 | 53 | return self._MyWords 54 | 55 | def AppendText(self,alphabet): 56 | 57 | self.AppendAndBlitText(alphabet) 58 | 59 | def AppendAndBlitText(self,alphabet): 60 | 61 | if self._TextFull != True: 62 | 63 | self._MyWords.insert(self._TextIndex,alphabet) 64 | self.BlitText() 65 | self.AddTextIndex() 66 | else: 67 | print("is Full %s" % "".join(str(self._MyWords))) 68 | 69 | def BuildBlitText(self): 70 | blit_rows = [[]] 71 | w = 0 72 | xmargin = 5 73 | endmargin = 15 74 | x = self._PosX+xmargin 75 | linenumber = 0 76 | cursor_row = 0 77 | 78 | for i, v in enumerate(self._MyWords): 79 | t = self._FontObj.render(v, True, (8, 135, 174)) 80 | t_width = t.get_width() 81 | w += t_width 82 | del(t) 83 | 84 | blit_rows[linenumber].append(v) 85 | 86 | if i == self._TextIndex - 1: 87 | cursor_row = linenumber 88 | 89 | if w + t_width >= self._Width-endmargin: 90 | x = self._PosX+xmargin 91 | w = 0 92 | linenumber += 1 93 | blit_rows.append([]) 94 | 95 | # only paint 2 rows 96 | if len(blit_rows) == 1: 97 | self._BlitWords = blit_rows[0] 98 | self._BlitIndex = self._TextIndex 99 | elif len(blit_rows) == 2 or cursor_row < 2: 100 | self._BlitWords = blit_rows[0] + blit_rows[1] 101 | self._BlitIndex = self._TextIndex 102 | else: 103 | self._BlitWords = blit_rows[cursor_row - 1] + blit_rows[cursor_row] 104 | self._BlitIndex = self._TextIndex 105 | for i,v in enumerate(blit_rows): 106 | if i == cursor_row - 1: 107 | break 108 | self._BlitIndex -= len(v) 109 | 110 | def BlitText(self): 111 | """ 112 | blit every single word into surface and calc the width ,check multi line 113 | """ 114 | # build up blitwords 115 | self.BuildBlitText() 116 | 117 | w = 0 118 | xmargin = 5 119 | endmargin = 15 120 | x = self._PosX+xmargin 121 | y = self._PosY 122 | linenumber = 0 123 | self._TextFull = len(self._MyWords) > self._TextLimit 124 | for i, v in enumerate(self._BlitWords): 125 | t = self._FontObj.render(v,True,(8,135,174)) 126 | w += t.get_width() 127 | 128 | if w >= self._Width-endmargin and linenumber == 0: 129 | linenumber +=1 130 | x = self._PosX+xmargin 131 | y = self._PosY + t.get_height() * linenumber 132 | w = 0 133 | 134 | self._CanvasHWND.blit(t, (x,y)) 135 | x += t.get_width() 136 | 137 | def Cursor(self): 138 | w = 0 139 | xmargin = 5 140 | endmargin = 15 141 | x = self._PosX+xmargin 142 | y = self._PosY 143 | linenumber = 0 144 | for i,v in enumerate(self._BlitWords[:self._BlitIndex]): 145 | t = self._FontObj.render(v,True,(8,135,174)) 146 | w += t.get_width() 147 | 148 | if w >= self._Width-endmargin and linenumber == 0: 149 | x = self._PosX+xmargin 150 | y = self._PosY+ t.get_height() 151 | w = 0 152 | linenumber +=1 153 | 154 | if w >= self._Width-endmargin*3 and linenumber > 0: 155 | x += t.get_width() 156 | break 157 | x += t.get_width() 158 | 159 | self._CanvasHWND.blit(self._FontObj.render("_",True,(0,0,0)),(x+1,y-2)) 160 | 161 | def Draw(self): 162 | #aa_round_rect(self._CanvasHWND, (4,24.5+6,312,60),self._BackgroundColor,4,0,self._BackgroundColor) 163 | 164 | aa_round_rect(self._CanvasHWND, 165 | (self._PosX,self._PosY,self._Width,self._Height),self._BackgroundColor,4,0,self._BackgroundColor) 166 | 167 | 168 | 169 | self.BlitText() 170 | self.Cursor() 171 | -------------------------------------------------------------------------------- /sys.py/UI/untitled_icon.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | from pygame.locals import * 5 | from sys import exit 6 | import os 7 | import sys 8 | 9 | from datetime import datetime 10 | 11 | import base64 12 | from beeprint import pp 13 | 14 | from util_funcs import midRect 15 | 16 | from skin_manager import MySkinManager 17 | 18 | BlankPng = MySkinManager.GiveIcon("gameshell/blank.png") # 80x80 19 | ## use blank circle as bg, Two alpha As Icon Label 20 | #Upper and Lower 21 | 22 | 23 | class UntitledIcon(object): 24 | _PosX = 0 25 | _PosY = 0 26 | _Width = 80 27 | _Height = 80 28 | 29 | _Words = ["G", "s"] 30 | _FontObj = MySkinManager.GiveFont("varela40") 31 | 32 | _BG = None # initial surface 33 | 34 | _Color = MySkinManager.GiveColor('Text') 35 | 36 | def __init__(self): 37 | self._Words = ["G", "s"] 38 | 39 | def Init(self): 40 | self._BG = pygame.image.load(BlankPng).convert_alpha() 41 | 42 | def SetWords(self, TwoWords): 43 | if len(TwoWords) == 1: 44 | self._Words[0] = TwoWords[0].upper() 45 | 46 | if len(TwoWords) == 2: 47 | self._Words[0] = TwoWords[0].upper() 48 | self._Words[1] = TwoWords[1].lower() 49 | 50 | self._Text = self._FontObj.render("".join(self._Words),True,self._Color) 51 | 52 | def Draw(self): 53 | if self._BG != None: 54 | w_ = self._Text.get_width() 55 | h_ = self._Text.get_height() 56 | 57 | self._BG.blit(self._Text,midRect(self._Width/2,self._Height/2,w_,h_,self._Width,self._Height)) 58 | 59 | def Surface(self): 60 | self.Draw() 61 | 62 | return self._BG 63 | 64 | 65 | -------------------------------------------------------------------------------- /sys.py/UI/util_funcs.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import pygame 4 | import os 5 | import subprocess 6 | 7 | #from libs import easing 8 | #from datetime import datetime 9 | 10 | #import base64 11 | #from beeprint import pp 12 | import string 13 | from Xlib import X,display 14 | import config 15 | 16 | def get_git_revision_hash(): 17 | return subprocess.check_output(['git', 'rev-parse', 'HEAD']) 18 | 19 | def get_git_revision_short_hash(): 20 | return subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']) 21 | 22 | 23 | def X_center_mouse(): 24 | d = display.Display() 25 | s = d.screen() 26 | root = s.root 27 | width = s.width_in_pixels 28 | height = s.height_in_pixels 29 | # print(width,height) 30 | root.warp_pointer(width/2,height/2) 31 | 32 | d.sync() 33 | 34 | 35 | def IsPythonPackage(self,dirname): 36 | files = os.listdir(dirname) 37 | for i in sorted(files): 38 | if i.endswith("__init__.py"): 39 | return True 40 | return False 41 | 42 | def IsExecutable(fpath): 43 | return os.path.isfile(fpath) and os.access(fpath, os.X_OK) 44 | 45 | def MakeExecutable(path): 46 | mode = os.stat(path).st_mode 47 | mode |= (mode & 0o444) >> 2 # copy R bits to X 48 | os.chmod(path, mode) 49 | 50 | def GetExePath():# get self dir 51 | #dir_path = os.path.dirname(os.path.realpath(__file__)) 52 | dir_path = os.getcwd() 53 | return dir_path 54 | 55 | def CmdClean(cmdpath):#escape spec chars 56 | spchars = "\\`$();|{}&'\"*?<>[]!^~-#\n\r " 57 | for i in spchars: 58 | cmdpath = string.replace(cmdpath,i,"\\"+i) 59 | 60 | return cmdpath 61 | 62 | def ReplaceSuffix(orig_file_str,new_ext): 63 | filename,ext = os.path.splitext(orig_file_str) 64 | ext = ext.strip() 65 | if ext != "": 66 | return "%s.%s"%(filename,new_ext) 67 | 68 | def FileExists(name): # both file and dir checked 69 | return os.path.exists(name) 70 | 71 | 72 | def ReadTheFileContent(filename): 73 | data = "" 74 | with open(filename, 'r') as myfile: 75 | data = myfile.read() 76 | return data 77 | 78 | def midRect(x,y,width,height,canWidth,canHeight): 79 | return pygame.Rect(min(canWidth,x-width/2),min(canHeight,y-height/2),width,height) 80 | 81 | #surface color change 82 | def color_surface(surface, color): 83 | red = color.r 84 | green = color.g 85 | blue = color.b 86 | arr = pygame.surfarray.pixels3d(surface) 87 | arr[:,:,0] = red 88 | arr[:,:,1] = green 89 | arr[:,:,2] = blue 90 | 91 | 92 | def DrawText(canvas,text, x,y,width,height,canWidth,canHeight,fontObj):# text for content,fontObj for pygame.font.Font 93 | _w = 0 94 | _tp = len(text) 95 | 96 | for idx,t in enumerate(fontObj.metrics(text)): 97 | _w = _w + t[1] - t[0] 98 | if _w > icon_width: 99 | _tp = idx 100 | break 101 | width = _w #recalc the width of text 102 | if width > icon_width: ##Label width max is icon width 103 | width = icon_width 104 | 105 | if _tp < len(text):##cut the text to fit width 106 | text = text[0:_tp] 107 | 108 | canvas.blit(fontObj.render(text,True,(83,83,83)),midRect(x,y,width,height,canWidth,canHeight)) 109 | 110 | 111 | def SwapAndShow(): 112 | pygame.display.update() 113 | -------------------------------------------------------------------------------- /sys.py/UI/widget.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | class Widget: 4 | _PosX =0 5 | _PosY = 0 6 | _Width = 0 7 | _Height = 0 8 | 9 | def __init__(self): 10 | pass 11 | 12 | def NewCoord(self,x,y): 13 | self._PosX = x 14 | self._PosY = y 15 | 16 | def Coord(self): 17 | return self._PosX,self._PosY 18 | 19 | def Width(self): 20 | return self._Width 21 | 22 | def Height(self): 23 | return self._Height 24 | 25 | def Size(self): 26 | return self._Width,self._Height 27 | -------------------------------------------------------------------------------- /sys.py/battery.py: -------------------------------------------------------------------------------- 1 | # Provides an abstraction to the battery 2 | from config import Battery 3 | 4 | class BatteryAbstraction: 5 | VoltageMax = 4250 6 | VoltageNow = 0 7 | Charging = 1 8 | 9 | @classmethod 10 | def readV(self): 11 | try: 12 | f = open(Battery["voltage"]) 13 | except IOError: 14 | print("Couldn't read voltage!") 15 | else: 16 | with f: 17 | val = f.read().strip() 18 | # If the read returns nothing, get the max value 19 | if val == "": 20 | val = self.VoltageMax 21 | self.VoltageNow = int(val) 22 | 23 | @classmethod 24 | def readC(self): 25 | try: 26 | f = open(Battery["charging"]) 27 | except IOError: 28 | print("Couldn't read charge state!") 29 | 30 | else: 31 | with f: 32 | val = f.read().strip() 33 | # If the read returns nothing, get the previous value 34 | if val == "": 35 | val = self.Charging 36 | self.Charging = int(val) == 1 37 | @classmethod 38 | def CurrentVoltage(self): 39 | self.readV() 40 | return self.VoltageNow 41 | 42 | @classmethod 43 | def MaxVoltage(self): 44 | return self.VoltageMax 45 | 46 | @classmethod 47 | def AsPercentage(self): 48 | self.readV() 49 | perc_value = int(( float(self.VoltageNow) / float(self.VoltageMax) ) * 100) 50 | return perc_value 51 | 52 | @classmethod 53 | def IsCharging(self): 54 | self.readC() 55 | return self.Charging 56 | 57 | @classmethod 58 | def test(self): 59 | self.readC() 60 | self.readV() 61 | 62 | print True if self.Charging > 0 else False 63 | print("%s percent" % self.AsPercentage()) 64 | print("%s / %s" % (self.VoltageNow, self.VoltageMax)) 65 | 66 | 67 | if __name__ == '__main__': 68 | # If called stand-alone, return the current charge percentage 69 | BatteryAbstraction.readV() 70 | print ("%s" % BatteryAbstraction.AsPercentage()) -------------------------------------------------------------------------------- /sys.py/config.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | CurKeySet = "PC" ## >>> PC or GameShell <<< 4 | 5 | DontLeave = False 6 | 7 | BackLight = "/sys/class/backlight/backlight/brightness" 8 | AudioControl = "Power Amplifier" 9 | 10 | # We don't use a real device here, just two files: voltage and charging 11 | Battery = {} 12 | Battery["charging"] = "/usr/lib/pocketchip-batt/charging" 13 | Battery["voltage"] = "/usr/lib/pocketchip-batt/voltage" 14 | 15 | UPDATE_URL="https://raw.githubusercontent.com/clockworkpi/CPI/master/launcher_ver.json" 16 | 17 | VERSION="pocket 1.24" 18 | 19 | SKIN="../skin/pocket" 20 | 21 | ## three timer values in seconds: dim screen, close screen,PowerOff 22 | ## zero means no action 23 | PowerLevels = {} 24 | PowerLevels["supersaving"] = [10,30,120] 25 | PowerLevels["powersaving"] = [40,120,300] 26 | PowerLevels["server"] = [40,120,0] 27 | PowerLevels["balance_saving"] = [40,0,0] 28 | 29 | PowerLevel = "balance_saving" 30 | 31 | ##sys.py/.powerlevel 32 | 33 | -------------------------------------------------------------------------------- /sys.py/gameshell/wallpaper/desktopbg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/sys.py/gameshell/wallpaper/desktopbg.jpg -------------------------------------------------------------------------------- /sys.py/gameshell/wallpaper/gameover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/sys.py/gameshell/wallpaper/gameover.png -------------------------------------------------------------------------------- /sys.py/gameshell/wallpaper/loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/sys.py/gameshell/wallpaper/loading.png -------------------------------------------------------------------------------- /sys.py/gameshell/wallpaper/seeyou.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/sys.py/gameshell/wallpaper/seeyou.png -------------------------------------------------------------------------------- /sys.py/gameshell/wallpaper/updating.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/sys.py/gameshell/wallpaper/updating.png -------------------------------------------------------------------------------- /sys.py/langs/00_English.ini: -------------------------------------------------------------------------------- 1 | [Langs] 2 | Settings=Settings 3 | Retro Games=Retro Games 4 | Music Player=Music Player 5 | TinyCloud=Tiny Cloud 6 | PowerOFF=PowerOFF 7 | Reload UI=Reload UI 8 | freeDM=freeDM 9 | CaveStory=CaveStory 10 | RetroArch=RetroArch 11 | Launching=Launching.... 12 | Nav=Nav 13 | Scan=Scan 14 | Back=Back 15 | Enter=Enter 16 | Remove=Remove 17 | Backspace=Backspace 18 | Done=Done 19 | Run=Run 20 | AddToPlayList=Add to Playlist 21 | Add to Playlist=Add to Playlist 22 | DownloadConfirm=Download Confirm 23 | MyFavGames=my favorite games 24 | Deleting=Deleting... 25 | AddFav=Add Fav 26 | ADdFavList=Add to favourite list 27 | Del=Del 28 | Please upload data over Wi-Fi=Please upload data over Wi-Fi 29 | ConfirmDeleteQ=Confirm Delete ? 30 | AlreadyExisted=Already existed 31 | Cancel=Cancel 32 | Yes=Yes 33 | ConfirmQ=Confirm? 34 | Disconnecting=Disconnecting... 35 | ConfirmUpdateToFQ=Confirm Update to %%s ? 36 | UpdateToFQ=Update to %%s ? 37 | SetupGameEngineAutoQ=Do you want to setup this game engine automatically? 38 | Downloading=Downloading... 39 | BATOver5Pct=Battery must over 5%% 40 | DeleteConfirm=Delete Confirm 41 | FavouriteGames=Favourite Games 42 | ConfirmForgetQ=Confirm Forget? 43 | ConfirmForget=Confirm Forget 44 | Disconnect=Disconnect 45 | ConfirmDisconnectQ=Confirm Disconnect ? 46 | Confirm Disconnect=Confirm Disconnect 47 | Forget=Forget 48 | Forgeting=Forgeting... 49 | Info=Info 50 | TryConnect=TryConnect 51 | Bluetooth Info=Bluetooth info 52 | Connecting=Connecting 53 | BluetoothScanning=Bluetooth scanning... 54 | Scanning=Scanning.. 55 | ShutDownConnecting=ShutDownConnecting... 56 | Select=Select 57 | Detail=Detail 58 | Applying=Applying... 59 | DownloadFailed=Download failed 60 | LauncherIsUpToDate=Launcher is up to date 61 | CheckWifiConnection=Please Check your Wi-Fi connection 62 | TurningOn=Turning On 63 | TurningOff=Turning Off 64 | Invalid=Invalid 65 | CheckingUpdate=Checking update... 66 | CheckingUpdateFailed=Checking update failed 67 | Update=Update 68 | Toggle=Toggle 69 | Rescue=Rescue 70 | Airplane Mode=Airplane Mode 71 | minutes=minutes 72 | seconds=seconds 73 | second=second 74 | minute=minute 75 | Never=Never 76 | Power Options=Power Options 77 | Languages=Languages 78 | Setting List=Setting List 79 | Wi-Fi=Wi-Fi 80 | Bluetooth=Bluetooth 81 | Sound Volume=Sound Volume 82 | Sound Volume=Sound volume 83 | Brightness=Brightness 84 | BackLight Brightness=BackLight Brightness 85 | Storage=Storage 86 | Timezone=Timezone 87 | Timezone Selection=Timezone Selection 88 | About=About 89 | Power off=Power off 90 | Buttons Layout=Buttons Layout 91 | UpdateRetroArch=UpdateRetroArch 92 | Wifi scanning=Wifi scanning... 93 | Power option detail=Power option detail 94 | Screen dimming=Screen dimming 95 | Screen OFF=Screen OFF 96 | Power OFF=Power OFF 97 | Power saving=Power saving 98 | Balanced=Balanced 99 | Server=Server 100 | Performance=Performance 101 | Confirm Power OFF?=Confirm Power OFF? 102 | Reboot=Reboot 103 | Shutdown=Shutdown 104 | my favorite music=my favorite music 105 | Check Update=Check Update 106 | -------------------------------------------------------------------------------- /sys.py/langs/01_日本語.ini: -------------------------------------------------------------------------------- 1 | [Langs] 2 | Settings=設定 3 | Retro Games=Retro Games 4 | Music Player=音楽プレーヤー 5 | TinyCloud=Tiny Cloud 6 | PowerOFF=電源オフ 7 | Reload UI=リロードUI 8 | freeDM=デュークニューケム 9 | CaveStory=洞窟物語 10 | RetroArch=RetroArch 11 | Launching=起動中... 12 | Nav=ナビ 13 | Scan=スキャン 14 | Back=後ろ 15 | Enter=エンター 16 | Remove=削除 17 | Backspace=後退 18 | Done=完了 19 | Run=起動 20 | AddToPlayList=再生リストに追加 21 | Add to Playlist=再生リストに追加 22 | DownloadConfirm=ダウンロード確認 23 | MyFavGames=お気に入りのゲーム 24 | Deleting=削除 25 | AddFav=お気に入りに追加 26 | ADdFavList=お気に入りリストに登録 27 | Del=削除 28 | Please upload data over Wi-Fi=Wi-Fiでデータ転送 29 | ConfirmDeleteQ=削除しますか? 30 | AlreadyExisted=既に存在している 31 | Cancel=取り消す 32 | Yes=はい 33 | ConfirmQ=確認? 34 | Disconnecting=接続を切断 35 | ConfirmUpdateToFQ=%%sにアップデートしますか? 36 | UpdateToFQ=%%sにアップデート? 37 | SetupGameEngineAutoQ=ゲームエンジンの自動セットアップを希望しますか? 38 | Downloading=ダウンロード中 39 | BATOver5Pct=バッテリーは5%%以上が必要 40 | DeleteConfirm=削除の確認 41 | FavouriteGames=お気に入りのゲーム 42 | ConfirmForgetQ=無視しますか? 43 | ConfirmForget=無視しますか 44 | Disconnect=接続を切断 45 | ConfirmDisconnectQ=接続を切りますか? 46 | Confirm Disconnect=接続を切りますか 47 | Forget=無視 48 | Forgeting=無視中 49 | Info=情報 50 | TryConnect=接続を試みる 51 | Bluetooth Info=ブルートゥース情報 52 | Connecting=接続中 53 | BluetoothScanning=ブルートゥーススキャン中 54 | Scanning=スキャン中 55 | ShutDownConnecting=接続を切断 56 | Select=選択 57 | Detail=詳細 58 | Applying=応用中 59 | DownloadFailed=ダウンロード失敗 60 | LauncherIsUpToDate=Launcher更新済み 61 | CheckWifiConnection=wifi接続をチェックしてください 62 | TurningOn=開けている 63 | TurningOff=閉じている 64 | Invalid=無効 65 | CheckingUpdate=アップデート確認中 66 | CheckingUpdateFailed=アップデート確認失敗 67 | Update=更新 68 | Toggle=切り替え 69 | Rescue=救う 70 | Airplane Mode=機内モード 71 | minutes=分 72 | seconds=秒 73 | second=秒 74 | minute=分 75 | Never=決してしない 76 | Power Options=電源オプション 77 | Languages=言語 78 | Setting List=設定リスト 79 | Wi-Fi=Wi-Fi 80 | Bluetooth=ブルートゥース 81 | Sound Volume=音量 82 | Sound Volume=音量 83 | Brightness=明るさ 84 | BackLight Brightness=バックライトの明るさ 85 | Storage=ストレージ 86 | Timezone=時地 87 | Timezone Selection=タイムゾーン選択 88 | About=について 89 | Power off=電源オフ 90 | Buttons Layout=ボタンの配置 91 | UpdateRetroArch=RetroArchを更新 92 | Wifi scanning=wifiスキャン中 93 | Power option detail=電源オプション 94 | Screen dimming=画面が暗くなる 95 | Screen OFF=スクリーンオフ 96 | Power OFF=電源オフ 97 | Power saving=省エネルギー 98 | Balanced=バランス 99 | Server=サーバ 100 | Performance=性能 101 | Confirm Power OFF?=電源オフしますか? 102 | Reboot=再起動 103 | Shutdown=シャットダウン 104 | Play List=プレイリスト 105 | Music Library=ミュージックライブラリ 106 | Play/Pause=再生/停止 107 | my favorite music=お気に入り 108 | Check Update=アップデートをチェック 109 | -------------------------------------------------------------------------------- /sys.py/langs/03_简体中文.ini: -------------------------------------------------------------------------------- 1 | [Langs] 2 | Settings=设置 3 | Retro Games=Retro Games 4 | Music Player=音乐播放器 5 | TinyCloud=Tiny Cloud 6 | PowerOFF=关机 7 | Reload UI=重载菜单 8 | freeDM=freeDM 9 | CaveStory=洞窟物语 10 | Launching=正在启动... 11 | Nav=导航 12 | Scan=扫描 13 | Back=返回 14 | Enter=进入 15 | Remove=删除 16 | Backspace=退格 17 | Done=完成 18 | Run=运行 19 | AddToPlayList=添加到播放列表 20 | Add to Playlist=添加到播放列表 21 | DownloadConfirm=下载确认 22 | MyFavGames=加星游戏列表 23 | Deleting=删除中... 24 | AddFav=加星 25 | Del=删 26 | Please upload data over Wi-Fi=请通过无线Wifi上传数据 27 | ConfirmDeleteQ=确认删除? 28 | AlreadyExisted=已存在 29 | Cancel=取消 30 | Yes=是 31 | ConfirmQ=确认? 32 | Disconnecting=断开连接... 33 | ConfirmUpdateToFQ=确认升级至 %%s ? 34 | UpdateToFQ=更新至 %%s ? 35 | SetupGameEngineAutoQ=你希望自动安装游戏引擎部件吗? 36 | Downloading=下载中... 37 | BATOver5Pct=电量必须多余5%% 38 | DeleteConfirm=删除确认 39 | FavouriteGames=偏好游戏 40 | ConfirmForgetQ=确认忽略? 41 | ConfirmForget=确认忽略 42 | Disconnect=断开 43 | ConfirmDisconnectQ=确认断开? 44 | Confirm Disconnect=确认断开 45 | Forget=忽略 46 | Forgeting=忽略中... 47 | Info=属性 48 | TryConnect=试连接 49 | Bluetooth Info=蓝牙属性 50 | Connecting=连接中 51 | BluetoothScanning=蓝牙搜索中... 52 | Scanning=搜索中.. 53 | ShutDownConnecting=断开连接... 54 | Select=选择 55 | Detail=详细 56 | Applying=设置中... 57 | DownloadFailed=下载失败 58 | LauncherIsUpToDate=Launcher已是最新 59 | CheckWifiConnection=请检查 Wi-Fi 连接 60 | TurningOn=打开 61 | TurningOff=关闭 62 | Invalid=非法 63 | CheckingUpdate=检查更新... 64 | CheckingUpdateFailed=检查更新失败 65 | Update=更新 66 | Toggle=切换 67 | Rescue=拯救 68 | Airplane Mode=飞行模式 69 | minutes=分 70 | seconds=秒 71 | second=秒 72 | minute=分 73 | Never=永不 74 | Power Options=电源选项 75 | Languages=语言 76 | Setting List=设置列表 77 | Wi-Fi=Wi-Fi 78 | Bluetooth=蓝牙 79 | Sound Volume=音量 80 | Sound volume=音量 81 | Brightness=亮度 82 | BackLight Brightness=背光亮度 83 | Storage=存储空间 84 | Timezone=时区 85 | Timezone Selection=时区选择 86 | About=关于GameShell 87 | Power off=关机 88 | Buttons Layout=按钮布局 89 | UpdateRetroArch=更新RetroArch 90 | Wifi scanning=WiFi扫描中 91 | Power option detail=电源选项 92 | Screen dimming=屏幕变暗 93 | Screen OFF=关闭屏幕 94 | Power OFF=关机 95 | Power saving=节能 96 | Balanced=平衡 97 | Server=服务器 98 | Performance=性能 99 | Confirm Power OFF?=确认关机? 100 | Reboot=重启 101 | Shutdown=关闭 102 | Play List=播放列表 103 | Music Library=乐库 104 | Play/Pause=播放/暂停 105 | my favorite music=我的音乐库 106 | Check Update=检查更新 107 | Switch to LauncherGo=切换至LauncherGo 108 | GPU driver switch=切换GPU驱动 109 | Network gateway switch=切换网关 110 | Rebooting to LauncherGo=正在重启至LauncherGo... 111 | Awaiting Input=等待输入中... 112 | -------------------------------------------------------------------------------- /sys.py/langs/04_繁体中文.ini: -------------------------------------------------------------------------------- 1 | [Langs] 2 | Settings=設置 3 | Retro Games=Retro Games 4 | Music Player=音樂播放器 5 | TinyCloud=Tiny Cloud 6 | PowerOFF=關機 7 | Reload UI=重載菜單 8 | freeDM=freeDM 9 | CaveStory=洞窟物語 10 | Launching=正在啟動... 11 | Nav=導航 12 | Scan=掃描 13 | Back=返回 14 | Enter=進入 15 | Remove=刪除 16 | Backspace=退格 17 | Done=完成 18 | Run=運行 19 | AddToPlayList=添加到播放列表 20 | Add to Playlist=添加到播放列表 21 | DownloadConfirm=下載確認 22 | MyFavGames=加星遊戲列表 23 | Deleting=刪除中... 24 | AddFav=加星 25 | Del=刪 26 | Please upload data over Wi-Fi=請通過無線Wifi上傳數據 27 | ConfirmDeleteQ=確認刪除? 28 | AlreadyExisted=已存在 29 | Cancel=取消 30 | Yes=是 31 | ConfirmQ=確認? 32 | Disconnecting=斷開連接... 33 | ConfirmUpdateToFQ=確認升級至 %%s ? 34 | UpdateToFQ=更新至 %%s ? 35 | SetupGameEngineAutoQ=你希望自動安裝遊戲引擎部件嗎? 36 | Downloading=下載中... 37 | BATOver5Pct=電量必須多余5%% 38 | DeleteConfirm=刪除確認 39 | FavouriteGames=偏好遊戲 40 | ConfirmForgetQ=確認忽略? 41 | ConfirmForget=確認忽略 42 | Disconnect=斷開 43 | ConfirmDisconnectQ=確認斷開? 44 | Confirm Disconnect=確認斷開 45 | Forget=忽略 46 | Forgeting=忽略中... 47 | Info=屬性 48 | TryConnect=試連接 49 | Bluetooth Info=藍牙屬性 50 | Connecting=連接中 51 | BluetoothScanning=藍牙搜索中... 52 | Scanning=搜索中.. 53 | ShutDownConnecting=斷開連接... 54 | Select=選擇 55 | Detail=詳細 56 | Applying=設置中... 57 | DownloadFailed=下載失敗 58 | LauncherIsUpToDate=Launcher已是最新 59 | CheckWifiConnection=請檢查 Wi-Fi 連接 60 | TurningOn=打開 61 | TurningOff=關閉 62 | Invalid=非法 63 | CheckingUpdate=檢查更新... 64 | CheckingUpdateFailed=檢查更新失敗 65 | Update=更新 66 | Toggle=切換 67 | Rescue=拯救 68 | Airplane Mode=飛行模式 69 | minutes=分 70 | seconds=秒 71 | second=秒 72 | minute=分 73 | Never=永不 74 | Power Options=電源選項 75 | Languages=語言 76 | Setting List=設置列表 77 | Wi-Fi=Wi-Fi 78 | Bluetooth=藍牙 79 | Sound Volume=音量 80 | Sound volume=音量 81 | Brightness=亮度 82 | BackLight Brightness=背光亮度 83 | Storage=存儲空間 84 | Timezone=時區 85 | Timezone Selection=時區選擇 86 | About=關於GameShell 87 | Power off=關機 88 | Buttons Layout=按鈕布局 89 | UpdateRetroArch=更新RetroArch 90 | Wifi scanning=WiFi掃描中 91 | Power option detail=電源選項 92 | Screen dimming=屏幕變暗 93 | Screen OFF=關閉屏幕 94 | Power OFF=關機 95 | Power saving=節能 96 | Balanced=平衡 97 | Server=服務器 98 | Performance=性能 99 | Confirm Power OFF?=確認關機? 100 | Reboot=重啟 101 | Shutdown=關閉 102 | Play List=播放列表 103 | Music Library=樂庫 104 | Play/Pause=播放/暫停 105 | my favorite music=我的音樂庫 106 | Check Update=檢查更新 107 | -------------------------------------------------------------------------------- /sys.py/langs/05_Spanish.ini: -------------------------------------------------------------------------------- 1 | [Langs] 2 | Settings=Opciones 3 | Retro Games=Juegos Retro 4 | Indie Games=Juegos Indie 5 | Music Player=Música 6 | TinyCloud=TinyCloud 7 | PowerOFF=Apagar 8 | Reload UI=Recargar IU 9 | freeDM=freeDM 10 | CaveStory=CaveStory 11 | RetroArch=RetroArch 12 | Launching=Cargando.... 13 | Nav=Nav 14 | Scan=Buscar 15 | Back=Volver 16 | Enter=Entrar 17 | Remove=Borrar 18 | Backspace=Borrar 19 | Done=Hecho 20 | Run=Abrir 21 | AddToPlayList=Añadir a lista 22 | Add to Playlist=Añadir a lista 23 | DownloadConfirm=Confirmar descarga 24 | Download Confirm=Confirmar descarga 25 | MyFavGames=mis juegos favoritos 26 | Deleting=Borrando... 27 | AddFav=Favorito 28 | AddFavList=Añadido a favoritos 29 | Del=Borrar 30 | Please upload data over Wi-Fi=Carga datos por Wi-Fi 31 | ConfirmDeleteQ=¿Confirmar borrado? 32 | AlreadyExisted=Ya existía 33 | Cancel=Cancelar 34 | Yes=Sí 35 | ConfirmQ=¿Confirmar? 36 | Disconnecting=Desconectando... 37 | ConfirmUpdateToFQ=¿Confirmar actualización al %%s ? 38 | UpdateToFQ=¿Actualizar al %%s ? 39 | SetupGameEngineAutoQ=¿Descargar emulador? 40 | Downloading=Descargando... 41 | BATOver5Pct=La batería debe ser superior al 5%% 42 | DeleteConfirm=Confirmar borrado 43 | FavouriteGames=Juegos favoritos 44 | ConfirmForgetQ=¿Confirmar olvidar? 45 | ConfirmForget=Confirmar olvidar 46 | Disconnect=Desconectar 47 | ConfirmDisconnectQ=¿Confirmar desconectar? 48 | Confirm Disconnect=Confirmar desconectar 49 | Forget=Olvidar 50 | Forgeting=Olvidando... 51 | Info=Info 52 | TryConnect=Intentar conectar 53 | Bluetooth Info=Info Bluetooth 54 | Connecting=Conectando 55 | BluetoothScanning=Escaneando Bluetooth... 56 | Scanning=Escaneando... 57 | ShutDownConnecting=Terminando conectar... 58 | Select=Seleccionar 59 | Detail=Detalle 60 | Applying=Aplicando... 61 | DownloadFailed=Descarga fallida 62 | LauncherIsUpToDate=Lanzador ya actualizado 63 | CheckWifiConnection=Comprueba tu conexión Wi-Fi 64 | TurningOn=Encendiendo 65 | TurningOff=Apagando 66 | Invalid=Inválido 67 | CheckingUpdate=Comprobando actualizaciones... 68 | CheckingUpdateFailed=Fallo al comprobar 69 | Update=Actualizar 70 | Toggle=Alternar 71 | Rescue=Rescatar 72 | Airplane Mode=Modo avión 73 | minutes=minutos 74 | seconds=segundos 75 | second=segundo 76 | minute=minuto 77 | Never=Nunca 78 | Power Options=Opciones de energía 79 | Languages=Idiomas 80 | Setting List=Lista de opciones 81 | Wi-Fi=Wi-Fi 82 | Bluetooth=Bluetooth 83 | Sound Volume=Volumen de sonido 84 | Sound volume=Volumen de sonido 85 | Brightness=Brillo 86 | BackLight Brightness=Brillo de pantalla 87 | Storage=Almacenamiento 88 | Timezone=Zona horaria 89 | Timezone Selection=Seleccionar zona horaria 90 | About=Acerca de 91 | Power off=Apagar 92 | Buttons Layout=Disposición de botones 93 | UpdateRetroArch=Actualizar RetroArch 94 | Wifi scanning=Buscando Wifi... 95 | Power option detail=Detalle opciones energía 96 | Screen dimming=Oscurecer pantalla 97 | Screen OFF=Apagar pantalla 98 | Power OFF=Apagar 99 | Power saving=Ahorro energía 100 | Balanced=Equilibrado 101 | Server=Servidor 102 | Performance=Rendimiento 103 | Confirm Power OFF?=¿Confirmar apagado? 104 | Reboot=Reiniciar 105 | Shutdown=Apagar 106 | my favorite music=mi música favorita 107 | Check Update=Buscar actualizaciones 108 | Switch to LauncherGo=Cambiar a LauncherGo 109 | GPU driver switch=Cambiar controlador gráfico 110 | Network gateway switch=Cambiar pasarela de red 111 | Gateway switch=Cambiar pasarela 112 | Clear All=Limpiar todo 113 | Cleaning up=Limpiando 114 | Overwrite RA conf=Restaurar conf RA 115 | Music Library=Biblioteca musical 116 | Play List=Lista de reproducción 117 | Play/Pause=Repr/Pausa 118 | Awaiting Input=Escoge una opción 119 | Scan wifi=Escanear Wifi 120 | Wifi info=Información Wifi -------------------------------------------------------------------------------- /sys.py/langs/06_French.ini: -------------------------------------------------------------------------------- 1 | [Langs] 2 | Settings=Réglages 3 | Retro Games=Jeux Retro 4 | Music Player=Musique 5 | TinyCloud=Tiny Cloud 6 | PowerOFF=Arrêt 7 | Reload UI=Recharger IU 8 | freeDM=FreeDooM 9 | CaveStory=CaveStory 10 | RetroArch=RetroArch 11 | Launching=Lancement ... 12 | Nav=Nav 13 | Scan=Scan 14 | Back=Retour 15 | Enter=Entrer 16 | Remove=Supprimer 17 | Backspace=Retour Arrière 18 | Done=Valider 19 | Run=Lancer 20 | AddToPlayList=Ajouter à la playlist 21 | Add to Playlist=Ajouter à la playlist 22 | DownloadConfirm=Confirmer le téléchargement 23 | MyFavGames=Mes jeux favoris 24 | Deleting=Suppression ... 25 | AddFav=Ajouter Favoris 26 | ADdFavList=Ajouter à la liste des favoris 27 | Del=Suppr 28 | Please upload data over Wi-Fi=Aucun fichier 29 | ConfirmDeleteQ=Confirmer la suppression ? 30 | AlreadyExisted=Déjà existant 31 | Cancel=Annuler 32 | Yes=Confirmer 33 | ConfirmQ=Confirmer ? 34 | Disconnecting=Déconnexion ... 35 | ConfirmUpdateToFQ=Confirmer la mise à jour vers %%s ? 36 | UpdateToFQ=Mise à jour vers %%s ? 37 | SetupGameEngineAutoQ=Souhaitez vous installer le moteur du jeux automatiquement ? 38 | Downloading=Téléchargement ... 39 | BATOver5Pct=La batterie doit être à plus de 5% 40 | DeleteConfirm=Suppression effectué 41 | FavouriteGames=Jeux favoris 42 | ConfirmForgetQ=Confirmer l'oubli ? 43 | ConfirmForget=Oubli confirmé 44 | Disconnect=Déconnecter 45 | ConfirmDisconnectQ=Confirmer la déconnexion ? 46 | Confirm Disconnect=Déconnexion effectué 47 | Forget=Oubli 48 | Forgeting=Oubli ... 49 | Info=Info 50 | TryConnect=Se connecter 51 | Bluetooth Info=Info sur le Bluetooth 52 | Connecting=Connexion 53 | BluetoothScanning=Scan Bluetooth en cours ... 54 | Scanning=Scan ... 55 | ShutDownConnecting=Arrêt de la connexion ... 56 | Select=Sélectionner 57 | Detail=Détail 58 | Applying=Application ... 59 | DownloadFailed=Échec du téléchargement 60 | LauncherIsUpToDate=Le lanceur est à jour 61 | CheckWifiConnection=Veuillez vérifier votre connexion Wi-Fi 62 | TurningOn=Allumage 63 | TurningOff=Extinction 64 | Invalid=Invalide 65 | CheckingUpdate=Vérification des mises à jour ... 66 | CheckingUpdateFailed=Échec de la vérification des mises à jour 67 | Update=Mise à jour 68 | Toggle=Basculer 69 | Rescue=Récupération 70 | Airplane Mode=Mode avion 71 | minutes=minutes 72 | seconds=secondes 73 | second=seconde 74 | minute=minute 75 | Never=Jamais 76 | Power Options=Gestion de l'alimentation 77 | Languages=Langues 78 | Setting List=Liste des réglages 79 | Wi-Fi=Wi-Fi 80 | Bluetooth=Bluetooth 81 | Sound Volume=Volume sonore 82 | Sound volume=Volume sonore 83 | Brightness=Luminosité 84 | BackLight Brightness=Rétroéclairage 85 | Storage=Stockage 86 | Timezone=Fuseau horaire 87 | Timezone Selection=Liste des fuseaux horaire 88 | About=À propos 89 | Power off=Arrêt 90 | Buttons Layout=Mappage des touches 91 | UpdateRetroArch=Mettre à jour RetroArch 92 | Wifi scanning=Scan Wi-Fi en cours ... 93 | Power option detail=Détail de l'option 94 | Screen dimming=Atténuation de l'écran 95 | Screen OFF=Extinction de l'écran 96 | Power OFF=Arrêt de l'appareil 97 | Power saving=Économique 98 | Balanced=Équilibré 99 | Server=Serveur 100 | Performance=Performance 101 | Confirm Power OFF?=Confirmer l’arrêt ? 102 | Reboot=Redémarrage 103 | Shutdown=Extinction 104 | my favorite music=Ma musique favorite 105 | Check Update=Vérifier les mises à jour -------------------------------------------------------------------------------- /sys.py/libs/DBUS/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import dbus 4 | import dbus.service 5 | 6 | import sys 7 | from wicd import misc 8 | ##misc.to_bool 9 | ##misc.misc.noneToString 10 | ##misc.to_unicode 11 | ##misc.Noneify 12 | from wicd.translations import _ 13 | from wicd import wpath 14 | from wicd import dbusmanager 15 | from wicd import misc 16 | 17 | import time 18 | import gobject 19 | 20 | if getattr(dbus, 'version', (0, 0, 0)) < (0, 80, 0): 21 | import dbus.glib 22 | else: 23 | from dbus.mainloop.glib import DBusGMainLoop 24 | DBusGMainLoop(set_as_default=True) 25 | 26 | bus = daemon = wireless = wired = None 27 | 28 | manager = objects = adapter = None 29 | devices = {} 30 | 31 | def setup_dbus(force=True): 32 | global bus,daemon,wireless,wired 33 | global manager,objects,adapter,devices 34 | 35 | try: 36 | dbusmanager.connect_to_dbus() 37 | except dbus.DBusException: 38 | print >> sys.stderr,\ 39 | _("Can't connect to wicd daemon,trying to start it automatically...") 40 | else: 41 | bus = dbusmanager.get_bus() 42 | dbus_ifaces = dbusmanager.get_dbus_ifaces() 43 | daemon = dbus_ifaces["daemon"] ## @dbus.service.method('org.wicd.daemon') 44 | wireless = dbus_ifaces["wireless"] ## @dbus.service.method('org.wicd.daemon.wireless') 45 | wired = dbus_ifaces["wired"] ## @ 46 | 47 | 48 | ### BlueZ 49 | try: 50 | proxy_obj = bus.get_object("org.bluez", "/") 51 | manager = dbus.Interface(proxy_obj,"org.freedesktop.DBus.ObjectManager") 52 | objects = manager.GetManagedObjects() 53 | 54 | for path, interfaces in objects.iteritems(): 55 | if "org.bluez.Device1" in interfaces: 56 | devices[path] = interfaces["org.bluez.Device1"] ## like /org/bluez/hci0/dev_xx_xx_xx_yy_yy_yy 57 | 58 | proxy_obj = bus.get_object("org.bluez", "/org/bluez/hci0") 59 | adapter = dbus.Interface(proxy_obj, "org.bluez.Adapter1") 60 | except Exception as e: 61 | print(str(e)) 62 | 63 | if not daemon: 64 | print("Error connecting to wicd via D-Bus") 65 | 66 | 67 | 68 | 69 | return True 70 | 71 | 72 | def wifi_strength(): 73 | fast = not daemon.NeedsExternalCalls() 74 | if not fast: 75 | iwconfig = wireless.GetIwconfig() 76 | else: 77 | iwconfig = '' 78 | 79 | if daemon.GetSignalDisplayType() == 0: 80 | strength = wireless.GetCurrentSignalStrength(iwconfig) 81 | else: 82 | strength = wireless.GetCurrentDBMStrength(iwconfig) 83 | 84 | return strength 85 | 86 | 87 | def get_wifi_ip(): 88 | if wireless == None: 89 | return None 90 | return wireless.GetWirelessIP('') 91 | 92 | def is_wifi_connected_now(): 93 | if wireless == None: 94 | return False 95 | 96 | wireless_connecting = wireless.CheckIfWirelessConnecting() 97 | fast = not daemon.NeedsExternalCalls() 98 | if wireless_connecting: 99 | return False 100 | else: 101 | if not fast: 102 | iwconfig = wireless.GetIwconfig() 103 | else: 104 | iwconfig = '' 105 | if check_for_wireless(iwconfig,wireless.GetWirelessIP(''),None): 106 | return True 107 | else: 108 | return False 109 | 110 | def check_for_wireless(iwconfig,wireless_ip,set_status): 111 | if not wireless_ip: 112 | return False 113 | network = wireless.GetCurrentNetwork(iwconfig) 114 | if not network: 115 | return False 116 | network = misc.to_unicode(network) 117 | if daemon.GetSignalDisplayType() == 0: 118 | strength = wireless.GetCurrentSignalStrength(iwconfig) 119 | else: 120 | strength = wireless.GetCurrentDBMStrength(iwconfig) 121 | 122 | if strength is None: 123 | return False 124 | 125 | strength = misc.to_unicode(daemon.FormatSignalForPrinting(strength)) 126 | ip = misc.to_unicode(wireless_ip) 127 | 128 | """ 129 | print(_('dbus Connected to $A at $B (IP: $C)').replace 130 | ('$A', network).replace 131 | ('$B', strength).replace 132 | ('$C', ip)) 133 | """ 134 | return True 135 | -------------------------------------------------------------------------------- /sys.py/libs/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/launcher/2674abcf03b3e04547b8669f9334f97e4cf4e952/sys.py/libs/__init__.py -------------------------------------------------------------------------------- /sys.py/libs/bluezutils/__init__.py: -------------------------------------------------------------------------------- 1 | import dbus 2 | 3 | SERVICE_NAME = "org.bluez" 4 | ADAPTER_INTERFACE = SERVICE_NAME + ".Adapter1" 5 | DEVICE_INTERFACE = SERVICE_NAME + ".Device1" 6 | 7 | def get_managed_objects(): 8 | bus = dbus.SystemBus() 9 | manager = dbus.Interface(bus.get_object("org.bluez", "/"), 10 | "org.freedesktop.DBus.ObjectManager") 11 | return manager.GetManagedObjects() 12 | 13 | def find_adapter(pattern=None): 14 | return find_adapter_in_objects(get_managed_objects(), pattern) 15 | 16 | def find_adapter_in_objects(objects, pattern=None): 17 | bus = dbus.SystemBus() 18 | for path, ifaces in objects.iteritems(): 19 | adapter = ifaces.get(ADAPTER_INTERFACE) 20 | if adapter is None: 21 | continue 22 | if not pattern or pattern == adapter["Address"] or \ 23 | path.endswith(pattern): 24 | obj = bus.get_object(SERVICE_NAME, path) 25 | return dbus.Interface(obj, ADAPTER_INTERFACE) 26 | raise Exception("Bluetooth adapter not found") 27 | 28 | def find_device(device_address, adapter_pattern=None): 29 | return find_device_in_objects(get_managed_objects(), device_address, 30 | adapter_pattern) 31 | 32 | def find_device_in_objects(objects, device_address, adapter_pattern=None): 33 | bus = dbus.SystemBus() 34 | path_prefix = "" 35 | if adapter_pattern: 36 | adapter = find_adapter_in_objects(objects, adapter_pattern) 37 | path_prefix = adapter.object_path 38 | for path, ifaces in objects.iteritems(): 39 | device = ifaces.get(DEVICE_INTERFACE) 40 | if device is None: 41 | continue 42 | if (device["Address"] == device_address and 43 | path.startswith(path_prefix)): 44 | obj = bus.get_object(SERVICE_NAME, path) 45 | return dbus.Interface(obj, DEVICE_INTERFACE) 46 | 47 | raise Exception("Bluetooth device not found") 48 | -------------------------------------------------------------------------------- /sys.py/libs/easing.py: -------------------------------------------------------------------------------- 1 | 2 | import math 3 | 4 | 5 | def SineIn(t, b, c, d): 6 | return -c * math.cos(t/d * (math.pi/2)) + c + b 7 | 8 | -------------------------------------------------------------------------------- /sys.py/libs/roundrects/__init__.py: -------------------------------------------------------------------------------- 1 | from .roundrects import aa_round_rect, round_rect 2 | -------------------------------------------------------------------------------- /sys.py/libs/roundrects/roundrects.py: -------------------------------------------------------------------------------- 1 | """ 2 | Rounded rectangles in both non-antialiased and antialiased varieties. 3 | """ 4 | 5 | import pygame as pg 6 | 7 | from pygame import gfxdraw 8 | 9 | 10 | def round_rect(surface, rect, color, rad=20, border=0, inside=(0,0,0,0)): 11 | """ 12 | Draw a rect with rounded corners to surface. Argument rad can be specified 13 | to adjust curvature of edges (given in pixels). An optional border 14 | width can also be supplied; if not provided the rect will be filled. 15 | Both the color and optional interior color (the inside argument) support 16 | alpha. 17 | """ 18 | rect = pg.Rect(rect) 19 | zeroed_rect = rect.copy() 20 | zeroed_rect.topleft = 0,0 21 | image = pg.Surface(rect.size).convert_alpha() 22 | image.fill((0,0,0,0)) 23 | _render_region(image, zeroed_rect, color, rad) 24 | if border: 25 | zeroed_rect.inflate_ip(-2*border, -2*border) 26 | _render_region(image, zeroed_rect, inside, rad) 27 | surface.blit(image, rect) 28 | 29 | 30 | def _render_region(image, rect, color, rad): 31 | """Helper function for round_rect.""" 32 | corners = rect.inflate(-2*rad, -2*rad) 33 | for attribute in ("topleft", "topright", "bottomleft", "bottomright"): 34 | pg.draw.circle(image, color, getattr(corners,attribute), rad) 35 | image.fill(color, rect.inflate(-2*rad,0)) 36 | image.fill(color, rect.inflate(0,-2*rad)) 37 | 38 | 39 | def aa_round_rect(surface, rect, color, rad=20, border=0, inside=(0,0,0)): 40 | """ 41 | Draw an antialiased rounded rect on the target surface. Alpha is not 42 | supported in this implementation but other than that usage is identical to 43 | round_rect. 44 | """ 45 | rect = pg.Rect(rect) 46 | _aa_render_region(surface, rect, color, rad) 47 | if border: 48 | rect.inflate_ip(-2*border, -2*border) 49 | _aa_render_region(surface, rect, inside, rad) 50 | 51 | 52 | def _aa_render_region(image, rect, color, rad): 53 | """Helper function for aa_round_rect.""" 54 | corners = rect.inflate(-2*rad-1, -2*rad-1) 55 | for attribute in ("topleft", "topright", "bottomleft", "bottomright"): 56 | x, y = getattr(corners, attribute) 57 | gfxdraw.aacircle(image, x, y, rad, color) 58 | gfxdraw.filled_circle(image, x, y, rad, color) 59 | image.fill(color, rect.inflate(-2*rad,0)) 60 | image.fill(color, rect.inflate(0,-2*rad)) 61 | --------------------------------------------------------------------------------