This commit is contained in:
cuu 2018-07-05 12:30:26 +08:00
parent 2436543ddb
commit 3a1104434b
2 changed files with 15 additions and 14 deletions

View File

@ -33,8 +33,19 @@ class CounterScreen(FullScreen):
def GObjectInterval(self):
self._inter_counter+=1
if self._Number == 0:
self._Counting = False
print("do the real shutdown")
if config.CurKeySet != "PC":
cmdpath = "feh --bg-center gameshell/wallpaper/seeyou.png;"
cmdpath += "sleep 3;"
cmdpath += "sudo halt -p"
pygame.event.post( pygame.event.Event(RUNSYS, message=cmdpath))
return False
if self._inter_counter >= 10:
self._Number-=1
self._Number -= 1
if self._Number < 0:
self._Number = 0
print("sub Number %d " % self._Number)
@ -52,23 +63,13 @@ class CounterScreen(FullScreen):
commands.getstatusoutput("echo 1 > /proc/driver/led1")
#turn on
if self._Number == 0:
self._Counting = False
print("do the real shutdown")
if config.CurKeySet != "PC":
cmdpath = "feh --bg-center gameshell/wallpaper/seeyou.png;"
cmdpath += "sleep 3;"
cmdpath += "sudo halt -p"
pygame.event.post( pygame.event.Event(RUNSYS, message=cmdpath))
return self._Counting
def StartCounter(self):
if self._Counting == True:
return
self._Number = 10
self._Counting = True
self._GobjectIntervalId = gobject.timeout_add(100,self.GObjectInterval)

View File

@ -19,7 +19,7 @@ SKIN="default"
## three timer values in seconds: dim screen, close screen,PowerOff
## zero means no action
PowerLevels = {}
PowerLevels["supersaving"] = [10,30,100]
PowerLevels["supersaving"] = [10,15,20]
PowerLevels["powersaving"] = [40,120,300]
PowerLevels["balance_saving"] = [40,0,0]