add Switch to python launcher

This commit is contained in:
cuu
2018-12-05 19:43:07 +08:00
parent aca420aab7
commit bc8193c793
4 changed files with 91 additions and 27 deletions

View File

@@ -0,0 +1,32 @@
package LauncherPy
import (
"os/exec"
"github.com/cuu/gogame/time"
"github.com/cuu/LauncherGoDev/sysgo/UI"
)
/******************************************************************************/
type LauncherPyPlugin struct {
UI.Plugin
}
func (self *LauncherPyPlugin) Init( main_screen *UI.MainScreen ) {
}
func (self *LauncherPyPlugin) Run( main_screen *UI.MainScreen ) {
if main_screen != nil {
main_screen.MsgBox.SetText("Rebooting to Launcher")
main_screen.MsgBox.Draw()
main_screen.SwapAndShow()
time.BlockDelay(300)
cmd := exec.Command("sed","-i","s/launchergo/launcher/g","~/.bashrc")
cmd.Run()
cmd = exec.Command("sudo","reboot")
cmd.Run()
}
}
var APIOBJ LauncherPyPlugin