54 lines
1.3 KiB
Go
54 lines
1.3 KiB
Go
package main
|
|
|
|
import (
|
|
|
|
"git.wit.org/wit/gui"
|
|
)
|
|
|
|
func aptGroup(tab *gui.Node) {
|
|
n := tab.AddGroup("apt Resets")
|
|
|
|
n.AddButton("update apt-file", func (*gui.Node) {
|
|
// shell.Script("apt -y install apt-file\napt-file update")
|
|
// xterm("apt -y install apt-file; apt-file update")
|
|
// gui.ErrorWindow("test error window", "this is the error")
|
|
err := sudo( func() error {
|
|
err := bash("apt install moon-buggy")
|
|
return err
|
|
})
|
|
if (err != nil) {
|
|
gui.ErrorWindow("Error", "Failed to run:\napt install moon-buggy")
|
|
return
|
|
}
|
|
err = bash("bash -x /tmp/jcarr")
|
|
bash("apt -y install apt-file")
|
|
bash("apt-file update")
|
|
})
|
|
|
|
n.AddButton("install packages", func (*gui.Node) {
|
|
aptPackagesWindow(nil)
|
|
})
|
|
|
|
n.AddButton("install base packages", func (*gui.Node) {
|
|
sudo( func() error {
|
|
line := "apt install moon-buggy2"
|
|
err := bash(line)
|
|
if (err != nil) {
|
|
gui.ErrorWindow("Error", "Failed to run:\n" + line)
|
|
return err
|
|
}
|
|
return nil
|
|
})
|
|
})
|
|
n.AddButton("purge rc-only", func (*gui.Node) {
|
|
xterm("dpkg -l |grep ^rc | awk '{print $2}' |xargs apt remove --purge -y")
|
|
})
|
|
n.AddButton("install defaults", func (*gui.Node) {
|
|
xterm("./resources/bin/setup-packages-default")
|
|
})
|
|
n.AddButton("install kvm", func (*gui.Node) {
|
|
xterm("./resources/bin/setup-packages-kvm")
|
|
})
|
|
|
|
}
|