test update

This commit is contained in:
cuu 2018-12-08 16:24:38 +08:00
parent 748174b83a
commit 02786260f5
4 changed files with 10 additions and 7 deletions

View File

@ -52,8 +52,10 @@ func (self *UpdateConfirmPage) KeyDown(ev *event.Event) {
}
if ev.Data["Key"] == UI.CurKeys["B"] {
fmt.Println("Update Confirm Page B",self.GIT)
if self.GIT == true {
cmdpath := fmt.Sprintf("update.sh %s ",self.Version)
//go exec requires FullPath of script filename
cmdpath := fmt.Sprintf("%s/update.sh %s",UI.GetExePath(),self.Version)
event.Post(UI.RUNSH,cmdpath)
return
}
@ -229,7 +231,7 @@ func (self *UpdatePage) KeyDown(ev *event.Event) {
}
if ev.Data["Key"] == UI.CurKeys["X"] {
if self.Screen.DBusManager.IsWifiConnectedNow() == true {
if self.Screen.DBusManager.IsWifiConnectedNow() == false {
if self.CheckUpdate() == true {
self.Screen.Draw()
self.Screen.SwapAndShow()

View File

@ -262,7 +262,7 @@ func run() int {
UI.SwapAndShow()
//fmt.Println(main_screen)
event.AllocEvents(3)
event.AddCustomEvent(UI.RUNEVT)
event.AddCustomEvent(UI.RUNSH)
@ -307,9 +307,9 @@ func run() int {
gogame.Quit()
fmt.Println("RUNSH")
exec_app_cmd := ev.Data["Msg"]
exec_app_cmd := ev.Data["Msg"]+";"
fmt.Println(exec_app_cmd)
cmd := exec.Command("/bin/sh",exec_app_cmd)
cmd := exec.Command("/bin/sh","-c",exec_app_cmd)
err := cmd.Start()
if err != nil {
fmt.Println(err)

View File

@ -9,7 +9,7 @@ type PowerLevel struct {
var PowerLevels map[string]*PowerLevel
var (
CurKeySet = "GameShell" // PC or GameShell
CurKeySet = "PC" // PC or GameShell
DontLeave = false
BackLight = "/proc/driver/backlight"
Battery = "/sys/class/power_supply/axp20x-battery/uevent"

View File

@ -1,5 +1,6 @@
#!/bin/bash
sleep 10
feh --bg-center /home/cpi/launchergo/sysgo/gameshell/wallpaper/updating.png
cd /home/cpi/launchergo
git pull