diff --git a/Menu/GameShell/10_Settings/Update/update_page.go b/Menu/GameShell/10_Settings/Update/update_page.go index 970f5e6..f065abb 100644 --- a/Menu/GameShell/10_Settings/Update/update_page.go +++ b/Menu/GameShell/10_Settings/Update/update_page.go @@ -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 } } diff --git a/main.go b/main.go index e090a0a..ebaf575 100644 --- a/main.go +++ b/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) + } diff --git a/sysgo/UI/events.go b/sysgo/UI/events.go index b36737e..05546c6 100644 --- a/sysgo/UI/events.go +++ b/sysgo/UI/events.go @@ -4,4 +4,5 @@ package UI const ( RUNEVT=1 RESTARTUI=2 + RUNSH=3 ) diff --git a/sysgo/UI/title_bar.go b/sysgo/UI/title_bar.go index a98b5ad..d388532 100644 --- a/sysgo/UI/title_bar.go +++ b/sysgo/UI/title_bar.go @@ -148,6 +148,7 @@ func (self *TitleBar) RoundRobinCheck() { self.CheckBatteryStat() ///self.CheckBluetooth() self.UpdateWifiStrength() + SwapAndShow() }else if self.InLowBackLight >= 0 { self.InLowBackLight +=1 diff --git a/update.sh b/update.sh new file mode 100755 index 0000000..0003e2f --- /dev/null +++ b/update.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +feh --bg-center /home/cpi/launchergo/sysgo/gameshell/wallpaper/updating.png +cd /home/cpi/launchergo +git pull +git reset --hard $1 +feh --bg-center /home/cpi/launchergo/sysgo/gameshell/wallpaper/loading.png +./load.sh +