mirror of
https://github.com/clockworkpi/LauncherGoDev.git
synced 2026-03-19 10:22:41 +01:00
add Switch to python launcher
This commit is contained in:
32
Menu/GameShell/10_Settings/LauncherPy/plugin_init.go
Normal file
32
Menu/GameShell/10_Settings/LauncherPy/plugin_init.go
Normal 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
|
||||
Reference in New Issue
Block a user