mirror of
https://github.com/clockworkpi/launcher_deot.git
synced 2025-12-13 16:08:58 +01:00
Update __init__.py
This commit is contained in:
parent
13f3f78730
commit
1a2547e55d
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import pygame
|
import pygame
|
||||||
|
import subprocess
|
||||||
|
|
||||||
#UI lib
|
#UI lib
|
||||||
from UI.constants import RUNSYS
|
from UI.constants import RUNSYS
|
||||||
@ -13,7 +14,17 @@ import config
|
|||||||
|
|
||||||
class PowerOffConfirmPage(ConfirmPage):
|
class PowerOffConfirmPage(ConfirmPage):
|
||||||
|
|
||||||
_ConfirmText = MyLangManager.Tr("Confirm Power OFF?")
|
_ConfirmText = MyLangManager.Tr("Awaiting Input")
|
||||||
|
#_FootMsg = ["Nav","Suspend","Reboot","Cancel","Shutdown"]
|
||||||
|
_FootMsg = ["Nav","","Reboot","Cancel","Shutdown"]
|
||||||
|
|
||||||
|
# uname -r
|
||||||
|
st = subprocess.check_output(["uname","-r"])
|
||||||
|
st = st.strip("\n")
|
||||||
|
st = st.strip("\t")
|
||||||
|
|
||||||
|
if "5.7" in st:
|
||||||
|
_FootMsg[1] = "Sleep"
|
||||||
|
|
||||||
def CheckBattery(self):
|
def CheckBattery(self):
|
||||||
try:
|
try:
|
||||||
@ -43,7 +54,6 @@ class PowerOffConfirmPage(ConfirmPage):
|
|||||||
def KeyDown(self,event):
|
def KeyDown(self,event):
|
||||||
|
|
||||||
if IsKeyMenuOrB(event.key):
|
if IsKeyMenuOrB(event.key):
|
||||||
|
|
||||||
self.ReturnToUpLevelPage()
|
self.ReturnToUpLevelPage()
|
||||||
self._Screen.Draw()
|
self._Screen.Draw()
|
||||||
self._Screen.SwapAndShow()
|
self._Screen.SwapAndShow()
|
||||||
@ -61,7 +71,18 @@ class PowerOffConfirmPage(ConfirmPage):
|
|||||||
cmdpath += "sudo halt -p"
|
cmdpath += "sudo halt -p"
|
||||||
pygame.event.post( pygame.event.Event(RUNSYS, message=cmdpath))
|
pygame.event.post( pygame.event.Event(RUNSYS, message=cmdpath))
|
||||||
|
|
||||||
|
if event.key == CurKeys["X"]:
|
||||||
|
cmdpath = "feh --bg-center %s;" % MySkinManager.GiveWallpaper("seeyou.png")
|
||||||
|
cmdpath += "sleep 3;"
|
||||||
|
cmdpath += "sudo reboot"
|
||||||
|
pygame.event.post( pygame.event.Event(RUNSYS, message=cmdpath))
|
||||||
|
|
||||||
|
if event.key == CurKeys["Y"]:
|
||||||
|
if self._FootMsg[1] != "":
|
||||||
|
cmdpath = "feh --bg-center %s;" % MySkinManager.GiveWallpaper("seeyou.png")
|
||||||
|
cmdpath += "sleep 3;"
|
||||||
|
cmdpath += "sudo pm-suspend"
|
||||||
|
pygame.event.post( pygame.event.Event(RUNSYS, message=cmdpath))
|
||||||
|
|
||||||
class APIOBJ(object):
|
class APIOBJ(object):
|
||||||
|
|
||||||
@ -87,4 +108,3 @@ def Init(main_screen):
|
|||||||
OBJ.Init(main_screen)
|
OBJ.Init(main_screen)
|
||||||
def API(main_screen):
|
def API(main_screen):
|
||||||
OBJ.API(main_screen)
|
OBJ.API(main_screen)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user