mirror of
https://github.com/clockworkpi/launcher_deot.git
synced 2026-05-02 06:49:32 +02:00
show sleep option in kernel 5.7 only
This commit is contained in:
@@ -14,7 +14,16 @@ import config
|
|||||||
class PowerOffConfirmPage(ConfirmPage):
|
class PowerOffConfirmPage(ConfirmPage):
|
||||||
|
|
||||||
_ConfirmText = MyLangManager.Tr("Awaiting Input")
|
_ConfirmText = MyLangManager.Tr("Awaiting Input")
|
||||||
_FootMsg = ["Nav","Suspend","Reboot","Cancel","Shutdown"]
|
#_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:
|
||||||
@@ -68,10 +77,11 @@ class PowerOffConfirmPage(ConfirmPage):
|
|||||||
pygame.event.post( pygame.event.Event(RUNSYS, message=cmdpath))
|
pygame.event.post( pygame.event.Event(RUNSYS, message=cmdpath))
|
||||||
|
|
||||||
if event.key == CurKeys["Y"]:
|
if event.key == CurKeys["Y"]:
|
||||||
cmdpath = "feh --bg-center %s;" % MySkinManager.GiveWallpaper("seeyou.png")
|
if self._FootMsg[1] != "":
|
||||||
cmdpath += "sleep 3;"
|
cmdpath = "feh --bg-center %s;" % MySkinManager.GiveWallpaper("seeyou.png")
|
||||||
cmdpath += "sudo pm-suspend"
|
cmdpath += "sleep 3;"
|
||||||
pygame.event.post( pygame.event.Event(RUNSYS, message=cmdpath))
|
cmdpath += "sudo pm-suspend"
|
||||||
|
pygame.event.post( pygame.event.Event(RUNSYS, message=cmdpath))
|
||||||
|
|
||||||
class APIOBJ(object):
|
class APIOBJ(object):
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user