mirror of
https://github.com/clockworkpi/LauncherGoDev.git
synced 2025-12-12 16:08:52 +01:00
add update.sh ,RUNSH
This commit is contained in:
parent
04f8f9096c
commit
748174b83a
@ -53,13 +53,8 @@ func (self *UpdateConfirmPage) KeyDown(ev *event.Event) {
|
||||
|
||||
if ev.Data["Key"] == UI.CurKeys["B"] {
|
||||
if self.GIT == true {
|
||||
cmdpath := fmt.Sprintf("feh --bg-center %s/sysgo/gameshell/wallpaper/updating.png; cd %s ;git pull; git reset --hard %s ; feh --bg-center %s/sysgo/gameshell/wallpaper/loading.png ",
|
||||
launchergo_path,
|
||||
launchergo_path,
|
||||
self.Version,
|
||||
launchergo_path )
|
||||
|
||||
event.Post(UI.RUNEVT,cmdpath)
|
||||
cmdpath := fmt.Sprintf("update.sh %s ",self.Version)
|
||||
event.Post(UI.RUNSH,cmdpath)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
20
main.go
20
main.go
@ -264,6 +264,7 @@ func run() int {
|
||||
//fmt.Println(main_screen)
|
||||
|
||||
event.AddCustomEvent(UI.RUNEVT)
|
||||
event.AddCustomEvent(UI.RUNSH)
|
||||
|
||||
go FlashLed1(main_screen)
|
||||
go InspectionTeam(main_screen)
|
||||
@ -300,6 +301,25 @@ func run() int {
|
||||
fmt.Println(err)
|
||||
}
|
||||
os.Exit(0)
|
||||
|
||||
case UI.RUNSH:
|
||||
main_screen.OnExitCb()
|
||||
gogame.Quit()
|
||||
|
||||
fmt.Println("RUNSH")
|
||||
exec_app_cmd := ev.Data["Msg"]
|
||||
fmt.Println(exec_app_cmd)
|
||||
cmd := exec.Command("/bin/sh",exec_app_cmd)
|
||||
err := cmd.Start()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
err = cmd.Process.Release()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
os.Exit(0)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -4,4 +4,5 @@ package UI
|
||||
const (
|
||||
RUNEVT=1
|
||||
RESTARTUI=2
|
||||
RUNSH=3
|
||||
)
|
||||
|
||||
@ -148,6 +148,7 @@ func (self *TitleBar) RoundRobinCheck() {
|
||||
self.CheckBatteryStat()
|
||||
///self.CheckBluetooth()
|
||||
self.UpdateWifiStrength()
|
||||
SwapAndShow()
|
||||
|
||||
}else if self.InLowBackLight >= 0 {
|
||||
self.InLowBackLight +=1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user