update mod ,and remove launcher ,GPU switch

This commit is contained in:
cuu
2023-01-03 12:33:24 +00:00
parent 31b08deb4a
commit 19eb2f5701
5 changed files with 34 additions and 86 deletions

View File

@@ -1,44 +0,0 @@
package LauncherPy
import (
"github.com/clockworkpi/LauncherGoDev/sysgo/UI"
"github.com/cuu/gogame/time"
"log"
"os/exec"
"os/user"
)
/******************************************************************************/
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(550)
usr, _ := user.Current()
dir := usr.HomeDir
if usr.Username == "root" {
dir = "/home/cpi"
}
cmd := exec.Command("sed", "-i", "s/launchergo/launcher/g", dir+"/.bashrc")
err := cmd.Run()
if err != nil {
log.Println("sed failed", err)
} else {
cmd = exec.Command("sudo", "reboot")
cmd.Run()
}
}
}
var APIOBJ LauncherPyPlugin

View File

@@ -28,8 +28,6 @@ import (
"github.com/clockworkpi/LauncherGoDev/Menu/GameShell/10_Settings/PowerOFF"
"github.com/clockworkpi/LauncherGoDev/Menu/GameShell/10_Settings/PowerOptions"
"github.com/clockworkpi/LauncherGoDev/Menu/GameShell/10_Settings/TimeZone"
"github.com/clockworkpi/LauncherGoDev/Menu/GameShell/10_Settings/LauncherPy"
"github.com/clockworkpi/LauncherGoDev/Menu/GameShell/10_Settings/Lima"
"github.com/clockworkpi/LauncherGoDev/Menu/GameShell/10_Settings/GateWay"
@@ -114,8 +112,8 @@ func (self *SettingsPage) GenList() []*UI.UIPlugin {
&UI.UIPlugin{UI.PluginPackage, "", "About", "About", &About.APIOBJ},
&UI.UIPlugin{UI.PluginPackage, "", "PowerOFF", "Power off", &PowerOFF.APIOBJ},
&UI.UIPlugin{UI.PluginPackage, "", "ButtonsLayout", "Buttons Layout", &ButtonsLayout.APIOBJ},
&UI.UIPlugin{UI.PluginPackage,"", "LauncherPy", "Switch to Launcher", &LauncherPy.APIOBJ},
&UI.UIPlugin{UI.PluginPackage,"", "Lima", "GPU Driver Switch", &Lima.APIOBJ},
// &UI.UIPlugin{UI.PluginPackage,"", "LauncherPy", "Switch to Launcher", &LauncherPy.APIOBJ},
// &UI.UIPlugin{UI.PluginPackage,"", "Lima", "GPU Driver Switch", &Lima.APIOBJ},
&UI.UIPlugin{UI.PluginPackage, "", "GateWay", "Network gateway switch", &GateWay.APIOBJ},
}